chore: import DH V2 D5.6.4 production baseline
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
Param,
|
||||
ParseUUIDPipe,
|
||||
Post,
|
||||
Put,
|
||||
Req,
|
||||
} from '@nestjs/common';
|
||||
import { RequirePermissions } from '../authorization/decorators/require-permissions.decorator';
|
||||
import { CurrentAuth } from '../auth/decorators/current-auth.decorator';
|
||||
import type {
|
||||
AuthPrincipal,
|
||||
RequestWithContext,
|
||||
} from '../common/http/request-context';
|
||||
import { AssetProvenanceService } from './asset-provenance.service';
|
||||
import { UpdateAssetProvenanceDto } from './dto/update-asset-provenance.dto';
|
||||
|
||||
@Controller('assets/:assetId/provenance')
|
||||
export class AssetProvenanceController {
|
||||
constructor(private readonly provenance: AssetProvenanceService) {}
|
||||
|
||||
@Get()
|
||||
@RequirePermissions('assets.read_provenance')
|
||||
get(
|
||||
@Param('assetId', new ParseUUIDPipe({ version: '4' })) assetId: string,
|
||||
) {
|
||||
return this.provenance.get(assetId);
|
||||
}
|
||||
|
||||
@Put()
|
||||
@RequirePermissions('assets.manage_provenance')
|
||||
update(
|
||||
@Param('assetId', new ParseUUIDPipe({ version: '4' })) assetId: string,
|
||||
@Body() dto: UpdateAssetProvenanceDto,
|
||||
@CurrentAuth() principal: AuthPrincipal,
|
||||
@Req() request: RequestWithContext,
|
||||
) {
|
||||
return this.provenance.update(assetId, dto, principal, request);
|
||||
}
|
||||
|
||||
@Post('verify')
|
||||
@RequirePermissions('assets.verify_provenance')
|
||||
verify(
|
||||
@Param('assetId', new ParseUUIDPipe({ version: '4' })) assetId: string,
|
||||
@CurrentAuth() principal: AuthPrincipal,
|
||||
@Req() request: RequestWithContext,
|
||||
) {
|
||||
return this.provenance.verify(assetId, principal, request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user