Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Update tests.go

Daniel Hougaard22c589e2cf84
diff --git a/cli/packages/util/tests.go b/cli/packages/util/tests.go
index 816df573e9..989376e585 100644
--- a/cli/packages/util/tests.go
+++ b/cli/packages/util/tests.go
@@ -9,10 +9,11 @@ import (
"github.com/spf13/cobra"
)
+var IS_TEST_MODE = os.Getenv("TEST_MODE") == "true"
+
func HandleSendTestSecrets(cmd *cobra.Command, secrets []models.SingleEnvironmentVariable) {
- isTestMode := os.Getenv("TEST_MODE")
- if isTestMode != "true" {
+ if !IS_TEST_MODE {
return
}
@@ -22,5 +23,28 @@ func HandleSendTestSecrets(cmd *cobra.Command, secrets []models.SingleEnvironmen
}
fmt.Fprint(cmd.OutOrStdout(), string(jsonOut))
+}
+
+func HandleSendTestEnvVars(cmd *cobra.Command, envs []string) {
+
+ if !IS_TEST_MODE {
+ return
+ }
+
+ stringEnvVars := ""
+
+ for _, env := range envs {
+ stringEnvVars += env + "\n"
+ }
+
+ fmt.Fprint(cmd.OutOrStdout(), string(stringEnvVars))
+}
+
+func HandleSendUniversalAuthToken(cmd *cobra.Command, token string) {
+
+ if !IS_TEST_MODE {
+ return
+ }
+ fmt.Fprint(cmd.OutOrStdout(), token)
}