feat(userauth): recognize the gitlab-autoflow audience

AutoFlow is the workflow engine in GitLab Relay. Rails calls AutoFlow's API for the admin, so the Artifact Registry settings UI can show AutoFlow run records. Rails sends a gitlab-autoflow token it mints in-process, and Relay verifies it with pkg/userauth, configured with ExpectedAudiences: ["gitlab-autoflow"].

Without this change, Config.Validate rejects that configuration and Verify rejects the token because every audience on it must be in the allowed list.

Rails adds gitlab-iam-data-access to an in-process token only if the caller asks for it. Relay does not call iam-data-access, so its token does not need that audience. The public token-exchange endpoint does not offer gitlab-autoflow.

This adds gitlab-autoflow to allowedAudiences in pkg/userauth/config.go, plus validation and verifier test cases.

Behavior change: IAM's data-access service now also accepts a gitlab-autoflow token that also carries gitlab-iam-data-access. It rejected those before. A token with only gitlab-autoflow is still rejected. At runtime, data-access TOML configs can now expect any audience in the Go allowlist, but committed configs are kept to gitlab-artifact-registry and gitlab-iam-data-access by proto validation in tests.

Audiences are added one service at a time as each service integrates, and Trigger will need gitlab-trigger later. This stays the approach until GATE STS replaces token exchange. No per-service allow list is needed, because expected_audiences already lets each service choose what it accepts.

Relates to gitlab-org/cluster-integration/gitlab-agent#1200 (closed)

Edited by Romuald Atchadé

Merge request reports

Loading
Loading