Commit eb2cec1
feat: OAuth middleware with module loaders for identity/secrets/auth config
Replace manual SQL queries and hardcoded schema assumptions in OAuth
middleware with module loaders from express-context:
New loaders:
- encryptedSecretsLoader: resolves encrypted_secrets schema from
metaschema_modules_public.encrypted_secrets_module
- userAuthLoader: resolves user_auth_module for sign_in/sign_up
function names and schema (no longer assumes privateSchema)
- identityProvidersLoader: resolves identity_providers_module for
provider config table location
OAuth middleware changes:
- Uses req.constructive.useModule() for all schema lookups
- Uses req.constructive.withPgClient() for properly scoped RLS
transactions (replaces manual set_config calls)
- Removes express-rate-limit (DB already handles rate limiting)
- Uses getNodeEnv() instead of process.env.NODE_ENV
- Extracts email_verified from raw provider profile data
- Passes loaders registry to createContextMiddleware in server.ts
Addresses review comments from PR #1141.1 parent 0f9a0c4 commit eb2cec1
10 files changed
Lines changed: 944 additions & 185 deletions
File tree
- graphql/server
- src
- middleware
- packages/express-context/src
- loaders
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
0 commit comments