Authenticate Maven against Artifact Registry with OIDC instead of a Service account key - #743
Merged
hugohills-regnosys merged 5 commits intoSep 21, 2026
Conversation
…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.
…oxy denies auth" This reverts commit b572ba5.
ja6a-regnosys
approved these changes
Sep 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.