-
Notifications
You must be signed in to change notification settings - Fork 362
http: check requests for auth using tokens from eyre #5973
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
Conversation
Whenever a session gets created or removed, send the set of valid auth tokens to the runtime, so that it may use them in determining whether incoming requests are authenticated or not.
Accept the newly added %session effect. Store the tokens received in it, and refer back to them when checking requests for authentication. Adds logic for checking requests for authentication based on the presence of a valid urbauth cookie for the host ship, and updated the slogstream endpoint to use that instead of the scry-based authentication check.
joemfb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look reasonable to me. I still need to take a closer look at a couple parts. But I have some notes about releasing stuff like this:
This changes the external vane interface, and therefore requires a kelvin. The change is also required; slog streams will stop working on ships with a new binary and an old arvo, as the set of authentication tokens will be null. (Required in some sense, it's not a major feature.) So we can release the vere changes early, without adding a fallback to the authentication scry.
There's also the basic question of where to put changes like this (ie, "pending next kelvin bump"). I think we probably don't want it on next/arvo, but I'm not sure where it should go.
/cc @philipcmonk
Also adds a dedicated %born test to check if it sends a %sessions gift, and refactors %init and %born running into separate arms to cut down on repetition.
|
This now requires two PRs. @Fang- will cherrypick the vere-related commits off of this to urbit/vere. |
|
@Fang- is this ready to be reviewed? It looks like it, now that the C code is gone. |
|
Yes. This should be fine to go in before/independently of urbit/vere#199, which I still need to address the feedback on. I don't think anything there should affect the interface implemented here. |
Cherry-picked over from urbit/urbit#5973. Depends on the eyre-side change there, so this will be part of a kelvin update. Accept the newly added `%session` effect in the http io driver. Store the tokens received in it, and refer back to them when checking requests for authentication. Adds logic for checking requests for authentication based on the presence of a valid urbauth cookie for the host ship, and updates the slogstream endpoint to use that instead of the scry-based authentication check.
Preparatory work for part of #5927, but these changes can go in on their own.
Adds a
%sessionsgift to eyre that it uses to send a set of valid session tokens to then runtime, both on-%bornand whenever that set changes.Updates
http.cto accept those gifts, and use them for checking authentication on the/~_~/slogprintf stream endpoint by reading the cookie header, if any.Previously it used a clunky scry that put the full cookie string in the path. We should probably consider that scry endpoint deprecated now.
@joemfb perhaps you want these commits as separate PRs?