feat: mark presigned download URL endpoint as public.
This commit is contained in:
@@ -26,6 +26,7 @@ import { JwtAuthGuard } from '../auth/guards/jwt-auth.guard';
|
|||||||
import { RolesGuard } from '../auth/guards/roles.guard';
|
import { RolesGuard } from '../auth/guards/roles.guard';
|
||||||
import { Roles } from '../auth/decorators/roles.decorator';
|
import { Roles } from '../auth/decorators/roles.decorator';
|
||||||
import { CurrentUser } from '../auth/decorators/current-user.decorator';
|
import { CurrentUser } from '../auth/decorators/current-user.decorator';
|
||||||
|
import { Public } from '../auth/decorators/public.decorator';
|
||||||
import { UserRole } from '@prisma/client';
|
import { UserRole } from '@prisma/client';
|
||||||
import { PrismaService } from '../prisma/prisma.service';
|
import { PrismaService } from '../prisma/prisma.service';
|
||||||
|
|
||||||
@@ -142,6 +143,7 @@ export class UploadController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Get('presigned-download-url')
|
@Get('presigned-download-url')
|
||||||
|
@Public()
|
||||||
@ApiOperation({ summary: 'Get a presigned download URL for an S3 key (public endpoint)' })
|
@ApiOperation({ summary: 'Get a presigned download URL for an S3 key (public endpoint)' })
|
||||||
@ApiQuery({ name: 'key', required: true, description: 'S3 key (e.g., avatars/uuid.png)' })
|
@ApiQuery({ name: 'key', required: true, description: 'S3 key (e.g., avatars/uuid.png)' })
|
||||||
@ApiResponse({ status: 200, description: 'Presigned URL returned successfully' })
|
@ApiResponse({ status: 200, description: 'Presigned URL returned successfully' })
|
||||||
@@ -161,4 +163,5 @@ export class UploadController {
|
|||||||
throw new NotFoundException('File not found');
|
throw new NotFoundException('File not found');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user