fix: service auth token handling and did:web resolution#167
Open
rabble wants to merge 1 commit intoblacksky-algorithms:mainfrom
Open
fix: service auth token handling and did:web resolution#167rabble wants to merge 1 commit intoblacksky-algorithms:mainfrom
rabble wants to merge 1 commit intoblacksky-algorithms:mainfrom
Conversation
…web document
Auth verifier improvements:
- Try repo signing key (PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX) as
fallback when JWT key verification fails, enabling service auth tokens
from external services like video.bsky.app
- Handle missing scope field in service auth tokens by defaulting to
Access scope (service tokens use lxm instead of scope)
- Fall back to JWT issuer (iss) when subject (sub) is absent, which is
how video.bsky.app callback tokens are structured
- Handle missing sub/aud gracefully instead of unwrap panics
- Accept PDS_ADMIN_PASSWORD as alias for PDS_ADMIN_PASS, with graceful
error when neither is set
did:web resolution:
- Serve /.well-known/did.json for did:web:{hostname} resolution
- Derive secp256k1 public key multibase from PDS repo signing key
- Include AtprotoPersonalDataServer service endpoint
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
|
relates to #171 |
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.
Summary
PDS_REPO_SIGNING_KEY_K256_PRIVATE_KEY_HEX). This enables accepting service auth tokens from external services likevideo.bsky.appthat sign tokens with the PDS's repo signing key rather than the JWT session key.lxminstead ofscopeandissinstead ofsub. The verifier now defaults toAccessscope when scope is empty and falls back toisswhensubis absent.unwrap()calls on sub/aud with proper error messages instead of panics. AcceptPDS_ADMIN_PASSWORDas alias forPDS_ADMIN_PASS./.well-known/did.jsonfordid:web:{hostname}resolution, deriving the secp256k1 public key multibase from the PDS repo signing key. This enables service-to-service auth where the PDS identity isdid:web:hostname.Test plan
GET /.well-known/did.jsonreturns valid DID document with correct public keyPDS_ADMIN_PASSWORDandPDS_ADMIN_PASScargo check -p rsky-pdsto verify compilation🤖 Generated with Claude Code