Repository navigation
engine: a saved session is used only by the edge and client that issued it - #1390
Draft
alexandre-vl wants to merge 1 commit into
Draft
alexandre-vl wants to merge 1 commit into
alexandre-vl wants to merge 1 commit into
Conversation
…ed it An engine loaded session.json whatever edge it was started with, and on its first refresh handed the session's refresh token to that edge. One another edge issued can only be turned down there, and a definitive refusal signs out, deleting the file: a session that still worked where it came from was lost to a single start with another ZERON_EDGE_URL. Zeron 0.3.0's app, which started the engine with production's edge whatever the environment said, signed a self-hosting user out that way each time it started the engine on ~/.zeron. A session now keeps the edge and WorkOS client that issued it (edgeUrl and workosClientId, both optional: files from before still load, and older engines ignore them). An engine of another edge or client starts signed out and leaves the file as it is, saying why in its log; an engine of that edge uses it, its URL written with a trailing slash or not. A session from before says nothing and is taken as this engine's, as before, until its first successful refresh records the edge that took it. Signing in still replaces the file, and `zeron logout` still removes it. a_session_another_edge_issued_is_left_as_it_is, a_session_says_which_edge_and_client_issued_it and a_session_from_before_learns_its_issuer_on_its_first_refresh fail without it.
3 of 4 tasks
Contributor
Author
|
The red checks come from
|
4 of 6 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
session.jsonwhatever edge it was started with, and on its first refresh handed the session's refresh token to that edge.ZERON_EDGE_URLlost a session that still worked where it came from.~/.zeron. The app side is zgx: the app starts its engine against the edge ZERON_EDGE_URL names #1389.edgeUrlandworkosClientIdare optional (#[serde(default)], skipped when unset), and no persisted key is renamed.zeron logoutstill removes it.Test plan
cargo test --locked -p zeron-engine --test auth: 24 passed, three of them new:a_session_another_edge_issued_is_left_as_it_is: another edge, and another client. The session is seeded with a refresh token this edge revokes. The test asserts the engine starts signed out, sends no/auth/refresh, and leaves the file byte-identical.a_session_says_which_edge_and_client_issued_it: a headless sign-in records both, and an engine of that edge with a trailing slash in its URL loads the session.a_session_from_before_learns_its_issuer_on_its_first_refresh.--test local_first(11),--test misc local_profiles(6),--lib auth::(4): pass. They seed sessions without the new fields.cargo clippy --locked -p zeron-engine --all-targets: nothing new. The two warnings inauth.rsandtests/auth.rswere already there.crates/uitests that seedsession.json(state.rs,shell.rs). Their sessions carry no issuer, which load as before.