refactor(keycardai-starlette)!: remove deprecated BearerAuthMiddleware shims (ACC-237)#109
Merged
Merged
Conversation
…e shims (ACC-237) PR #97 kept BearerAuthMiddleware, verify_bearer_token, and _create_auth_challenge_response in keycardai.starlette.middleware.bearer as deprecated shims for keycardai-mcp and keycardai-agents to migrate off. keycardai-mcp moved to AuthenticationMiddleware + KeycardAuthBackend in ACC-235; keycardai-agents archived in ACC-232. Both consumers are off the shim, so it is removed. Removes: - BearerAuthMiddleware - verify_bearer_token - _create_auth_challenge_response - packages/starlette/tests/keycardai/starlette/test_deprecation_warnings.py - BearerAuthMiddleware and verify_bearer_token from middleware/__init__.py __all__ - Now-unused imports: warnings, Callable, BaseHTTPMiddleware, ASGIApp BREAKING: any "from keycardai.starlette import BearerAuthMiddleware" or "verify_bearer_token" import fails. The runtime DeprecationWarning has been shipping since 0.3.0. Closes ACC-237.
📦 Release PreviewThis analysis shows the expected release impact: 📈 Expected Version Changes📋 Package Details[
{
"package_name": "keycardai-starlette",
"package_dir": "packages/starlette",
"has_changes": true,
"current_version": "0.3.0",
"next_version": "0.4.0",
"increment": "MINOR"
}
]📝 Changelog PreviewThis comment was automatically generated by the release preview workflow. |
jerriclynsjohn
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the deprecated bearer surface that PR #97 retained for
keycardai-mcpandkeycardai-agentsto migrate off. Both consumers are off:keycardai-mcpmigrated in ACC-235 (Done)keycardai-agentsarchived in ACC-232 (chore(keycardai-agents)!: archive package (ACC-232) #108)The runtime
DeprecationWarninghas been shipping sincekeycardai-starlette0.3.0, so downstream users have had advance notice.Removed
BearerAuthMiddlewareverify_bearer_token_create_auth_challenge_responsepackages/starlette/tests/keycardai/starlette/test_deprecation_warnings.pyBearerAuthMiddlewareandverify_bearer_tokenfrommiddleware/__init__.py__all__warnings,Callable,BaseHTTPMiddleware,ASGIAppBreaking change
Any
from keycardai.starlette import BearerAuthMiddlewareorverify_bearer_tokenimport fails after this lands. Downstream code already had migration guidance from the runtimeDeprecationWarning. Workspace-widegrepconfirms zero remaining call sites.Test plan
cd packages/starlette && uv run --extra test pytest -q→ 9 passed (was 12; the 3 deprecation tests are deleted with the file)a2a,oauth,mcp,mcp-fastmcp,fastmcptest suites all greenuv run ruff checkcleangrep -rn "BearerAuthMiddleware\|verify_bearer_token\|_create_auth_challenge_response" --include="*.py" packages/→ zero hitsNote for merge
Edit the squash-merge body down to one line so the CHANGELOG doesn't balloon.
Coordination with #108
#108(ACC-232: archive keycardai-agents) is independent — touchespackages/agents/only. Either can merge first.Closes ACC-237.