MCPcopy Index your code
hub / github.com/hasura/graphql-engine / GetAdminSecret

Method GetAdminSecret

cli/cli.go:206–220  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

204}
205
206func (c *ServerConfig) GetAdminSecret() string {
207 // when HGE is configured with an admin secret, all API requests to HGE should be
208 // authenticated using a x-hasura-admin-secret header.
209 // admin secrets can be configured with two environment variables
210 // - HASURA_GRAPHQL_ADMIN_SECRET (ref: https://hasura.io/docs/latest/graphql/core/deployment/deployment-guides/docker/#docker-secure)
211 // - HASURA_GRAPHQL_ADMIN_SECRETS (ref: https://hasura.io/docs/latest/graphql/cloud/security/multiple-admin-secrets/)
212 // the environment variable HASURA_GRAPHQL_ADMIN_SECRETS takes precedence when set
213 if len(c.AdminSecrets) > 0 {
214 // when HASURA_GRAPHQL_ADMIN_SECRETS environment variable is set, use the first available admin secret as the value of the header
215 return c.AdminSecrets[0]
216 } else if c.AdminSecret != "" {
217 return c.AdminSecret
218 }
219 return ""
220}
221
222func (c *ServerConfig) GetHasuraInternalServerConfig(client *httpc.Client) error {
223 var op errors.Op = "cli.ServerConfig.GetHasuraInternalServerConfig"

Callers 2

ValidateMethod · 0.80

Calls

no outgoing calls

Tested by 1