mirror of
https://github.com/hanzokms/go-sdk.git
synced 2026-10-30 19:44:54 +00:00
- Module path: github.com/infisical/go-sdk -> github.com/hanzokms/go-sdk - Package name: infisical -> kms - Types: InfisicalClient -> Client, NewInfisicalClient -> NewClient - Default URL: app.infisical.com -> kms.hanzo.ai - Env vars: INFISICAL_ prefix -> KMS_ prefix - User agent: infisical-go-sdk -> hanzo-kms-go-sdk - Copyright: Hanzo AI Inc. - go build ./... passes clean
40 lines
750 B
Go
40 lines
750 B
Go
package test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
kms "github.com/hanzokms/go-sdk"
|
|
)
|
|
|
|
func TestBatchCreateSecrets(t *testing.T) {
|
|
client := kms.NewClient(context.Background(), kms.Config{
|
|
SiteUrl: "http://localhost:8080",
|
|
AutoTokenRefresh: true,
|
|
})
|
|
|
|
client.Auth().SetAccessToken("<token>")
|
|
|
|
secs, err := client.Secrets().Batch().Create(kms.BatchCreateSecretsOptions{
|
|
Environment: "dev",
|
|
SecretPath: "/",
|
|
ProjectID: "06c4d805-ac8a-456f-906f-1319554d15ec",
|
|
Secrets: []kms.BatchCreateSecret{
|
|
{
|
|
SecretKey: "test3",
|
|
SecretValue: "test1",
|
|
},
|
|
{
|
|
SecretKey: "test4",
|
|
SecretValue: "test2",
|
|
},
|
|
},
|
|
})
|
|
|
|
if err != nil {
|
|
t.Fatalf("Failed to create secrets: %v", err)
|
|
}
|
|
|
|
t.Logf("Secrets: %v", secs)
|
|
}
|