MCPcopy Index your code
hub / github.com/cli/cli / GetSecretEntity

Function GetSecretEntity

pkg/cmd/secret/shared/shared.go:46–64  ·  view source on GitHub ↗
(orgName, envName string, userSecrets bool)

Source from the content-addressed store, hash-verified

44)
45
46func GetSecretEntity(orgName, envName string, userSecrets bool) (SecretEntity, error) {
47 orgSet := orgName != ""
48 envSet := envName != ""
49
50 if orgSet && envSet || orgSet && userSecrets || envSet && userSecrets {
51 return "", errors.New("cannot specify multiple secret entities")
52 }
53
54 if orgSet {
55 return Organization, nil
56 }
57 if envSet {
58 return Environment, nil
59 }
60 if userSecrets {
61 return User, nil
62 }
63 return Repository, nil
64}
65
66func GetSecretApp(app string, entity SecretEntity) (App, error) {
67 switch strings.ToLower(app) {

Callers 4

removeRunFunction · 0.92
listRunFunction · 0.92
setRunFunction · 0.92
TestGetSecretEntityFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestGetSecretEntityFunction · 0.68