feat: resource identifiers at gateway boundary#41
Merged
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
Implements gateway-owned resource identifier composition to align the
basis-gatewayimplementation with the recently ratified architecture decision frombasis-architecture.Prior to this change, the gateway already supported action composition:
However, adapter-normalized requests still carried local resource identifiers while
basis-corerequires canonical typed resource identifiers:This PR introduces a dedicated resource composition layer that mirrors existing action composition behavior.
New Behavior
The gateway now supports two valid request styles:
Adapter-normalized requests
{ "action": "read", "resource_type": "ahu", "resource_id": "rooftop-1" }Gateway composes:
before invoking
basis-core.Direct kernel-compatible requests
{ "action": "read:ahu", "resource_id": "ahu:rooftop-1" }continue to pass through unchanged.
Validation Improvements
The gateway now rejects ambiguous resource identity inputs, including:
resource_typeresource_typeAdditional Changes
This change implements the architecture principle:
for resource identifiers in the same way the gateway already owns action composition.
Checklist
Step 1 — Identify affected surfaces
Check every surface this PR touches:
src/basis_gateway/auth/)src/basis_gateway/auth/subject_mapper.py)src/basis_gateway/audit/)src/basis_gateway/readiness.py)src/basis_gateway/api/schemas.py)src/basis_gateway/config.py)src/basis_gateway/middleware/)README.md,docs/)Step 2 — Classify the change
If the change affects authentication or audit behavior
SECURITY.mdanddocs/release-readiness.mdstill holdIf the change modifies
basis-coreintegrationbasis-core/docs/public-api.md)basis_coreinternalsTests
Added:
Updated:
Quality gates:
pytestpasses locally (359 passed)ruff checkpassesruff format --checkpassesmypy srcpasses