This commit is contained in:
2026-01-20 13:53:03 -05:00
parent 7532fd38cb
commit ae9ec078d3
69 changed files with 7031 additions and 409 deletions

View File

@@ -0,0 +1,34 @@
import { Injectable } from '@nestjs/common';
import * as Joi from 'joi';
import { AbstractActionHandler, Format } from '../abstract-action.handler';
import { Action } from '../action.enum';
import { RequestContext } from '../_context/request.context';
import { S3Service } from './s3.service';
type QueryParams = {
Bucket: string;
};
@Injectable()
export class GetBucketAclHandler extends AbstractActionHandler<QueryParams> {
constructor(private readonly s3Service: S3Service) {
super();
}
format = Format.Xml;
action = Action.S3GetBucketAcl;
validator = Joi.object<QueryParams, true>({
Bucket: Joi.string().required(),
});
protected async handle({ Bucket }: QueryParams, { awsProperties }: RequestContext) {
const acl = await this.s3Service.getBucketAcl(Bucket);
return {
Owner: acl.Owner,
AccessControlList: {
Grant: acl.Grants.length > 0 ? acl.Grants : undefined,
},
};
}
}