fix: model principal context without api keys#296
Closed
rpatel-scale wants to merge 3 commits into
Closed
Conversation
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
AgentexAuthPrincipalContextas a typed base model that omits API-key fields from the object itself.api_key/apiKeyare absent as object attributes and are not retained in model extras.Validation
uv run --project agentex ruff check agentex/src/api/schemas/principal_context.py agentex/src/adapters/authentication/adapter_agentex_authn_proxy.py agentex/src/adapters/authorization/adapter_agentex_authz_proxy.py agentex/src/api/middleware_utils.py agentex/src/api/authentication_middleware.py agentex/src/api/authentication_cache.py agentex/src/domain/services/schedule_service.py agentex/src/domain/use_cases/agent_api_keys_use_case.py agentex/src/domain/use_cases/agents_use_case.py agentex/tests/unit/api/test_principal_context.py agentex/tests/unit/api/test_authentication_cache_metrics.pyuv run --project agentex --group test pytest agentex/tests/unit/api/test_principal_context.py agentex/tests/unit/api/test_authentication_cache_metrics.pyuv run --project agentex python - <<'PY' ...runtime check confirmedhasattr(principal, "api_key") == Falseandmodel_extra == {}git diff --checkNotes
agentex/tests/integration/api/agents/test_agents_auth_api.pywas attempted but did not reach the changed code because local Docker/testcontainers setup could not connect to the Docker socket.