Skip to content

Support Workload Identity Federation flow#1109

Open
JorTurFer wants to merge 29 commits intostackitcloud:mainfrom
JorTurFer:prepare-wif
Open

Support Workload Identity Federation flow#1109
JorTurFer wants to merge 29 commits intostackitcloud:mainfrom
JorTurFer:prepare-wif

Conversation

@JorTurFer
Copy link
Contributor

@JorTurFer JorTurFer commented Jan 7, 2026

Description

Aligned with the incoming workload identity federation feature, this PR support workload identity federation flow

This PR from the SDK is needed -> stackitcloud/stackit-sdk-go#4074

Checklist

  • Issue was linked above
  • Code format was applied: make fmt
  • Examples were added / adjusted (see examples/ directory)
  • Docs are up-to-date: make generate-docs (will be checked by CI)
  • Unit tests got implemented or updated
  • Acceptance tests got implemented or updated (see e.g. here)
  • Unit tests are passing: make test (will be checked by CI)
  • No linter issues: make lint (will be checked by CI)

Comment on lines +530 to +557
if sdkConfig.ServiceAccountFederatedTokenFunc == nil && getEnvBoolIfValueAbsent(providerConfig.UseOIDC, "STACKIT_USE_OIDC") {
sdkConfig.WorkloadIdentityFederation = true
// https://docs.github.com/en/actions/reference/security/oidc#methods-for-requesting-the-oidc-token
oidcReqURL := getEnvStringOrDefault(providerConfig.OIDCTokenRequestURL, "ACTIONS_ID_TOKEN_REQUEST_URL", "")
oidcReqToken := getEnvStringOrDefault(providerConfig.OIDCTokenRequestToken, "ACTIONS_ID_TOKEN_REQUEST_TOKEN", "")
if oidcReqURL != "" && oidcReqToken != "" {
sdkConfig.ServiceAccountFederatedTokenFunc = oidcadapters.RequestGHOIDCToken(oidcReqURL, oidcReqToken)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this implementation Github specific? If yes, I think the env STACKIT_USE_OIDC could be confusing, because it sounds more generic, but it enables only OIDC for Github.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is Github specific but next step is to support AzDO too (I'm on it but it required a task on AzDO). I've used a generic name because of that, but I can change it if you prefer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, there is an option to provide the OIDC token by your own, so I'd not change this

@github-actions
Copy link

This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it.

@github-actions github-actions bot added the Stale PR is marked as stale due to inactivity. label Jan 29, 2026
JorTurFer and others added 26 commits February 3, 2026 18:29
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
.
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
.
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
.
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
.
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
.
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
.
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
.
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
.
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Signed-off-by: Jorge Turrado <jorge_turrado@hotmail.es>
Co-authored-by: Marcel Jacek <72880145+marceljk@users.noreply.github.com>
Signed-off-by: Jorge Turrado <jorge.turrado@mail.schwarz>
Signed-off-by: Jorge Turrado <jorge.turrado@mail.schwarz>
Signed-off-by: Jorge Turrado <jorge.turrado@mail.schwarz>
Signed-off-by: Jorge Turrado <jorge.turrado@mail.schwarz>
@JorTurFer JorTurFer marked this pull request as ready for review February 3, 2026 17:40
@JorTurFer JorTurFer requested a review from a team as a code owner February 3, 2026 17:40
@JorTurFer JorTurFer changed the title WIP - Support Workload Identity Federation flow Support Workload Identity Federation flow Feb 3, 2026
@github-actions github-actions bot removed the Stale PR is marked as stale due to inactivity. label Feb 4, 2026
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