-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
allow authentication webhook with POST (close #1138) #1147
Conversation
Resolve Conflicts: docs/graphql/manual/deployment/graphql-engine-flags/reference.rst
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.
Can we change the flag/env var name to --auth-hook-mode=GET|POST
with GET
as default?
Env var will be HASURA_GRAPHQL_AUTH_HOOK_MODE=GET|POST
Review app for commit 0722d1c deployed to Heroku: https://hge-ci-pull-1147.herokuapp.com |
Review app for commit cb07b83 deployed to Heroku: https://hge-ci-pull-1147.herokuapp.com |
@rikinsk Need your approval on docs. |
Review app for commit 1d8568b deployed to Heroku: https://hge-ci-pull-1147.herokuapp.com |
Review app for commit a824638 deployed to Heroku: https://hge-ci-pull-1147.herokuapp.com |
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.
Updated docs and approved
Review app for commit 553b855 deployed to Heroku: https://hge-ci-pull-1147.herokuapp.com |
Review app https://hge-ci-pull-1147.herokuapp.com is deleted |
<!-- The PR description should answer 2 important questions: --> ### What This PR adds the `Spanned` type: an OpenDD wrapper that can be placed inside the Metadata. It's basically a pair of the value and the path to the value in the original metadata. This allows us to do things like source maps. <!-- What is this PR trying to accomplish (and why, if it's not obvious)? --> <!-- Consider: do we need to add a changelog entry? --> <!-- Does this PR introduce new validation that might break old builds? --> <!-- Consider: do we need to put new checks behind a flag? --> ### How It's almost exactly what @danieljharvey proposed originally. <!-- How is it trying to accomplish it (what are the implementation steps)? --> --------- Co-authored-by: Daniel Harvey <[email protected]> V3_GIT_ORIGIN_REV_ID: 4f037686b6981fffc4b0a8ac8f95c2f9c623af67
<!-- The PR description should answer 2 important questions: --> ### What We would like to show error paths for `metadata-resolve` so that debugging these errors is a little less painful, both for us and end users. To this end, #1147 introduced a type wrapper that would be deserialised to contain its own JSON path, so we could then pass this path to errors. This PR does precisely this for the `UnknownModelDataConnector` error. I chose this error because... it was the first one on the list, not for any reason beyond that. Right now, this is an extremely simple case whereby only one path is required, however other errors may need two ("name at path X conflicts with name at path Y", for example). This PR also changes the default engine error stdout to show the `Debug` instance rather than the `Display` instance, as the error path is discarded by the `Display` instance. Unfortunately, we use `Display` for both stdout and user responses, which is maybe something we'd want to change eventually, but for now this means we can't just add the error path to the `Display` instance. ### How I started by making `Model` a `Spanned` element within the metadata structure. I then added the `path` key to the resolved `Model` type. I then found the first error type that included a model name, and added the `path` key to that error variant. Then, I just did the wiring. You'll note that this error doesn't _alway_ return a path because it isn't always raised by a model-first code path, but this is probably the first PR of many. ### Next steps * Next step is to make the output a little neater, probably by creating an actual structured error type (most likely a lot like `Spanned`, with a `path` and a `value`). Then, we can use a `Display` instance again to print this nicely in the stdout, but ignore the path in the MBS API response. * After that, the plan is to stop ignoring it in the MBS API response, with a new key to hold an error path. * Step three is to allow for errors to produce multiple error paths in a list, hopefully such that they tell a story ("I found this... but then I found this... and those two things conflict") * Step four will be a wave of PRs that look quite similar to this one, wiring up paths to as many errors as possible. <!-- How is it trying to accomplish it (what are the implementation steps)? --> V3_GIT_ORIGIN_REV_ID: 2d8dda018055f65711e66b08aa15188b516e2ddc
Description
What component does this PR affect?
Requires changes from other components? If yes, please mark the components:
Related Issue
close #1138
Solution and Design
Use
--auth-hook-mode
option orHASURA_GRAPHQL_AUTH_HOOK_MODE
env variable to set authentication webhook mode (
POST
orGET
). Default isGET
Hasura's request to auth hook:-
Type
Checklist: