Create allow list for event when intospection is blocked but developers

really want to use certain subqueries.
This commit is contained in:
2023-10-15 10:01:23 +01:00
parent 29ffb8a817
commit 2a0302ab75
4 changed files with 28 additions and 2 deletions
+7
View File
@@ -30,6 +30,13 @@ func parseConfig() {
c.Cache.CacheEnable = envutil.GetBool("ENABLE_GLOBAL_CACHE", false)
c.Cache.CacheTTL = envutil.GetInt("CACHE_TTL", 60)
c.Security.BlockIntrospection = envutil.GetBool("BLOCK_SCHEMA_INTROSPECTION", false)
c.Security.IntrospectionAllowed = func() []string {
urls := envutil.Getenv("ALLOWED_INTROSPECTION", "")
if urls == "" {
return nil
}
return strings.Split(urls, ",")
}()
c.Logger = libpack_logging.NewLogger()
c.Client.GQLClient = graphql.NewConnection()
c.Client.GQLClient.SetEndpoint(c.Server.HostGraphQL)