MCPcopy Create free account
hub / github.com/nhost/nhost / respToSecrets

Function respToSecrets

cli/cmd/config/pull.go:105–134  ·  view source on GitHub ↗
(env []*graphql.GetSecrets_AppSecrets, anonymize bool)

Source from the content-addressed store, hash-verified

103}
104
105func respToSecrets(env []*graphql.GetSecrets_AppSecrets, anonymize bool) model.Secrets {
106 secrets := make(model.Secrets, len(env))
107 for i, s := range env {
108 if anonymize {
109 switch s.Name {
110 case "HASURA_GRAPHQL_ADMIN_SECRET":
111 s.Value = clienv.DefaultLocalAdminSecret
112 case "HASURA_GRAPHQL_JWT_SECRET":
113 s.Value = DefaultGraphqlJWTSecret
114 case "NHOST_WEBHOOK_SECRET":
115 s.Value = DefaultNhostWebhookSecret
116 case "NHOST_JWT_PUBLIC_KEY":
117 s.Value = project.DefaultPubKey
118 case "NHOST_JWT_PRIVATE_KEY":
119 s.Value = project.DefaultPrivKey
120 case "NHOST_JWT_KID":
121 s.Value = project.DefaultNhostKID
122 default:
123 s.Value = "FIXME"
124 }
125 }
126
127 secrets[i] = &model.ConfigEnvironmentVariable{
128 Name: s.Name,
129 Value: s.Value,
130 }
131 }
132
133 return secrets
134}
135
136func pullSecrets(
137 ctx context.Context,

Callers 2

pullSecretsFunction · 0.70
ValidateRemoteFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected