-
Notifications
You must be signed in to change notification settings - Fork 15
Securing a Graphql API #280
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
base: 7.x
Are you sure you want to change the base?
Conversation
|
This PR includes documentation updates New pages: |
keremgocen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's looking good so far and has valuable information. However there are a few typos and I think we can make it more practical with some code examples. I left a few comments.
|
|
||
| For the same reason it is advisable to avoid introspection and data field suggestions, it can make your API more secure to catch internal errors and redact which information you want to pass on to the end user. | ||
|
|
||
| For example, the following error reveals information XY: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this also a placeholder XY? feels like the JSON example here could be more illustrative?
|
|
||
| [source, graphql, indent=0] | ||
| ---- | ||
| // example |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing example here I think?
| There are many ways and places to use timeouts. | ||
| Here are a few examples. | ||
|
|
||
| // examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing example?
|
|
||
| Follow the input validation methods summarized in the link:https://cheatsheetseries.owasp.org/cheatsheets/GraphQL_Cheat_Sheet.html#input-validation[OWASP Cheat Sheet Series]. | ||
|
|
||
| // Examples? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also here, do we want an actual example?
| ---- | ||
| import depthLimit from 'graphql-depth-limit' | ||
| import express from 'express' | ||
| import graphqlHTTP from 'express-graphql' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we maybe use a more up to date example here? we could replace the deprecated express-graphql with graphql-http, apparently. (cc: @mjfwebb)
Co-authored-by: kerem <[email protected]>
this PR is kinda dependent on #274 now
would be good to publish them simultaneously
274 has two js examples missing