Move publisher manifests into a dedicated policies directory and mount them through a separate Kustomize-generated ConfigMap. Apply all mounted YAML files in filename order instead of hard-coding the WinGet manifest and seven objects. Require a nonempty successful response for each manifest and fail the PostSync hook on partial or malformed results. Keep SSO secret substitution separate. Document registration, ordering and explicit revocation. New publishers require only a policy file and a ConfigMap files entry, without Python or Job changes. Validation: four Python unit tests passed, including arbitrary object counts, manifest discovery and error handling. Rendered ConfigMaps and the PostSync Job with kubectl kustomize; full Helm chart rendering and live application were not performed.
1.7 KiB
OpenArtifact access policies
The Helm chart runs OpenArtifact. Kustomize packages the SSO configuration and
publisher policies into ConfigMaps. ArgoCD's PostSync Job applies them through
OpenArtifact's /api/v1/admin/declarative/apply API after each sync.
To register another publisher, add a regular *.yaml file directly inside
policies/ and add its path to the openartifact-policies ConfigMap generator's
files list in kustomization.yaml. No Python or Job changes are required.
Kustomize includes the listed files in openartifact-policies; the Job
mounts them at /policies and applies YAML files in filename order. Group a
publisher's ServiceAccount, PermissionTargets and OIDCTrustPolicy in one manifest,
with the account first. Use globally unique object names; use filename prefixes
if manifests depend on one another.
Every manifest must return a nonempty list of successfully applied objects. Any failure stops the Job, so ArgoCD reports the sync hook failure. There is no fixed object count. Existing objects are reapplied on later syncs. Removing a file or object from Git does not delete it from OpenArtifact: revoke obsolete access explicitly on the server as well.
Scope permissions to the intended repository, package names and architectures.
Bind OIDC trust to the producer repository, tag/branch, workflow, event and
environment where applicable. Put real credentials in Kubernetes Secrets, never
in policy files. SSO client-secret substitution remains isolated to sso.yaml.
Run the local checks with:
python -m unittest discover -s k8s-ng/apps/openartifact/tests
kubectl kustomize --enable-helm k8s-ng/apps/openartifact
Rendering the complete application requires Helm and access to the chart registry.