()
| 204 | } |
| 205 | |
| 206 | func (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 | |
| 222 | func (c *ServerConfig) GetHasuraInternalServerConfig(client *httpc.Client) error { |
| 223 | var op errors.Op = "cli.ServerConfig.GetHasuraInternalServerConfig" |
no outgoing calls