Skip to content

Commit 5f4b232

Browse files
authored
Deprecate service_account_email config option (#1134)
* Deprecate Service Account Mail option
1 parent a3f5db0 commit 5f4b232

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

core/auth/auth.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
type credentialType string
1515

1616
type Credentials struct {
17-
STACKIT_SERVICE_ACCOUNT_EMAIL string
17+
STACKIT_SERVICE_ACCOUNT_EMAIL string // Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025.
1818
STACKIT_SERVICE_ACCOUNT_TOKEN string
1919
STACKIT_SERVICE_ACCOUNT_KEY_PATH string
2020
STACKIT_PRIVATE_KEY_PATH string
@@ -246,6 +246,8 @@ func readCredential(cred credentialType, credentials *Credentials) (string, erro
246246

247247
// getServiceAccountEmail searches for an email in the following order: client configuration, environment variable, credentials file.
248248
// is not required for authentication, so it can be empty.
249+
//
250+
// Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025.
249251
func getServiceAccountEmail(cfg *config.Configuration) string {
250252
if cfg.ServiceAccountEmail != "" {
251253
return cfg.ServiceAccountEmail

core/clients/token_flow.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type TokenFlow struct {
1919

2020
// TokenFlowConfig is the flow config
2121
type TokenFlowConfig struct {
22+
// Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025.
2223
ServiceAccountEmail string
2324
ServiceAccountToken string
2425
// Deprecated: retry options were removed to reduce complexity of the client. If this functionality is needed, you can provide your own custom HTTP client.

core/config/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ type Configuration struct {
8181
UserAgent string `json:"userAgent,omitempty"`
8282
Debug bool `json:"debug,omitempty"`
8383
NoAuth bool `json:"noAuth,omitempty"`
84-
ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"`
84+
ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` // Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025.
8585
Token string `json:"token,omitempty"`
8686
ServiceAccountKey string `json:"serviceAccountKey,omitempty"`
8787
PrivateKey string `json:"privateKey,omitempty"`
@@ -176,6 +176,8 @@ func WithTokenEndpoint(url string) ConfigurationOption {
176176
}
177177

178178
// WithServiceAccountEmail returns a ConfigurationOption that sets the service account email
179+
//
180+
// Deprecated: WithServiceAccountEmail is not required and will be removed after 12th June 2025.
179181
func WithServiceAccountEmail(serviceAccountEmail string) ConfigurationOption {
180182
return func(config *Configuration) error {
181183
config.ServiceAccountEmail = serviceAccountEmail
@@ -319,7 +321,6 @@ func WithCustomConfiguration(cfg *Configuration) ConfigurationOption {
319321
config.NoAuth = cfg.NoAuth
320322
config.Token = cfg.Token
321323
config.ServiceAccountKey = cfg.ServiceAccountKey
322-
config.ServiceAccountEmail = cfg.ServiceAccountEmail
323324
config.ServiceAccountKeyPath = cfg.ServiceAccountKeyPath
324325
config.PrivateKey = cfg.PrivateKey
325326
config.PrivateKeyPath = cfg.PrivateKeyPath

0 commit comments

Comments
 (0)