MCPcopy Create free account
hub / github.com/ElementsProject/lightning / auth_socket_io_middleware

Function auth_socket_io_middleware

plugins/rest-plugin/src/handlers.rs:419–436  ·  view source on GitHub ↗
(
    socket: SocketRef,
    socketioxide::extract::State(plugin): socketioxide::extract::State<Plugin<PluginState>>,
)

Source from the content-addressed store, hash-verified

417}
418
419pub async fn auth_socket_io_middleware(
420 socket: SocketRef,
421 socketioxide::extract::State(plugin): socketioxide::extract::State<Plugin<PluginState>>,
422) -> Result<(), AppError> {
423 let rune = socket
424 .req_parts()
425 .headers
426 .get("rune")
427 .and_then(|v| v.to_str().ok())
428 .map(String::from);
429
430 let checkrune_params = CheckRuneParams {
431 nodeid: None,
432 method: Some("listclnrest-notifications".to_owned()),
433 params: None,
434 };
435 verify_rune(&plugin, rune, &checkrune_params).await
436}

Callers

nothing calls this directly

Calls 4

verify_runeFunction · 0.85
mapMethod · 0.80
to_strMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected