Skip to content

Implementing the ATOAuthKit client #2

Description

@systemblueio

MasterJ93/ATProtoKit#43 closes when this package ships its client, tests, and README. I'd be up for taking that on if you're open to it, following @atproto/oauth-client@0.7.x the way OAuthTypes follows @atproto/oauth-types.

Proposed sequence, one PR per phase:

  1. Complete OAuthTypes: port the missing atproto modules (atproto-oauth-scope, atproto-loopback-client-id, atproto-loopback-client-redirect-uris, atproto-oauth-token-response, oauth-introspection-response), add Sendable conformance for strict-concurrency consumers, restore the client_id requirement on AuthorizationRequestQuery (the TS schema is an intersection), and harden the canonical-form check against percent-encoded dot segments, with conversion docs and tests.
  2. Client foundation: the store and cache layer (SimpleStore, a single-flight CachedGetter actor), the runtime seam (key generation, SHA-256, secure random, named locks), Key/Keyset over Jot and JWTKit, DPoP proof minting, PKCE, RFC 7638 thumbprints.
  3. Resolvers: DID, handle, and identity resolution with bidirectional verification, plus the authorization-server and protected-resource metadata resolvers.
  4. Client core: OAuthServerAgent, SessionGetter (refresh with single-use refresh-token race handling), OAuthSession (DPoP-bound fetch with nonce retry), OAuthClient, and client-metadata validation.
  5. Docs: README, DocC, and a SessionConfiguration bridge example for ATProtoKit.

The port would target current spec behavior where it has drifted since the TS snapshot: htu stripped of query and fragment, no iss claim in resource-server DPoP proofs, form-encoded PAR with dpop_jkt, an exp claim in client assertions, and the June 2025 session-lifetime changes. Granular scopes stay out until they stabilize; transition scopes only.

Does this direction work, or would you shape the phases differently? Related: #1 fixes the existing OAuthTypes validators ahead of any of this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions