Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Create auth.go
Daniel Hougaard458639e93d03
diff --git a/cli/packages/util/auth.go b/cli/packages/util/auth.gonew file mode 100644index 0000000000..f2ab9f38a3--- /dev/null+++ b/cli/packages/util/auth.go@@ -0,0 +1,30 @@+package util++type AuthStrategyType string++var AuthStrategy = struct {+ UNIVERSAL_AUTH AuthStrategyType+ KUBERNETES_AUTH AuthStrategyType+}{+ UNIVERSAL_AUTH: "universal-auth",+ KUBERNETES_AUTH: "kubernetes",+}++var AVAILABLE_AUTH_STRATEGIES = []AuthStrategyType{+ AuthStrategy.UNIVERSAL_AUTH,+ AuthStrategy.KUBERNETES_AUTH,+}++func IsAuthMethodValid(authMethod string) (isValid bool, strategy AuthStrategyType) {++ if authMethod == "user" {+ return true, ""+ }++ for _, strategy := range AVAILABLE_AUTH_STRATEGIES {+ if string(strategy) == authMethod {+ return true, strategy+ }+ }+ return false, ""+}