Perform node.IsTagged() check in /authorize#160
Merged
mikeodr merged 1 commit intotailscale:mainfrom Mar 26, 2026
Merged
Conversation
mikeodr
requested changes
Mar 26, 2026
Collaborator
mikeodr
left a comment
There was a problem hiding this comment.
Thanks for the PR, overall this matches the RFC as machines would use a separate workload flow.
Just a few issues to resolve about the interface use, otherwise looks great.
Thanks!
Collaborator
|
Looks good, can you squash this down to ensure all the commits have the DCO signoff? Thanks! |
Signed-off-by: Vanshaj Singhania <svanshaj2001@gmail.com>
22f1b76 to
9109638
Compare
Contributor
Author
|
squashed and added signoff! |
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.
Currently the
/authorizehandler happily issues an auth code for tagged nodes. Since tagged nodes represent no user identity, token exchange for these codes later (correctly) fails.This is fundamentally an authorization validation step. A tagged node is essentially not able to identify itself, so it is poor OAuth practice to issue an auth code for it. The service already looks up node information while handling
/authorize, so it should detect tagged nodes up front and prevent them from being used.This PR adds a check to
/authorizeto redirect witherror=access_deniedif a tagged node is detected. This way, the OAuth client need not go through token exchange when the node is not authorized.This PR also makes a few improvements to the testing flow. Specifically, it:
.WhoIsresponses from the local client, by representing the client as an interface rather than the*local.Clienttypetoken_test.goto check tagged nodes during the/tokenendpointauthorize_test.goto check tagged nodes, stop on.WhoIserrors, and check the happy pathHappy to discuss further or iterate over this PR if desired! Beyond the test updates here, I also ran this locally and performed a basic check that it works as expected (untagged nodes are unaffected, tagged nodes return the right redirect on
/authorize).