From 63c8d51b45ad0c8f9dc639f27442369f8337ac3a Mon Sep 17 00:00:00 2001 From: Nicolas Ontiveros Date: Sat, 16 Aug 2025 22:16:28 -0700 Subject: [PATCH] save work --- pkg/auth/cloud-login.yaml | 7 +++++++ pkg/auth/niontive_test.go | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 pkg/auth/cloud-login.yaml create mode 100644 pkg/auth/niontive_test.go diff --git a/pkg/auth/cloud-login.yaml b/pkg/auth/cloud-login.yaml new file mode 100644 index 00000000..95cd4ac3 --- /dev/null +++ b/pkg/auth/cloud-login.yaml @@ -0,0 +1,7 @@ +name: Admin +token: *** +certificate: *** +cloudport: 0 +cloudauthport: 0 +location: "" +type: CA-Signed \ No newline at end of file diff --git a/pkg/auth/niontive_test.go b/pkg/auth/niontive_test.go new file mode 100644 index 00000000..0db1be9d --- /dev/null +++ b/pkg/auth/niontive_test.go @@ -0,0 +1,25 @@ +package auth + +import ( + "fmt" + "testing" +) + +// NIONTIVE - unit test to verify if: +// Cert doesn't need to be renewed and token is expired +// Bubbles up no error for authorizer creation, and we attempt to use an expired token. + +func TestNiontive(t *testing.T) { + serverName := "niontive-test-server" + + t.Setenv("WSSD_CLIENT_TOKEN", "cloud-login.yaml") + + auth, err := NewAuthorizerFromEnvironment(serverName) + if err != nil { + t.Error("Expected no error when creating authorizer, got:", err) + } + + rpcCreds := auth.WithRPCAuthorization() + + fmt.Println("RPC Credentials:", rpcCreds) +}