fix: resolve enable_introspection env variable at runtime (#1211) - #1247
Open
ousamabenyounes wants to merge 1 commit into
Open
fix: resolve enable_introspection env variable at runtime (#1211)#1247ousamabenyounes wants to merge 1 commit into
ousamabenyounes wants to merge 1 commit into
Conversation
The security.enable_introspection option was evaluated at container-compile time. When it was backed by an environment variable, the value was still an unresolved placeholder string (always truthy), so introspection stayed enabled regardless of the variable. Pass the parameter reference to a new Executor::setIntrospectionQueryEnabled() method call so the value — including an env variable — is resolved when the service is instantiated. The existing enable/disableIntrospectionQuery() methods are kept and now delegate to it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
security.enable_introspectionwas evaluated at container-compile time:When the option is backed by an environment variable:
at compile time
$config['security']['enable_introspection']is still an unresolvedplaceholder string (e.g.
env_..._GRAPHQL_ENABLE_INTROSPECTION_...), which is alwaystruthy — so introspection stays enabled regardless of the variable.
Fix
Pass the parameter reference to a new
Executor::setIntrospectionQueryEnabled(bool)method call. The value — including the env variable — is then resolved when the service
is instantiated at runtime, not at compile time. The existing
enableIntrospectionQuery()/disableIntrospectionQuery()methods are kept and nowdelegate to it, so there is no BC break.
Test verification (RED → GREEN)
New functional test boots a kernel whose
enable_introspectionis bound to an envvariable, sets it to
false, and asserts introspection is blocked.RED — on the unmodified branch (fix reverted, test only), the env variable is
ignored and introspection stays enabled:
GREEN — with the fix, both the env-disabled and env-enabled cases pass:
Full suite is iso-baseline (the 5 pre-existing
GraphDumpSchemaCommandTestfailures onmasterare unrelated to this change and stay unchanged):Tests: 713, Failures: 5.