authz-bridge: first end-to-end (hand-written scaffold + factory entry) #9
Labels
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lab/automation#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
The complete end-to-end repo-declared CI chain for
lab/authz-bridge, hand-written as the reference shape the onboarding generators (#10) will copy:.ci/directory with a kustomization (common labelci/repo: lab-authz-bridge— K8s label values cannot contain/) and a repo-prefixed tag-build sensor that filters the shared webhook events by repo name and submitsgo-build-pushwith params from the event. Nok8s/starter — authz-bridge is a system service deployed by Flux fromdeployments/kustomization/(lab/clusters); the app-manifest-location mechanism (per-repo ApplicationSet + repo-declared.ci/apps.yaml) is scoped to #10.lab/dev-apps-source(two paths — AppProjects must live in the control-plane namespace, see the note on #8):repos/lab-authz-bridge/: a CI Application: source = the authz-bridge repo, path.ci/, destination = mini /cinamespace, destination service account, automated sync (prune + selfHeal),allowEmpty: false; no app Application — authz-bridge has no workloads.projects/lab-authz-bridge.yaml: an AppProject scoped to that repo (sourceRepos = the authz-bridge repo,sourceNamespaces: [dev-apps-source], destinations = mini /ci, destinationServiceAccounts =ci-argocdfor mini/ci) with a project role granting the repo ownerget/sync/updateon the project'sapplications(app-scoped object form). Correction: Argo CD v3.5.2 has noappRBACfield (verified against the live CRD, the v3.5.x/v3.6 sources, and GitHub) — project roles (spec.roleswithproj:<project>:<role>policies) are the per-app RBAC mechanism;editis not a valid action,updateis the edit-equivalent.projects/path into theargocdnamespace (Argo CD v3.5.2 only watches AppProjects in the control-plane namespace). The existingdev-apps-sourceKustomization continues to syncrepos/intodev-apps-source.lab/authz-bridgefrom the central tag-build sensor's allowlist so only the repo's sensor fires on its tag pushes — sensor consumer groups are independent per sensor, so without this both sensors would build. #11 retires the central sensor entirely.Acceptance criteria
cinamespacego-build-pushworkflow runsBlocked by
Implementation note (verified against argo-cd v3.5.2 source — the version running on portable):
application.namespacesextends only the Application informer. The AppProject informer stays scoped to the control-plane namespace:controller/appcontroller.go:233—NewAppProjectInformer(applicationClientset, namespace, ...)(the controller's own namespace)GetAppProjectByName(..., ctrl.namespace, ...)→projLister.AppProjects(ns).Get(name)Implication for the factory design (#9): per-repo AppProject objects committed to the factory repo's
repos/path would be synced into thedev-apps-sourcenamespace (the Kustomization'stargetNamespace), where Argo CD does not see them. #9 needs either:argocdnamespace — e.g. a second factory path (e.g.projects/) with a second Kustomization targetingargocd; orlab-apps) with per-repoappRBACrules.No impact on #8's acceptance criteria (the smoke Application references
lab-appsinargocd).PRs: lab/clusters#1625 (wiring +
application.namespaces: *), lab/dev-apps-source#7 (fossil removal + smoke manifests).Scaffold PR opened: lab/authz-bridge#62 (branch ci/repo-declared-scaffold)
Scope decisions from discussion, recorded here:
Scaffold validated: kustomize build clean + server-side dry-run against the live argo-events v1.9.10 Sensor CRD on mini. Cross-namespace event flow (webhook EventSource in automation → sensor in ci) verified against the v1.9.10 source: JetStream subject is default.. with no namespace, shared NATS server, and the sensor reconciler never fetches the EventSource object.
Remaining: factory PR (dev-apps-source) + wiring PR (lab/clusters projects/ → argocd) + central-allowlist removal (automation), then the e2e tag-push test.
All four PRs for #9 are open/merged:
Spec correction recorded in the issue body: Argo CD v3.5.2 has no appRBAC field (verified against the live CRD, v3.5.x/v3.6 sources, and GitHub) — the AppProject uses a project role (repo-owner) with app-scoped policies granting get/sync/update (edit is not a valid action) on lab-authz-bridge/*, bound to the admin group (the repo owner's claim). Global RBAC is deny-by-default, so the negative test (user without the binding cannot see the app) holds.
Remaining after the three open PRs merge: