Skip to content

Commit 12cb633

Browse files
committed
Add the possibility to set url endpoint for service account authentication.
1 parent 0e3b11d commit 12cb633

File tree

7 files changed

+44
-15
lines changed

7 files changed

+44
-15
lines changed

internal/repository/config.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package repository
33
import "net/http"
44

55
type Config struct {
6-
ApiBasePath string
7-
AuthToken string
8-
ProjectId string
9-
HttpClient *http.Client
10-
SaKeyPath string
11-
UseSaKey bool
6+
ApiBasePath string
7+
ServiceAccountBaseUrl string
8+
AuthToken string
9+
ProjectId string
10+
HttpClient *http.Client
11+
SaKeyPath string
12+
UseSaKey bool
1213
}

internal/repository/dns_client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ func newStackitDnsClientKeyPath(config Config) (*stackitdnsclient.APIClient, err
2828
stackitconfig.WithServiceAccountKeyPath(config.SaKeyPath),
2929
stackitconfig.WithHTTPClient(&httpClient),
3030
stackitconfig.WithEndpoint(config.ApiBasePath),
31+
stackitconfig.WithTokenEndpoint(config.ServiceAccountBaseUrl),
3132
)
3233
}
3334

internal/repository/mock/rrset_repository.go

Lines changed: 12 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/repository/mock/zone_repository.go

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/resolver/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type defaultConfigProvider struct {
2121
type StackitDnsProviderConfig struct {
2222
ProjectId string `json:"projectId"`
2323
ApiBasePath string `json:"apiBasePath"`
24+
ServiceAccountBaseUrl string `json:"serviceAccountBaseUrl"`
2425
AuthTokenSecretRef string `json:"authTokenSecretRef"`
2526
AuthTokenSecretKey string `json:"authTokenSecretKey"`
2627
AuthTokenSecretNamespace string `json:"authTokenSecretNamespace"`

internal/resolver/mock/config.go

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/resolver/mock/secrets.go

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)