Skip to content

Conversation

@fizy069
Copy link

@fizy069 fizy069 commented Dec 19, 2025

Implement SEP-835 Enhanced Authorization Flows

Motivation and Context

This PR implements SEP-835 Enhanced Authorization Flows support in the Rust SDK, tracking issue #515.

Features added :

  • Scope parameter extraction from WWW-Authenticate headers
  • 403 insufficient_scope error handling with scope information
  • Runtime scope upgrade flow for progressive authorization
  • Priority-based scope selection strategy

How Has This Been Tested?

  • 24 auth module unit tests (11 new tests for scope functionality)
  • Tests cover scope union computation, retry limits, config defaults, and header parsing
  • Existing tests pass

Breaking Changes

None. Couple of warnings due to an older function being deprecated.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Implements scope parameter parsing from WWW-Authenticate headers and
403 insufficient_scope error handling per SEP-835.
@github-actions github-actions bot added T-core Core library changes T-transport Transport layer changes labels Dec 19, 2025
@fizy069 fizy069 marked this pull request as draft December 19, 2025 19:31
@fizy069 fizy069 marked this pull request as ready for review December 19, 2025 19:55
- Add ScopeUpgradeConfig for configurable retry limits
- Track granted scopes in StoredCredentials and AuthorizationManager
- Implement scope union computation for progressive authorization
- Add request_scope_upgrade() for 403 insufficient_scope handling
- Add select_scopes() with WWW-Authenticate priority per SEP-835
- Export new types: ScopeUpgradeConfig, WWWAuthenticateParams, AuthClient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-core Core library changes T-transport Transport layer changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant