feat(server): add target and target_controls management APIs (2/7)#180
Draft
abhinav-galileo wants to merge 1 commit intoabhi/rfc-1-1-pr1-tenant-targetsfrom
Draft
feat(server): add target and target_controls management APIs (2/7)#180abhinav-galileo wants to merge 1 commit intoabhi/rfc-1-1-pr1-tenant-targetsfrom
abhinav-galileo wants to merge 1 commit intoabhi/rfc-1-1-pr1-tenant-targetsfrom
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
3 tasks
a79bcbb to
6ea16b3
Compare
23b990f to
46ed17b
Compare
46ed17b to
fe437c4
Compare
CRUD endpoints for targets plus attach/detach/toggle/list endpoints for target_controls. Tenant is resolved via optional X-Tenant-Id header with fall-through to default-tenant. New target tables are not yet wired into runtime control resolution (separate change).
fe437c4 to
7067673
Compare
4 tasks
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.
Stacked on top of #178. Kept in draft until the full stack has been validated end-to-end.
Summary
target_type), delete.target_controls.get_tenant_id) that reads an optionalX-Tenant-Idheader and falls back todefault-tenantwhen absent. Callers that omit the header continue to work unchanged./api/v1/targets.Scope boundaries
Design notes
INSERT ... ON CONFLICT DO NOTHINGkeyed on(target_id, control_id); retrying with a differentenabledvalue updates the row.TARGET_CONTROL_NOT_FOUNDso callers can detect "already gone" explicitly.New error codes
TARGET_NOT_FOUNDTARGET_CONTROL_NOT_FOUNDTARGET_CONFLICTTest plan
make checkclean locally (full lint + mypy + tests; 544 server tests including 21 new endpoint tests)