-
Notifications
You must be signed in to change notification settings - Fork 554
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
Service auth method binding (lxm) #2663
Merged
Merged
Conversation
This file contains 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
…for app passwords
devinivy
reviewed
Jul 26, 2024
devinivy
approved these changes
Aug 15, 2024
devinivy
approved these changes
Aug 18, 2024
Merged
estrattonbailey
added a commit
that referenced
this pull request
Aug 19, 2024
burningtree
added a commit
to burningtree/atproto-pds
that referenced
this pull request
Sep 13, 2024
This was referenced Sep 13, 2024
devinivy
pushed a commit
to bluesky-social/pds
that referenced
this pull request
Sep 13, 2024
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.
This iterates on our current service auth tokens by adding an additional claim (
lxm
or "lexicon method") to the JWT payload which "binds" a token to a given request. This is not intended as an endstate for authorization semantics, but rather an incremental improvement over the current situation that is forward-compatible with a couple possible plans for a more expressive authorization system.This also introduces a random 128 bit (hex-encoded) nonce onto each signed token. As these tokens are intended to be single use, this allows a service to optionally implement reuse prevention
An example service auth token may look like:
These tokens are backwards-compatible with existing services that do not do method checks. A service auth token with no
lxm
claim may still be used for simple authentication, but should not be used for any sensitive behavior or to perform actions on behalf of the user.Alongside this, we also update
com.atproto.server.getServiceAuth
to takelxm
as a parameter, as well as an optionalexp
time. This allows us to lower the access requirement forgetServiceAuth
such that app passwords are able to use the route. We perform an additional check withingetServiceAuth
to determine if the requester has the proper access level to receive a service auth token for the requested method. App passwords will not be able to request access to privileged methods such as DM-related methods.This also enables
uploadBlob
to be called using a service auth token on behalf of a user. Only this user-facing route accepts service auth tokens for now but this can serve as a pattern for future routes.Rollout plan: