feat: implement WIF authentication flow and remove static token auth flow - #93
Open
ondbeh wants to merge 5 commits into
Open
feat: implement WIF authentication flow and remove static token auth flow#93ondbeh wants to merge 5 commits into
ondbeh wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the STACKIT ExternalDNS webhook authentication model to support Workload Identity Federation (WIF), removes the legacy static token auth flow, and refreshes documentation and CLI/config wiring accordingly.
Changes:
- Introduces an explicit auth configuration model (
WebhookAuthConfig) with support for explicit Service Account Key auth, explicit WIF auth, and default SDK discovery. - Updates the webhook CLI flags to remove
--auth-tokenand add WIF-related flags; improves runtime error handling messaging. - Refreshes README deployment/configuration guidance for Service Account Key vs WIF usage.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| README.md | Updates deployment/auth documentation for Service Account Key and WIF flows; refreshes examples and configuration section. |
| pkg/stackit/options.go | Reworks SDK configuration to use an auth config struct and support explicit WIF or default SDK auth discovery. |
| pkg/stackit/options_test.go | Updates and expands unit tests to match the new auth configuration behavior (default/explicit key/explicit WIF). |
| cmd/webhook/cmd/root.go | Replaces the old token/key CLI auth wiring with the new auth config (key/WIF flags) and updates error handling. |
Suppressed comments (2)
cmd/webhook/cmd/root.go:80
- zap.Logger.Fatal calls os.Exit(1), which bypasses deferred functions. That means the deferred logger.Sync() above will not run, risking dropped/unsent log entries. Prefer logging the error and returning it (e.g., via RunE), or at least avoid Fatal so defers run.
logger.Fatal("server error", zap.Error(err))
cmd/webhook/cmd/root.go:74
- zap.Logger.Fatal calls os.Exit(1), which bypasses deferred functions. That means the deferred logger.Sync() above will not run, risking dropped/unsent log entries. Prefer logging the error and returning it (e.g., via RunE), or at least avoid Fatal so defers run.
logger.Fatal("failed to initialize STACKIT DNS provider", zap.Error(err))
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
fsandel
approved these changes
Aug 20, 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.
This pull request introduces significant improvements to the authentication options and documentation for the STACKIT ExternalDNS webhook, with a focus on supporting Workload Identity Federation (WIF) and clarifying configuration. The changes enhance flexibility in authentication, improve error handling, and update the documentation to guide users through both Service Account Key and WIF authentication flows. It also removes the explicit usage of long lived auth tokens as those are no longer supported by STACKIT.