Skip to content

Conversation

@SferaDev
Copy link
Member

@SferaDev SferaDev commented Feb 24, 2025

No description provided.

@SferaDev SferaDev marked this pull request as draft February 24, 2025 15:00
Signed-off-by: Alexis Rico <[email protected]>
@SferaDev SferaDev requested a review from Copilot February 27, 2025 07:08
Copy link
Contributor

Copilot AI left a 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]>
@SferaDev SferaDev marked this pull request as ready for review February 27, 2025 08:59
@SferaDev SferaDev requested a review from tsg February 27, 2025 08:59
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]>
@SferaDev SferaDev changed the title Add next-auth with OIDC to Keycloak Add next-auth with OIDC Feb 27, 2025
Copy link
Member

@tsg tsg left a 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.

@SferaDev SferaDev added this pull request to the merge queue Feb 27, 2025
Merged via the queue into main with commit 5245ce1 Feb 27, 2025
4 checks passed
@SferaDev SferaDev mentioned this pull request Mar 19, 2025
@SferaDev SferaDev deleted the SferaDev/next-auth branch April 9, 2025 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants