Loading
feat(maven): resolution holder and shared resolver part 1/2 (S09 Enforcement plan: 9/20)
Split into 2 stacked MRs to keep each within the review size limit (~800 LoC ideal). Each part targets the previous one (part 1 targets main); review and merge bottom-up.
Part 1 of 2 of S09 authorization enforcement — Step 9: Maven wiring.
What this part adds
The format-package foundation plus the composition-root refactor the wiring in part 2 builds on — no authorization behavior changes yet; mountSlugAnchoredFormats still consults no gate:
internal/format/maven/context.go: the package's resolution holder, in the shapeinternal/namespace/context.gouses — an installed mutable cell, a setter panicking on a missing holder and on a zeroMavenRepositoryIDor a zeroRepositoryID(a zeromaven.Resolutionreads as hosted-and-unsuspended, so it would fail open on both write gates;RepositoryIDis guarded separately because it is the id an authorization check names the resource by), and a reader returning the resolution with the slug and repository name it was resolved for.internal/format/maven/resolver.go:ResolveRepositoryreplays a context-seeded resolution when its slug and repository name both match, and resolves in two tiers otherwise. Covered for the seeded hit (zero finder calls), slug mismatch, repository-name mismatch, and installed-but-unfilled holder, withNamespaceSuspendedand a non-hosted kind pinned through the replay.cmd/artifact-registry/wire_maven.go:buildMavenResolverandmavenDBProviderextracted sobuildMavenDispatchertakes an injected resolver (nil-resolver panic guard added); part 2's authorization adapter shares that instance.cmd/artifact-registry/wire_maven_route_pattern_test.go: pins that themavenroutegrammar andmaven.RoutePatterndescribe the same mount, structurally and behaviorally.
Spec: S09 (authorization).
Stacked MRs (review/merge bottom-up)
- feat(maven): resolution holder and shared resol... (!2064 - merged) • David Fernandez • 19.4
👈 - feat(maven): wire authz enforcement part 2/2 (S... (!2065 - merged) • David Fernandez • 19.4
Related to #652 (closed)
Edited by David Fernandez