2026-04-15-1 dashboard

This commit is contained in:
Hamza-Ayed
2026-04-15 01:05:15 +03:00
parent 50573eb9d3
commit 3802af0651
38 changed files with 4871 additions and 18 deletions
+36
View File
@@ -0,0 +1,36 @@
import { Controller, Get, Post, Body, Param } from '@nestjs/common';
import { AuthService } from './auth.service';
import { CreateKeyDto } from './dto/management/create-key.dto';
import { ApiTags, ApiOperation } from '@nestjs/swagger';
@ApiTags('auth')
@Controller('auth/management')
export class TenantController {
constructor(private readonly authService: AuthService) {}
@Get('keys/:tenantId')
@ApiOperation({ summary: 'Get all API keys for a tenant' })
async getKeys(@Param('tenantId') tenantId: string) {
return this.authService.getApiKeys(tenantId);
}
@Post('keys/:tenantId')
@ApiOperation({ summary: 'Create a new API key' })
async createKey(
@Param('tenantId') tenantId: string,
@Body() dto: CreateKeyDto
) {
return this.authService.createApiKey(
tenantId,
dto.name,
dto.rateLimit,
dto.allowedOrigins
);
}
@Get('me')
@ApiOperation({ summary: 'Identify the default tenant (Demo Only)' })
async getMe() {
return this.authService.getDefaultTenant();
}
}