graphql-engine/v3/crates/auth
Daniel Harvey 42768bab3a Implement NoAuth mode in AuthConfig (#877)
<!-- 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
2024-07-25 15:49:26 +00:00
..
dev-auth-webhook Enable baggage propagation (#868) 2024-07-23 11:44:54 +00:00
hasura-authn-core Implement NoAuth mode in AuthConfig (#877) 2024-07-25 15:49:26 +00:00
hasura-authn-jwt Explicitly import thiserror::Error in place (#827) 2024-07-11 15:18:27 +00:00
hasura-authn-noauth Implement NoAuth mode in AuthConfig (#877) 2024-07-25 15:49:26 +00:00
hasura-authn-webhook Explicitly import thiserror::Error in place (#827) 2024-07-11 15:18:27 +00:00