Skip to content

Add server-side Bearer challenges and credentials - #1

Closed
fishloa wants to merge 1 commit into
mainfrom
bearer
Closed

fishloa wants to merge 1 commit into
mainfrom
bearer

Conversation

@fishloa

@fishloa fishloa commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Adds bearer behind the server feature; no new dependencies. Design: design/20261023-bearer.md.

  • bearer::ChallengeBuilder: Bearer challenge with optional realm, scope, error, error_description, error_uri (RFC 6750 §3) and resource_metadata (RFC 9728 §5.1). Values outside the RFC character sets return ConfigError.
  • bearer::ErrorCode: invalid_request / invalid_token / insufficient_scope, status() 400 / 401 / 403.
  • bearer::Credentials::parse: token68 from Authorization: Bearer (RFC 6750 §2.1), via CredentialsSource.
  • mod server now builds with server alone.

Tests: tests/bearer.rs — RFC 6750 and RFC 9728 examples, every parameter parsed back with parse_challenges, one negative test per validation rule.

Adds a bearer module behind the server feature: a challenge builder
for RFC 6750 section 3 (plus RFC 9728's resource_metadata), the three
RFC 6750 error codes, and token parsing from Authorization: Bearer.
@fishloa

fishloa commented Oct 23, 2026

Copy link
Copy Markdown
Owner Author

Moved upstream: scottlamb#8

@fishloa fishloa closed this Oct 23, 2026
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.

1 participant