mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
42768bab3a
<!-- The PR description should answer 2 (maybe 3) important questions: --> ### What We'd like to make it simpler to try out DDN, by starting with a mode that uses no auth. <!-- What is this PR trying to accomplish (and why, if it's not obvious)? --> <!-- Consider: do we need to add a changelog entry? --> ### How Add a `NoAuth` `AuthConfig` mode that is configured thus: ```json "noAuth": { "role": "admin", "sessionVariables": { "x-hasura-user-id": "1" } } ``` Given the above config: - If no `x-hasura-role` is sent with a request, we run it as `admin`. - If a `x-hasura-role` header is sent and it's `admin`, it continues to work - If any other `x-hasura-role` header is sent, an error will happen. - All other headers are ignored, and we always set `x-hasura-user-id` to 1 <!-- How is it trying to accomplish it (what are the implementation steps)? --> V3_GIT_ORIGIN_REV_ID: dddcfbee9c3a31e84dfc8013de32e3a9bf31943d
15 lines
227 B
JSON
15 lines
227 B
JSON
{
|
|
"version": "v1",
|
|
"definition": {
|
|
"allowRoleEmulationBy": "admin",
|
|
"mode": {
|
|
"noAuth": {
|
|
"role": "admin",
|
|
"sessionVariables": {
|
|
"x-hasura-user-id": "1"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|