Repository navigation
Conversation
Author
|
Hi. First PR for this project. I currently use this idp at home so I wanted to help develop it |
yonaadug
force-pushed
the
fix/auth-code-expiry
branch
from
November 2, 2026 21:32
adeddbe to
644a19f
Compare
Member
|
@yonaadug Thank you for the contribution! Can you open an Issue to document this gap (and in the PR description and commit message mention "Fixes #XXX") as well as remove claude from the co-author in the commit. |
serveAuthorize never set ValidTill on the code's AuthRequest, and the token endpoint never checked it. Codes only disappeared when the 10-minute cleanup ran, which treated the zero ValidTill as expired and deleted every pending code, including ones issued seconds earlier. Set ValidTill to now + AuthCodeDuration (5 minutes) when the code is created, and reject expired codes at /token with invalid_grant. Add tests for both: TestServeAuthorize checks that new codes expire within 5 minutes, and TestAuthorizationCodeExpiration checks that /token accepts a fresh code and rejects an expired one. Fixes tailscale#214 Signed-off-by: kebedey16 <kebedey16@gmail.com>
yonaadug
force-pushed
the
fix/auth-code-expiry
branch
from
November 13, 2026 07:15
644a19f to
f676b28
Compare
Author
|
Thanks for reviewing @jentfoo ! |
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.
Fixes #214
serveAuthorize never set ValidTill on the code's AuthRequest, and the token endpoint never checked it. Codes only disappeared when the 10-minute cleanup ran, which treated the zero ValidTill as expired and deleted every pending code, including ones issued seconds earlier.
Set ValidTill to now + AuthCodeDuration (5 minutes) when the code is created, and reject expired codes at /token with invalid_grant.
Testing
TestAuthorizationCodeExpiration, which checks that a fresh code is exchanged successfully, an expired code is rejected withcode expired, and the code is deleted after use either way.TestServeAuthorizeto check that new codes get aValidTillwithinAuthCodeDuration.