Skip to content

multi: extract session ID from context #1045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ellemouton
Copy link
Member

@ellemouton ellemouton commented Apr 20, 2025

Currently, in our RPC interceptors, we use the macaroon data in the request to extract the session ID. This is not ideal since we are using the root key ID of the macaroon and this can cause issues because sometimes we also store the first 4 bytes of an account ID in there. Or it could just be a totally unrelated macaroon that happens to have root key ID that matches with one of our session IDs.

We should instead use a much more reliable way of passing along session ID info: we can do this because any request that comes in via a session, we can intercept and add the session ID to the grpc metadata for the call via the context. This will then be included in the ctx info that LND gets when which interceptors to send the request too. So LND can then send this metadata info back to lit via the lnrpc.RPCMiddlewareRequest message (see PR here), LiT can then extract the session ID in a much more reliable way during request interception.

Depends on:

@ellemouton ellemouton marked this pull request as draft April 20, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant