Microsoft Azure Key Vault support
This commit is contained in:
33
azure_test.go
Normal file
33
azure_test.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package secret
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAzureKeyVault(t *testing.T) {
|
||||
tenant := os.Getenv("AZURE_TENANT_ID")
|
||||
if tenant == "" {
|
||||
t.Skip("AZURE_TENANT_ID not set, which should contain the tenant ID for testing")
|
||||
return
|
||||
}
|
||||
|
||||
vault := os.Getenv("AZURE_KEY_VAULT")
|
||||
if vault == "" {
|
||||
t.Skip("AZURE_KEY_VAULT not set, which should contain the name of the Key Vault for testing")
|
||||
}
|
||||
|
||||
p, err := AzureKeyVault(tenant, vault)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
return
|
||||
}
|
||||
|
||||
v, err := p.GetSecret("test-integration")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
return
|
||||
}
|
||||
|
||||
t.Logf("secret: %q", v)
|
||||
}
|
Reference in New Issue
Block a user