Repository navigation
feat(relay)!: an attached token arrives as a token, not in the query #8923
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7726f4c
chore(quest): claim quest/m2/auth-attach-token.md
kixelated 9f99184
feat(relay)!: an attached token arrives as a token, not in the query
kixelated a932d8e
Merge origin/main into quest/m2/auth-attach-token
kixelated 5287e4e
fix(auth): moq auth serve reads a previous-release relay's attachment…
kixelated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # [XS] Downstream auth servers read an attached credential from the token field | ||
|
|
||
| ## Goal | ||
|
|
||
| Every auth server a deployment runs behind a relay reads a credential | ||
| attached in band, on `attach` and on that credential's `revalidate` and `end` | ||
| (the events with `auth`), from `token`, not from a `jwt` in `query`. | ||
|
|
||
| ## Plan | ||
|
|
||
| The relay now sends an attached credential as `token` (`kind` 0) and leaves | ||
| `query` as dialed. `moq auth serve` already reads it so; a server that | ||
| verifies `query` at `attach` sees the connection's first credential instead. | ||
| Neither the presented token nor its expiry is then the one admitted. | ||
|
|
||
| Found at moq.pro `9373cdfb3`: `rs/edge/src/auth/mod.rs` reads the credential | ||
| only from `request.query` through `query_jwt` (`:393`), never from | ||
| `request.token`. See `:1312-1317` (`End` forgets the query credential), | ||
| `:1331` (`Attach` and `Revalidate` decide on the query's `jwt`), `:1061`, and | ||
| `limits.rs:179`, `:383`, `:419`. Plain `?jwt=` dials are unaffected. Kixel's | ||
| `src/mesh.ts:557` reads a `credential` query parameter, and its client has no | ||
| attach use today. | ||
|
|
||
| Until moq.pro reads `token`, it must not meet a relay with this change: | ||
| `moq auth serve` reads a previous-release relay's `query` shape for now (a | ||
| marked temporary migration in `rs/moq-auth/src/serve.rs`), but moq.pro has no | ||
| such reader for the new shape. | ||
|
|
||
| ## Waiting | ||
|
|
||
| - Maintainer: check the moq.pro and Kixel auth handlers read `attach` from | ||
| `token`, and fix one that does not before it meets a relay with this change. | ||
| An agent cannot read those private repositories from here. Done when both | ||
| handlers' tests present an attach whose `query` holds an expired `jwt` and | ||
| whose `token` holds a valid one. |
This file was deleted.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.