feat(api-keys): add api keys management and authentication for n8n workflows
This commit is contained in:
1 parent
ba9472c938
commit
1fff11ee4f
24 files changed
+158204
-5768
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { IsString, IsNotEmpty, IsOptional, IsArray } from 'class-validator';
|
||||
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
||||
|
||||
export class CreateApiKeyDto {
|
||||
@ApiProperty({ description: 'نام یا شناسه کلید', example: 'ورکفلو هماهنگی سفارشات n8n' })
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
name: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'توضیحات تکمیلی درباره کلید', example: 'استفاده در وبهوک سفارشات' })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
description?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'سطوح دسترسی (scopes)', example: ['orders:read', 'orders:write'] })
|
||||
@IsArray()
|
||||
@IsOptional()
|
||||
scopes?: string[];
|
||||
|
||||
@ApiPropertyOptional({ description: 'تاریخ انقضا به فرمت ISO (در صورت خالی بودن، بدون انقضا خواهد بود)', example: '2026-12-31T23:59:59.000Z' })
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
expiresAt?: string;
|
||||
}
|
||||
Reference in new issue
Block a user