Skip to content

auth-server

@mmm/auth-server

NestJS-Serverpaket der Auth-Domain.

Verantwortung

  • serverseitige Auth-Kernlogik
  • Guards, Decorators und Interceptors für Auth
  • Password-Authentifizierung
  • OAuth-Authentifizierung
  • OIDC-spezifische Verifikation

Struktur

  • src/lib/server/core Guard, Controller, Decorators, Rolling-Token-Logik, Basiskonfiguration
  • src/lib/server/password Password-spezifische Module, Validator-Verträge und Login-Endpunkt
  • src/lib/server/oauth OAuth-spezifische Module, Service, Provider-Adapter und Callback-Flow
  • src/lib/server/oidc OIDC-spezifische Guard- und JWKS-Themen

Architekturgrenzen

  • darf @mmm/auth-contracts verwenden
  • darf keine Angular-spezifischen Typen oder Implementierungen enthalten
  • core bleibt providerneutral
  • password, oauth und oidc dürfen auf core aufbauen, aber nicht umgekehrt

Öffentliche API

  • @mmm/auth/server
  • @mmm/auth/server/core
  • @mmm/auth/server/password
  • @mmm/auth/server/oauth
  • @mmm/auth/server/oidc

Beispiel

import { AuthServerModule } from "@mmm/auth/server";
AuthServerModule.forRoot({
jwt: { secret: process.env.JWT_SECRET! },
core: {
resolver: authUserResolver,
},
password: {
validator: passwordValidator,
},
});

Build

Terminal window
pnpm --dir backend run build