Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/provider/sdk_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ var (
// - More secure than static tokens (short-lived, rotating)
func createIAASClient(serviceAccountKey string) (*iaas.APIClient, error) {
// Configure SDK with custom base URL if provided (for testing with mock server)
baseURL := os.Getenv("STACKIT_API_ENDPOINT")
baseURL := os.Getenv("STACKIT_IAAS_ENDPOINT")
tokenEndpoint := os.Getenv("STACKIT_TOKEN_BASEURL")
noAuth := os.Getenv("STACKIT_NO_AUTH") == "true"

var opts []config.ConfigurationOption
Expand All @@ -72,6 +73,10 @@ func createIAASClient(serviceAccountKey string) (*iaas.APIClient, error) {
opts = append(opts, config.WithEndpoint(baseURL))
}

if tokenEndpoint != "" {
opts = append(opts, config.WithTokenEndpoint(tokenEndpoint))
}

iaasClient, err := iaas.NewAPIClient(opts...)
if err != nil {
return nil, fmt.Errorf("failed to create STACKIT SDK API client: %w", err)
Expand Down