Repository navigation
fix(relay): bound auth admission by the handshake deadline #5765
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
Changes from all commits
16f5d8d
b443096
2425324
5a2f88f
69aa5f4
47f1055
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -188,9 +188,12 @@ impl Serving { | |
| let origin = &self.cluster.origin; | ||
| let directions = self.directions; | ||
| let auth_request = moq_relay::auth::request_for(&self.auth, &request); | ||
| let lease = match self.auth.admit(auth_request).await { | ||
| Ok(lease) => lease, | ||
| Err(err) => { | ||
| // The listener's handshake deadline covers admission; `within` closes a session | ||
| // it gives up on with the timeout code. | ||
| let lease = match request.within(self.auth.admit(auth_request)).await { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For existing AGENTS.md reference: AGENTS.md:L63-L63 Useful? React with 👍 / 👎.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 69aa5f4: (Written by Claude Opus 5.5) |
||
| Err(err) => return Err(anyhow::Error::new(err).context("admission timed out")), | ||
| Ok(Ok(lease)) => lease, | ||
| Ok(Err(err)) => { | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
| let status = axum::http::StatusCode::from(&err); | ||
| let reject = match status { | ||
| axum::http::StatusCode::UNAUTHORIZED => moq_tokio::server::Reject::Unauthorized, | ||
|
|
||
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.
When a downstream directly awaits
moq_auth::Client::connect(ormoq_relay::Auth::admit/Cluster::admit) and the decider never answers, this change now waits forever instead of returning after ten seconds, so existing retry and shutdown paths can silently wedge unless callers add a deadline. I checkedrs/moq-auth/MIGRATE.mdandrs/moq-relay/MIGRATE.md; neither## Unreleasedsection describes that required migration. Add the deadline-wrapping guidance to both affected packages.AGENTS.md reference: AGENTS.md:L63-L63
Useful? React with 👍 / 👎.
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.
Fixed in 2425324:
## Unreleasedentries inrs/moq-auth/MIGRATE.md(Client::connecthas no timeout of its own; wrap it in a deadline) andrs/moq-relay/MIGRATE.md(Auth::admitandCluster::admitare caller-bounded; useRequest::withinortokio::time::timeout, and dropping the future withdraws the admission).(Written by Claude Opus 5.5)