-
Notifications
You must be signed in to change notification settings - Fork 0
/
secrets.go
36 lines (29 loc) · 1012 Bytes
/
secrets.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package azure
import (
"os"
"github.com/karuppiah7890/tce-e2e-test/testutils/log"
"github.com/karuppiah7890/tce-e2e-test/testutils/utils"
)
const TenantIDEnvVarName = "AZURE_TENANT_ID"
const SshPublicKeyBase64EnvVarName = "AZURE_SSH_PUBLIC_KEY_B64"
const ClientIDEnvVarName = "AZURE_CLIENT_ID"
const ClientSecretEnvVarName = "AZURE_CLIENT_SECRET"
const SubscriptionIDEnvVarName = "AZURE_SUBSCRIPTION_ID"
type TestSecrets struct {
TenantID string
SubscriptionID string
ClientID string
ClientSecret string
SshPublicKey string
}
func ExtractAzureTestSecretsFromEnvVars() TestSecrets {
utils.CheckRequiredEnvVars(PROVIDER)
log.Info("Extracting Azure test secrets from environment variables")
return TestSecrets{
TenantID: os.Getenv(TenantIDEnvVarName),
SubscriptionID: os.Getenv(SubscriptionIDEnvVarName),
ClientID: os.Getenv(ClientIDEnvVarName),
ClientSecret: os.Getenv(ClientSecretEnvVarName),
SshPublicKey: os.Getenv(SshPublicKeyBase64EnvVarName),
}
}