-
Notifications
You must be signed in to change notification settings - Fork 73
Add next-auth with OIDC #9
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
Conversation
Signed-off-by: Alexis Rico <[email protected]>
6a65d44 to
3658f4b
Compare
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.
PR Overview
This PR introduces NextAuth with OIDC support using Keycloak, while consolidating environment variable management for both client and server contexts. Key changes include:
- Adding a new server-side environment configuration (server.ts) that merges client and server variables.
- Implementing authentication endpoints and middleware using NextAuth with an OIDC provider.
- Updating dependency lock files to include the new next-auth release and its associated peer dependencies, and removing legacy env files.
Reviewed Changes
| File | Description |
|---|---|
| apps/dbagent/src/lib/env/server.ts | New unified server environment configuration that merges client and server variables. |
| apps/dbagent/src/auth.ts | Configures NextAuth with an OIDC provider for Keycloak. |
| apps/dbagent/src/middleware.ts | Exports NextAuth's auth handler as middleware. |
| apps/dbagent/src/app/api/auth/[...nextauth]/route.ts | Implements API route handlers for authentication. |
| pnpm-lock.yaml | Updates dependency versions and introduces new packages related to next-auth. |
| apps/dbagent/src/lib/notifications/slack-webhook.ts | Changes environment variable import from a general env to the client environment. |
| apps/dbagent/src/lib/env/client.ts | Minor cleanup in the client environment file. |
| apps/dbagent/src/lib/db/db.ts | Adjusts env import to use the unified server configuration. |
| apps/dbagent/src/lib/monitoring/scheduler.ts | Adjusts env import to use the unified server configuration. |
| apps/dbagent/src/lib/env/scheduler.ts | Removes redundant scheduler environment configuration. |
| apps/dbagent/src/lib/env/db.ts | Removes duplicate database environment configuration. |
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
apps/dbagent/src/lib/notifications/slack-webhook.ts:4
- The slack-webhook module might be better served using the secure server environment instead of the client environment to prevent potential exposure of sensitive credentials. Consider importing from '../env/server' if this code executes on the server.
import { env } from '../env/client';
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
Signed-off-by: Alexis Rico <[email protected]>
tsg
left a comment
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.
Nice, works well in my testing.
No description provided.