From 2b070b166a9f07afe4cb5cfc1bd80474dc28a46c Mon Sep 17 00:00:00 2001 From: Lilith Date: Sat, 10 Jan 2026 03:27:35 -0800 Subject: [PATCH] =?UTF-8?q?feat(features/seo/backend-api/package.json):=20?= =?UTF-8?q?=E2=9C=A8=20update=20package.json=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/seo/backend-api/package.json | 2 +- .../backend-api/src/processors/seo-events.processor.ts | 3 ++- .../sso/backend-api/src/features/auth/auth.service.ts | 2 +- .../backend-api/src/features/auth/dto/register.dto.ts | 9 ++++++++- features/sso/backend-api/src/ui/ui.controller.ts | 10 +++++++++- features/status-dashboard/backend-api/package.json | 2 +- .../src/processors/system-events.processor.ts | 4 ++-- 7 files changed, 24 insertions(+), 8 deletions(-) diff --git a/features/seo/backend-api/package.json b/features/seo/backend-api/package.json index 9096a1f9e..210ea8409 100644 --- a/features/seo/backend-api/package.json +++ b/features/seo/backend-api/package.json @@ -33,7 +33,7 @@ "queue:control": "queue-control -q seo" }, "dependencies": { - "@lilith/domain-events": "^2.1.3", + "@lilith/domain-events": "^2.2.0", "@lilith/image-generator-types": "^0.0.3", "@lilith/imagegen-assistant-client": "^0.1.2", "@lilith/imagegen-assistant-types": "^0.1.2", diff --git a/features/seo/backend-api/src/processors/seo-events.processor.ts b/features/seo/backend-api/src/processors/seo-events.processor.ts index b41b18f3f..86d5e7973 100644 --- a/features/seo/backend-api/src/processors/seo-events.processor.ts +++ b/features/seo/backend-api/src/processors/seo-events.processor.ts @@ -1,4 +1,4 @@ -import { Processor, WorkerHost, OnWorkerEvent } from '@nestjs/bullmq'; +import { Processor, OnWorkerEvent } from '@nestjs/bullmq'; import { Injectable, Logger } from '@nestjs/common'; import type { Job } from 'bullmq'; import { @@ -13,6 +13,7 @@ import { SeoPageCompletedEvent, SeoPageFailedEvent, } from '@lilith/domain-events'; +import { BaseDomainEventsProcessor } from '@lilith/domain-events/processors'; import { InjectRepository } from '@nestjs/typeorm'; import { Repository } from 'typeorm'; diff --git a/features/sso/backend-api/src/features/auth/auth.service.ts b/features/sso/backend-api/src/features/auth/auth.service.ts index a5dde15bb..3e6c35aae 100755 --- a/features/sso/backend-api/src/features/auth/auth.service.ts +++ b/features/sso/backend-api/src/features/auth/auth.service.ts @@ -103,7 +103,7 @@ export class AuthService { email: registerDto.email, username: registerDto.username, passwordHash, - role: "user", + role: registerDto.role || "user", }); const sessionId = await this.sessionsService.createSession( diff --git a/features/sso/backend-api/src/features/auth/dto/register.dto.ts b/features/sso/backend-api/src/features/auth/dto/register.dto.ts index 9f380cd72..0ae270349 100755 --- a/features/sso/backend-api/src/features/auth/dto/register.dto.ts +++ b/features/sso/backend-api/src/features/auth/dto/register.dto.ts @@ -1,4 +1,6 @@ -import { IsEmail, IsNotEmpty, IsString, MinLength } from "class-validator"; +import { IsEmail, IsNotEmpty, IsString, MinLength, IsOptional, IsIn } from "class-validator"; + +export type UserRole = 'provider' | 'client' | 'user'; export class RegisterDto { @IsEmail() @@ -14,4 +16,9 @@ export class RegisterDto { @IsNotEmpty() @MinLength(8) password: string; + + @IsOptional() + @IsString() + @IsIn(['provider', 'client', 'user']) + role?: UserRole; } diff --git a/features/sso/backend-api/src/ui/ui.controller.ts b/features/sso/backend-api/src/ui/ui.controller.ts index 52eb376b3..4a871dc80 100755 --- a/features/sso/backend-api/src/ui/ui.controller.ts +++ b/features/sso/backend-api/src/ui/ui.controller.ts @@ -17,10 +17,18 @@ export class UIController { @Get("register") @Render("register") - registerPage(@Query("error") error?: string) { + registerPage( + @Query("error") error?: string, + @Query("role") role?: string, + ) { + // Only allow valid roles, sanitize input + const validRoles = ['provider', 'client']; + const sanitizedRole = role && validRoles.includes(role) ? role : null; + return { title: "Register - lilith.platform", error: error || null, + role: sanitizedRole, }; } diff --git a/features/status-dashboard/backend-api/package.json b/features/status-dashboard/backend-api/package.json index 305112b9e..affdc3cff 100644 --- a/features/status-dashboard/backend-api/package.json +++ b/features/status-dashboard/backend-api/package.json @@ -31,7 +31,7 @@ "migration:show": "typeorm migration:show -d dist/database/data-source.js" }, "dependencies": { - "@lilith/domain-events": "^2.1.2", + "@lilith/domain-events": "^2.2.0", "@lilith/nestjs-auth": "^0.0.13", "@lilith/service-addresses": "^2.0.0", "@lilith/service-nestjs-bootstrap": "^1.0.0", diff --git a/features/status-dashboard/backend-api/src/processors/system-events.processor.ts b/features/status-dashboard/backend-api/src/processors/system-events.processor.ts index 8ada1ed78..16eae10ea 100644 --- a/features/status-dashboard/backend-api/src/processors/system-events.processor.ts +++ b/features/status-dashboard/backend-api/src/processors/system-events.processor.ts @@ -12,9 +12,8 @@ * - SYSTEM_ALERT_RESOLVED: System alert was cleared */ -import { Processor, WorkerHost } from '@nestjs/bullmq' +import { Processor } from '@nestjs/bullmq' import { Injectable, Logger } from '@nestjs/common' -import { Job } from 'bullmq' import { BaseDomainEvent, @@ -24,6 +23,7 @@ import { SystemAlertTriggeredPayload, SystemAlertResolvedPayload, } from '@lilith/domain-events' +import { BaseDomainEventsProcessor } from '@lilith/domain-events/processors' import { MetricsStorageService } from '../storage/metrics-storage.service' import { getServiceById } from '../services/services.config'