diff --git a/.devcontainer/.env b/.devcontainer/.env index bf227a27c..21e3ffc1b 100644 --- a/.devcontainer/.env +++ b/.devcontainer/.env @@ -9,6 +9,7 @@ LOADBALANCERAPI_CRDB_URI="postgresql://root@crdb:26257/load_balancer_api_dev?ssl LOADBALANCERAPI_EVENTS_NATS_CREDSFILE="/workspaces/load-balancer-api/.devcontainer/nsc/nkeys/creds/LOCAL/LBAAS/USER.creds" LOADBALANCERAPI_EVENTS_NATS_PUBLISHPREFIX=com.infratographer LOADBALANCERAPI_EVENTS_NATS_QUEUEGROUP=loadbalancerapi +LOADBALANCERAPI_PERMISSIONS_IGNORENORESPONDERS=true NKEYS_PATH="/workspaces/load-balancer-api/.devcontainer/nsc/nkeys" NSC_HOME="/workspaces/load-balancer-api/.devcontainer/nsc/nats" diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index afaa3753f..31cb16f01 100644 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -9,7 +9,7 @@ services: context: . dockerfile: Dockerfile args: - VARIANT: 1.20-bullseye + VARIANT: 1.21-bullseye NODE_VERSION: "none" # Overrides default command so things don't shut down after the process ends. command: sleep infinity diff --git a/cmd/serve.go b/cmd/serve.go index c2712dd57..2e5edb7e3 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -114,6 +114,8 @@ func writePidFile(pidFile string) error { } func serve(ctx context.Context) error { + var resolverOpts []graphapi.Option + if serveDevMode { enablePlayground = true config.AppConfig.Logging.Debug = true @@ -172,6 +174,11 @@ func serve(ctx context.Context) error { metadataClient = metadata.New(config.AppConfig.Supergraph.URL) } } + + if metadataClient != nil { + resolverOpts = append(resolverOpts, graphapi.WithMetadataClient(metadataClient)) + } + // TODO: fix generated pubsubhooks // eventhooks.PubsubHooks(client) @@ -213,7 +220,7 @@ func serve(ctx context.Context) error { middleware = append(middleware, perms.Middleware()) - r := graphapi.NewResolver(client, logger.Named("resolvers"), graphapi.WithMetadataClient(metadataClient)) + r := graphapi.NewResolver(client, logger.Named("resolvers"), resolverOpts...) handler := r.Handler(enablePlayground, middleware...) srv.AddHandler(handler)