Commit graph

26 commits

Author SHA1 Message Date
Jeremiah Lowin
63f3940c6f Support 'scp' claim for OAuth scopes in BearerAuthProvider
Some Identity Providers use 'scp' claim instead of the standard 'scope' claim for OAuth scopes. This change updates the scope extraction logic to support both claims, with 'scope' taking precedence when both are present.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-03 20:18:54 -04:00
Jeremiah Lowin
d8dc28b9b2 Add structured content & update almost all tests 2025-06-27 15:40:52 -04:00
Jeremiah Lowin
b98b080c98 Implement TokenVerifier protocol for mcp-python-sdk compatibility
Fixes breaking changes from mcp-python-sdk PR #982 which updated
BearerAuthBackend to use TokenVerifier protocol instead of OAuth providers.

Changes:
- Add verify_token() method to BearerAuthProvider implementing TokenVerifier protocol
- Add verify_token() method to InMemoryOAuthProvider implementing TokenVerifier protocol
- Update BearerAuthBackend usage in setup_auth_middleware_and_routes() to pass TokenVerifier
- Add comprehensive unit tests for TokenVerifier implementations
- Add integration tests for BearerAuthBackend with TokenVerifier
- Add tests for HTTP auth setup functions

All existing functionality preserved with full backwards compatibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-26 15:08:31 -04:00
Jeremiah Lowin
76e3df1bc1 Add "http" as an alias for streamable-http 2025-06-22 18:55:07 -04:00
Jeremiah Lowin
18ae625fef Update docs and test 2025-06-20 13:06:48 -04:00
Jeremiah Lowin
a2f406faa4 Apply pre-commit formatting fixes 2025-06-20 12:17:47 -04:00
Jeremiah Lowin
42460480de Fix BearerAuthProvider audience type annotations to support List[str]
The audience parameter was typed as `str | None` but the implementation
already supported `List[str]`. This fix aligns the type annotations with
the actual functionality and adds comprehensive validation logic for all
audience type combinations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 12:13:00 -04:00
Jeremiah Lowin
40ce687d0d Fix JWT issuer validation to support string values per RFC 7519
Resolves issue where BearerAuthProvider rejected tokens with non-URL
issuer claims. Works around the underlying SDK's URL validation while
maintaining RFC 7519 compliance for JWT processing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-20 11:47:34 -04:00
Jeremiah Lowin
ef853b4f18 Use update env var pattern 2025-06-10 12:03:59 -04:00
Jeremiah Lowin
aaa09ca7a3 Remove open-ended and server-specific settings 2025-06-07 20:20:04 -04:00
Jeremiah Lowin
18615bc48b Remove empty parens 2025-06-04 15:41:28 -04:00
Jeremiah Lowin
d1549c3d35 Remove empty parens 2025-06-04 15:37:55 -04:00
Jeremiah Lowin
60902b5de9 Fix patch address 2025-06-01 21:37:27 -04:00
Jeremiah Lowin
132db32e51 Add auth docs 2025-06-01 21:33:33 -04:00
Jeremiah Lowin
5ac996d134 Reorganize auth and use secretstr 2025-06-01 20:44:56 -04:00
Jeremiah Lowin
0d8bb8cdd6 flatten auth settings 2025-06-01 16:45:31 -04:00
Jeremiah Lowin
db18baa24f Support configuring bearer auth from env vars 2025-06-01 16:24:45 -04:00
Jeremiah Lowin
c6d168ac20 update typing 2025-06-01 12:49:33 -04:00
Jeremiah Lowin
172f67c617 Add jwks tests 2025-06-01 12:44:56 -04:00
Jeremiah Lowin
da9c51e132 Add tests; update default issuer 2025-06-01 12:09:30 -04:00
Jeremiah Lowin
ed94a2ae89 Update test_bearer.py 2025-06-01 11:57:44 -04:00
Jeremiah Lowin
20ae68bb7d Add basic bearer auth for server and client 2025-06-01 11:13:21 -04:00
Jeremiah Lowin
8fb709c98c Simplify code for running servers in processes 2025-06-01 09:35:06 -04:00
Jeremiah Lowin
3d454380b1 Fix import and remaining available port 2025-05-31 19:36:04 -04:00
Jeremiah Lowin
ad8182eed0 Create http utility 2025-05-31 19:33:50 -04:00
Jeremiah Lowin
2390fb4da6 clean up test inits 2025-05-31 19:32:08 -04:00