Repository navigation
Part 2: Add claim-scoped admin management for sources and registries - #650
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #650 +/- ##
==========================================
+ Coverage 59.08% 60.47% +1.38%
==========================================
Files 100 100
Lines 9496 9556 +60
==========================================
+ Hits 5611 5779 +168
+ Misses 3406 3278 -128
- Partials 479 499 +20 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rdimitrov
force-pushed
the
registry-access-gate
branch
from
April 1, 2026 05:31
7e5bb77 to
f3a813b
Compare
rdimitrov
force-pushed
the
claim-scoped-admin
branch
from
April 1, 2026 05:31
c0f8c89 to
ca609ac
Compare
rdimitrov
force-pushed
the
registry-access-gate
branch
from
April 1, 2026 12:22
f3a813b to
0a0084d
Compare
rdimitrov
force-pushed
the
claim-scoped-admin
branch
from
April 1, 2026 12:22
ca609ac to
772c752
Compare
blkt
force-pushed
the
registry-access-gate
branch
from
April 2, 2026 09:06
0a0084d to
7859ecd
Compare
Enforce JWT claim-based authorization on all admin CRUD operations: Source operations: - CreateSource/UpdateSource validate request claims are a subset of the caller's JWT claims - UpdateSource/DeleteSource validate the caller's JWT covers the existing source's claims before allowing modification - ListSources filters results to only sources within the caller's claim boundary - GetSourceByName returns 404 (hides existence) when the caller's claims don't cover the source Registry operations: - CreateRegistry/UpdateRegistry validate registry claims are a subset of the caller's JWT and that all referenced sources' claims are covered by the caller - UpdateRegistry/DeleteRegistry validate the caller's JWT covers the existing registry's claims - ListRegistries filters results by caller claims - GetRegistryByName returns 404 when claims don't match Bug fixes: - RegistryInfo now includes Claims field in API responses - CreateRegistry/UpdateRegistry now persist claims to the database (previously silently dropped) Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Both entry listing endpoints were missing claim validation — a user with the manageSources/manageRegistries role could enumerate entries for any source/registry regardless of claims. Now both validate the caller's JWT covers the resource's claims before returning data. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Verify that all four skills consumer endpoints (ListSkills, GetLatestVersion, ListVersions, GetVersion) correctly return 403 when the service returns ErrClaimsInsufficient. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
blkt
approved these changes
Apr 2, 2026
blkt
enabled auto-merge (squash)
April 2, 2026 12:39
blkt
disabled auto-merge
April 2, 2026 12:39
blkt
enabled auto-merge (squash)
April 2, 2026 12:39
ChrisJBurns
approved these changes
Apr 2, 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
Enforces JWT claim-based authorization on all admin CRUD operations for sources and registries, completing the v2 authorization model for admin APIs.
CreateSource/UpdateSourcevalidate request claims ⊆ caller JWT.UpdateSource/DeleteSourcevalidate caller JWT covers the existing source's claims.ListSourcesfilters to sources within the caller's claim boundary.GetSourceByNamereturns 404 (hides existence) when claims don't match.CreateRegistry/UpdateRegistryvalidate registry claims ⊆ caller JWT AND all referenced sources' claims ⊆ caller JWT.UpdateRegistry/DeleteRegistryvalidate caller JWT covers existing claims.ListRegistriesfilters by caller claims.GetRegistryByNamereturns 404 when claims don't match.Bug fixes included
RegistryInfonow includesClaimsfield — previously missing from the API response structCreateRegistry/UpdateRegistrynow persist claims — theUpsertRegistryParams.Claimsfield was never populated, silently dropping registry claims on API-created registriesDesign decisions
claimsFromCtx(ctx)which readsauth.ClaimsFromContext(ctx). No service interface signature changes needed — claims already flow through context from the auth middleware.GetSourceByNameandGetRegistryByNamereturnErrSourceNotFound/ErrRegistryNotFound(notErrClaimsInsufficient) when the caller can't see the resource. This prevents information disclosure.resolveSourceIDsWithGatevalidates the caller's claims cover each referenced source's claims, preventing users from wiring in sources outside their claim boundary.resolveSourceIDsandreplaceRegistrySourcesremoved — fully replaced by gated variants.Depends on
PR #649 (registry access gate) — this PR is based on
registry-access-gatebranch.Test plan
admin_claims_test.go— create, update, delete, list filtering, get hidden, super-admin bypass)task lint-fix— 0 issuestask test— all tests pass🤖 Generated with Claude Code