Skip to content

Authenticate Maven against Artifact Registry with OIDC instead of a service account key - #508

Merged
Chuks-Ajeh merged 3 commits into
masterfrom
chore/oidc-federated-auth
Sep 17, 2026
Merged

Chuks-Ajeh merged 3 commits into
masterfrom
chore/oidc-federated-auth

Conversation

@Chuks-Ajeh

@Chuks-Ajeh Chuks-Ajeh commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Codefresh federates into GCP with workload identity federation and exports a one-hour GCP_ACCESS_TOKEN, replacing the long-lived ARTIFACT_REGISTRY_SA_KEY. Same format as the reviewed and accepted reference implementation for this migration.

  • the step is pinned to regnosysops/gcp-oidc-auth:1.0.1
  • distributionManagement moves to https://, which is what carries the token
  • in repositories, only isda-maven and public-maven move to https:// — they are public = true, so CI reads them anonymously. Private registries stay on artifactregistry://, and the artifactregistry-maven-wagon extension stays, because that protocol is what developers and GitHub Actions use through their own gcloud credentials
  • settings.xml authenticates as oauth2accesstoken with ${env.GCP_ACCESS_TOKEN}

Supersedes #507, which was rebuilt from the current base to drop unrelated drift.

…ervice account key

Codefresh federates into GCP with workload identity federation and exports a
one-hour GCP_ACCESS_TOKEN, replacing the long-lived ARTIFACT_REGISTRY_SA_KEY.

settings.xml authenticates as oauth2accesstoken with that token, for the
maven-central mirror and for each repository this build deploys to or reads
privately. distributionManagement moves to https, which is what carries the
token.

The repositories section keeps artifactregistry:// for private registries and
the artifactregistry-maven-wagon extension stays: that protocol is what
developers and GitHub Actions use, resolving through their own gcloud
credentials. Only isda-maven and public-maven move to https there, being public.
ja6a-regnosys
ja6a-regnosys previously approved these changes Sep 17, 2026
The extension is not invoked by CI, which reaches Artifact Registry over https
with the federated token. It serves developers and GitHub Actions resolving
artifactregistry:// through their own gcloud credentials, so the version matters
to them rather than to the build.
@Chuks-Ajeh
Chuks-Ajeh merged commit 1c7493b into master Sep 17, 2026
2 checks passed
@Chuks-Ajeh
Chuks-Ajeh deleted the chore/oidc-federated-auth branch September 17, 2026 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants