Skip to content

oauth: add endpoints - #96

Merged
ion232 merged 6 commits into
mainfrom
feat/oauth-endpoints
Aug 22, 2026
Merged

oauth: add endpoints#96
ion232 merged 6 commits into
mainfrom
feat/oauth-endpoints

Conversation

@ion232

@ion232 ion232 commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Closes #25

ion232 and others added 6 commits August 22, 2026 15:50
The endpoint returns null for any token that isn't valid, so the map
values are nullable. Deserializing into a non-optional Token made
test_tokens fail on exactly the responses it exists to report on.

Also stop skipping expires on serialization; the spec types it as
integer|null, always present.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adds the token exchange as a normal form-encoded POST, and the
authorization endpoint as a URL builder rather than a request: it
renders a consent page for a browser and returns its result via the
redirect URI, so there is nothing for the client to call.

PKCE code_challenge is supplied by the caller to avoid taking on
cryptographic dependencies.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Generates the PKCE secrets and CSRF state, then carries them in a
PendingAuthorization so the token exchange cannot be reached without
verifying the returned state and supplying the verifier. Previously both
were left to the caller as doc comments.

Adds typed OAuth errors so a cancelled authorization is distinguishable
from a bad verifier; the generic handler flattened both into a string
and dropped error_description.

All of oauth is now behind a default-on feature, so clients using a
personal token can drop the crypto dependencies with
default-features = false.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ion232
ion232 merged commit 350c7e9 into main Aug 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Category: OAuth

1 participant