Skip to content

Authenticate Maven against Artifact Registry with OIDC instead of a Service account key - #743

Merged
hugohills-regnosys merged 5 commits into
finos:mainfrom
REGnosys:chore/gcp-oidc-maven-auth
Sep 21, 2026
Merged

hugohills-regnosys merged 5 commits into
finos:mainfrom
REGnosys:chore/gcp-oidc-maven-auth

Conversation

@hugohills-regnosys

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 that settings.xml used as its Basic auth password. The mirror now authenticates as oauth2accesstoken with that token instead of as _json_key_base64 with the key.

Same shape as rosetta-models/rune-fpml#119: this build also publishes to OSSRH rather than to Artifact Registry, so there are no artifactregistry:// URLs or wagon extension to touch.

Needs REGnosys/terraform#298 (binds this pipeline to codefresh-pipeline-sa) merged first, or the new Authenticate step has nothing to impersonate.

Please include a summary of the change and the issue/story number.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

hugohills-regnosys and others added 4 commits September 18, 2026 17:02
…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
that settings.xml used as its Basic auth password. The mirror now
authenticates as oauth2accesstoken with that token instead of as
_json_key_base64 with the key.

Same shape as rosetta-models/rune-fpml#119: this build also publishes to
OSSRH rather than to Artifact Registry, so there are no artifactregistry://
URLs or wagon extension to touch.

Needs REGnosys/terraform#298 (binds this pipeline to codefresh-pipeline-sa)
merged first, or the new Authenticate step has nothing to impersonate.
…es auth

A PR built from a fork other than REGnosys's carries no WIF binding, so
Authenticate mints no GCP_ACCESS_TOKEN and the proxy in settings.xml returns
401 with, until now, nothing else to try - failing the whole build for
external contributions.

Replaces the <mirror> for central (which fully hides Maven's built-in central
repository, leaving no fallback) with a plain <repository>/<pluginRepository>
declaration instead. Verified empirically: a mirror gives a hard 401 with no
other repository attempted, while a plain repository declaration leaves
Maven's built-in central in the resolution list and falls through to it per
artifact on failure - confirmed against this exact file with GCP_ACCESS_TOKEN
unset (simulating the fork-PR case). Declaring it in an activeByDefault
profile rather than top-level keeps it the first (fast, rate-limit-avoiding)
attempt for a normal, authenticated build - also confirmed it stays active
under -P release, which is what the Build step passes.
@hugohills-regnosys
hugohills-regnosys merged commit 217a741 into finos:main Sep 21, 2026
4 checks passed
@hugohills-regnosys
hugohills-regnosys deleted the chore/gcp-oidc-maven-auth branch September 21, 2026 20:01
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