Skip to content

Add config option to disable introspection query #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from Aug 6, 2018
Merged

Add config option to disable introspection query #361

merged 2 commits into from Aug 6, 2018

Conversation

ghost
Copy link

@ghost ghost commented Aug 4, 2018

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Documented? yes
Fixed tickets -
License MIT

This PR adds a configuration setting to disable introspection queries. See http://webonyx.github.io/graphql-php/security/#disabling-introspection

I have added a test case, but 12 tests did already fail on branch 0.11.

Copy link
Member

@mcg-web mcg-web left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi first of all thank you for the contribution @BitEcodes . The branch 0.11 is normally freeze (don't allow no more feature) but since this is related to security I think we can keep it on this version. But this should not introduce no BC. Some minor changes but this look good to me otherwise 👍 .

#app/config/config.yml
overblog_graphql:
security:
disable_introspection: '%kernel.debug%'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace by disable_introspection: false since this example will disable introspection only in debug mode (dev environment by example)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just renaming the config entry enable_introspection will ease the usage of %kernel.debug% parameter. What do you think of that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, i think that is probably the best solution. I will change this today or tomorrow and I will add the necessary change to have the introspection enabled by default to avoid any BC issues.

@@ -6,5 +6,6 @@ Security
* [Fields public control](fields-public-control.md)
* [Limiting query depth](limiting-query-depth.md)
* [Query complexity analysis](query-complexity-analysis.md)
* [Disable introspection](disable_introspection.md)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add this entry to main readme file.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

Disable introspection
=====================

This bundle supports [webonyx/graphql-php validation rule to disable introspection queries](webonyx/graphql-php).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix the url

Copy link
Member

@mcg-web mcg-web left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @BitEcodes 👍

@mcg-web mcg-web merged commit 8735c73 into overblog:0.11 Aug 6, 2018
@Kocal
Copy link
Member

Kocal commented Sep 3, 2018

Great contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants