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

Function auth_socket_io_middleware

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

Source from the content-addressed store, hash-verified

573}
574
575pub async fn auth_socket_io_middleware(
576 socket: SocketRef,
577 socketioxide::extract::State(plugin): socketioxide::extract::State<Plugin<PluginState>>,
578) -> Result<(), AppError> {
579 let rune = socket
580 .req_parts()
581 .headers
582 .get("rune")
583 .and_then(|v| v.to_str().ok())
584 .map(String::from);
585
586 let checkrune_params = CheckRuneParams {
587 nodeid: None,
588 method: Some("listclnrest-notifications".to_owned()),
589 params: None,
590 };
591 verify_rune(&plugin, rune, &checkrune_params).await
592}

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