Skip to content

Conversation

@guimard
Copy link
Member

@guimard guimard commented Dec 4, 2025

Adds OAuth2 handler and message-brokers

Copilot finished reviewing on behalf of guimard December 4, 2025 10:00
Copy link

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.

Pull request overview

This PR implements OAuth2/OIDC authentication handlers and a message broker infrastructure for the LemonLDAP::NG Node.js handler, upgrading all packages from version 0.7.x to 0.8.0. The changes enable distributed configuration management and add support for multiple authentication methods (OAuth2, HTTP Basic Auth, and Cross-Domain Authentication).

Key changes:

  • Introduces a message broker abstraction with implementations for Redis, PostgreSQL, HTTP/Web polling, and a no-op fallback
  • Adds three new handler types: OAuth2/OIDC, AuthBasic, and CDA (Cross-Domain Authentication)
  • Implements JWT utilities for token parsing and session ID extraction
  • Enhances session caching with handler-internal cache and cleanup methods
  • Adds event loop for processing broker messages (configuration reload, session purge)

Reviewed changes

Copilot reviewed 78 out of 80 changed files in this pull request and generated 21 comments.

Show a summary per file
File Description
packages/z-handler/src/tsv.ts Extends TSV type with OAuth2, CDA, AuthBasic, and message broker configuration fields
packages/z-handler/src/msgActions.ts Implements message broker action handlers (reload, unlog, newSession, delSession, ping)
packages/z-handler/src/init.ts Adds message broker initialization, event loop management, and broker message handling
packages/z-handler/src/index.ts Exports new handler types and shutdown function for cleanup
packages/z-handler/src/handlerOAuth2.ts OAuth2/OIDC handler with Bearer token authentication and OIDC session storage
packages/z-handler/src/handlerAuthBasic.ts HTTP Basic Authentication handler with WWW-Authenticate challenge
packages/z-handler/src/handlerCDA.ts Cross-Domain Authentication handler with encrypted cookie/parameter support
packages/z-handler/src/handlerMain.ts Adds internal session cache and localUnlog for cache cleanup
packages/z-handler/src/cda.ts CDA utilities for encrypted cookies, URL parameters, and cookie headers
packages/z-handler/package.json Version bump, adds JWT and message-broker dependencies, --forceExit flag
packages/types/index.d.ts Adds MessageBroker, CDA, OAuth2, and extended configuration type definitions
packages/session/src/index.ts Adds cache clearing methods (clearMemoryCache, clearLocalCache, clearAllCaches)
packages/0_perl-dbi/src/index.ts Exports parseDbiChain for PostgreSQL broker, improves CommonJS/ESM compatibility
packages/0_jwt/src/index.ts New package with JWT parsing utilities and access token session ID extraction
packages/message-broker/src/index.ts Core message broker interface and type definitions
packages/message-broker-redis/src/index.ts Redis pub/sub broker with Sentinel support
packages/message-broker-pg/src/index.ts PostgreSQL LISTEN/NOTIFY broker implementation
packages/message-broker-web/src/index.ts HTTP polling broker for portal communication
packages/message-broker-nobroker/src/index.ts No-op broker for single-instance mode
Various test files Adds comprehensive tests for new functionality
Various package.json files Version bumps from 0.7.x to 0.8.0 across all packages
Comments suppressed due to low confidence (2)

packages/z-handler/src/handlerAuthBasic.ts:74

  • Unused variable authChoice.
    packages/z-handler/src/handlerAuthBasic.ts:75
  • Unused variable authChoiceParam.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@guimard guimard force-pushed the update-to-2.22 branch 2 times, most recently from 385cc36 to 1d8ab5a Compare December 4, 2025 11:29
Features added:
- Message broker architecture with Redis, PostgreSQL, and Web backends
- OAuth2/OIDC handler for Bearer token authentication
- AuthBasic handler for HTTP Basic authentication
- Cross-Domain Authentication (CDA) handler
@guimard guimard merged commit 7fbc932 into master Dec 4, 2025
6 checks passed
@guimard guimard deleted the update-to-2.22 branch December 4, 2025 15:30
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.

2 participants