diff --git a/core/auth/auth.go b/core/auth/auth.go index 98ccaefaa..8eb30d1c3 100644 --- a/core/auth/auth.go +++ b/core/auth/auth.go @@ -14,7 +14,7 @@ import ( type credentialType string type Credentials struct { - STACKIT_SERVICE_ACCOUNT_EMAIL string + STACKIT_SERVICE_ACCOUNT_EMAIL string // Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025. STACKIT_SERVICE_ACCOUNT_TOKEN string STACKIT_SERVICE_ACCOUNT_KEY_PATH string STACKIT_PRIVATE_KEY_PATH string @@ -246,6 +246,8 @@ func readCredential(cred credentialType, credentials *Credentials) (string, erro // getServiceAccountEmail searches for an email in the following order: client configuration, environment variable, credentials file. // is not required for authentication, so it can be empty. +// +// Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025. func getServiceAccountEmail(cfg *config.Configuration) string { if cfg.ServiceAccountEmail != "" { return cfg.ServiceAccountEmail diff --git a/core/clients/token_flow.go b/core/clients/token_flow.go index 5aad94321..3748c4dc8 100644 --- a/core/clients/token_flow.go +++ b/core/clients/token_flow.go @@ -19,6 +19,7 @@ type TokenFlow struct { // TokenFlowConfig is the flow config type TokenFlowConfig struct { + // Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025. ServiceAccountEmail string ServiceAccountToken string // Deprecated: retry options were removed to reduce complexity of the client. If this functionality is needed, you can provide your own custom HTTP client. diff --git a/core/config/config.go b/core/config/config.go index 2757d4f66..82a7bac9d 100644 --- a/core/config/config.go +++ b/core/config/config.go @@ -81,7 +81,7 @@ type Configuration struct { UserAgent string `json:"userAgent,omitempty"` Debug bool `json:"debug,omitempty"` NoAuth bool `json:"noAuth,omitempty"` - ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` + ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` // Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025. Token string `json:"token,omitempty"` ServiceAccountKey string `json:"serviceAccountKey,omitempty"` PrivateKey string `json:"privateKey,omitempty"` @@ -176,6 +176,8 @@ func WithTokenEndpoint(url string) ConfigurationOption { } // WithServiceAccountEmail returns a ConfigurationOption that sets the service account email +// +// Deprecated: WithServiceAccountEmail is not required and will be removed after 12th June 2025. func WithServiceAccountEmail(serviceAccountEmail string) ConfigurationOption { return func(config *Configuration) error { config.ServiceAccountEmail = serviceAccountEmail @@ -319,7 +321,6 @@ func WithCustomConfiguration(cfg *Configuration) ConfigurationOption { config.NoAuth = cfg.NoAuth config.Token = cfg.Token config.ServiceAccountKey = cfg.ServiceAccountKey - config.ServiceAccountEmail = cfg.ServiceAccountEmail config.ServiceAccountKeyPath = cfg.ServiceAccountKeyPath config.PrivateKey = cfg.PrivateKey config.PrivateKeyPath = cfg.PrivateKeyPath