Skip to content

Commit 6297b38

Browse files
authored
Merge pull request #128 from stackitcloud/feature/cert-manager_base-url
feat: add the possibility to set url endpoint for service account authentication
2 parents 0f4edc3 + 208713d commit 6297b38

File tree

8 files changed

+46
-15
lines changed

8 files changed

+46
-15
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ spec:
185185
authTokenSecretKey: string
186186
authTokenSecretNamespace: string
187187
serviceAccountKeyPath: string
188+
serviceAccountBaseUrl: string
188189
acmeTxtRecordTTL: int64
189190
```
190191

@@ -195,6 +196,7 @@ spec:
195196
- authTokenSecretKey: The key within the secret containing the STACKIT authentication token. (Default: auth-token)
196197
- authTokenSecretNamespace: The namespace of the secret containing the STACKIT authentication token. (Default: cert-manager)
197198
- serviceAccountKeyPath: The path to the service account key file. The file must be mounted into the container.
199+
- serviceAccountBaseUrl: The base URL for the STACKIT service account API. (Default: https://service-account.api.stackit.cloud/token)
198200
- acmeTxtRecordTTL: The TTL for the ACME TXT record. (Default: 600)
199201

200202
## Test Procedures

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
@@ -25,6 +25,7 @@ type StackitDnsProviderConfig struct {
2525
AuthTokenSecretKey string `json:"authTokenSecretKey"`
2626
AuthTokenSecretNamespace string `json:"authTokenSecretNamespace"`
2727
ServiceAccountKeyPath string `json:"serviceAccountKeyPath"`
28+
ServiceAccountBaseUrl string `json:"serviceAccountBaseUrl"`
2829
AcmeTxtRecordTTL int64 `json:"acmeTxtRecordTTL"`
2930
}
3031

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)