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

Commit 341db0b

Browse files
author
Elliott Barrere
committed
Add a check for the azure_environment option
1 parent b33d65e commit 341db0b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

internal/config/config.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,18 @@ func Load(ctx context.Context, p, domain string, opts ...Option) (config AAD, er
9494
if config.AppID == "" {
9595
return AAD{}, fmt.Errorf("missing required 'app_id' entry in configuration file")
9696
}
97+
9798
if config.AzureEnvironment == "" {
9899
config.AzureEnvironment = "Commercial"
99100
}
100-
101+
switch config.AzureEnvironment {
102+
case "Commercial":
103+
logger.Debug(ctx, "Using Azure Commercial environment")
104+
case "GCC-H":
105+
logger.Debug(ctx, "Using Azure GCC-H environment")
106+
default:
107+
return AAD{}, fmt.Errorf("unknown value '%s' for 'azure_environment'", config.AzureEnvironment)
108+
}
101109
return config, nil
102110
}
103111

0 commit comments

Comments
 (0)