Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Add a check for the azure_environment option
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarrere committed Apr 23, 2024
1 parent b33d65e commit 341db0b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,18 @@ func Load(ctx context.Context, p, domain string, opts ...Option) (config AAD, er
if config.AppID == "" {
return AAD{}, fmt.Errorf("missing required 'app_id' entry in configuration file")
}

if config.AzureEnvironment == "" {
config.AzureEnvironment = "Commercial"
}

switch config.AzureEnvironment {
case "Commercial":
logger.Debug(ctx, "Using Azure Commercial environment")
case "GCC-H":
logger.Debug(ctx, "Using Azure GCC-H environment")
default:
return AAD{}, fmt.Errorf("unknown value '%s' for 'azure_environment'", config.AzureEnvironment)
}
return config, nil
}

Expand Down

0 comments on commit 341db0b

Please sign in to comment.