graphql-engine/server/lib
Samir Talwar a8d1002175 server: Factor out authentication-related code into a new namespace, Hasura.Authentication.
In preparation for tightening up the various ways in which we construct and work with session variables, I am trying to move the behavior into the same module(s) as the data types, so that we can avoid exposing the internals of data structures in favor of smart constructors and conversions.

The session variable code was split between `Hasura.RQL.Types.Roles`, `Hasura.RQL.Types.Session`, and `Hasura.Session`, with the first two containing most of the data structures (and some logic) and the latter containing the rest of the logic. These files do not interact with the rest of `Hasura.RQL`, though they are depended upon by that namespace.

I have refactored these files into a new namespace, `Hasura.Authentication`. It now looks like this:

1. Role types are now in `Hasura.Authentication.Role`.
2. Header constants were moved from `Hasura.Server.Utils` to `Hasura.Authentication.Headers` (plural) to avoid cycles.
3. Header logic was moved from various places into `Hasura.Authentication.Header` (singular) for the same reason.
4. Session variable types and logic live together in `Hasura.Authentication.Session`.
5. User info types and logic live together in `Hasura.Authentication.User`.

This new structure is cycle-free and generally avoids importing the rest of the code, which means we should be able to start pruning the list of exports and locking down session variable construction.

No behavior was changed in this changeset.

The majority of changes are to the imports in a number of files; everything depends on these things. By splitting into multiple files, we also reduce the surface area of an individual import, which was a pleasant side-effect of this work.

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10960
GitOrigin-RevId: 7cb962c06483cd9b92b80432aed5cabecb465cda
2024-07-29 06:02:56 +00:00
..
aeson-ordered Upgrade Ormolu to 0.7.0.0 2023-05-24 13:53:53 +00:00
api-tests Return correct type when an update_many has no arguments 2024-07-26 16:19:18 +00:00
arrows-extra Move query validation into the schema cache building code 2023-06-12 14:57:41 +00:00
ci-info chore(ci-info): fix various compiler warnings 2023-06-08 12:25:22 +00:00
dc-api Jberryman/ghc 9.6.4 2024-01-23 19:47:53 +00:00
ekg-json chore(tooling): import ekg-json into the monorepo 2023-06-07 08:38:48 +00:00
ekg-prometheus server/pro/opentelemetry: Fix missing overflow bucket in OTLP histogr… 2024-06-05 10:49:18 +00:00
graphql-parser Apply HLint's new proposed fixes. 2023-12-07 09:16:33 +00:00
hasura-base Jberryman/ghc 9.6.4 2024-01-23 19:47:53 +00:00
hasura-error-message server: Rename "error-message" to "hasura-error-message". 2023-06-27 16:51:06 +00:00
hasura-extras server: support env template for otel status 2024-04-17 07:25:44 +00:00
hasura-json-encoding Put the message property first when encoding error JSON 2023-06-02 05:29:50 +00:00
hasura-prelude Actually thread through where those 60 seconds come from 2024-06-17 13:56:12 +00:00
incremental Jberryman/ghc 9.6.4 2024-01-23 19:47:53 +00:00
pg-client Remove the version from Docker Compose files. 2024-07-17 13:49:05 +00:00
resource-pool server: add hasura_postgres_max_connection prometheus metric 2024-02-20 06:01:04 +00:00
schema-parsers Don't set columns to NULL when nullable variables are omitted 2024-07-19 11:59:52 +00:00
test-harness server: Factor out authentication-related code into a new namespace, Hasura.Authentication. 2024-07-29 06:02:56 +00:00
upgrade-tests Use a test PostgreSQL image based on Debian, not Alpine. 2024-07-19 08:18:01 +00:00