24 lines
694 B
TypeScript
24 lines
694 B
TypeScript
import { Injectable } from "@nestjs/common";
|
|
import * as Joi from "joi";
|
|
|
|
import { AbstractActionHandler, AwsProperties, Format } from "../abstract-action.handler";
|
|
import { Action } from "../action.enum";
|
|
|
|
type QueryParams = {}
|
|
|
|
@Injectable()
|
|
export class GetCallerIdentityHandler extends AbstractActionHandler<QueryParams> {
|
|
|
|
format = Format.Xml;
|
|
action = Action.StsGetCallerIdentity;
|
|
validator = Joi.object<QueryParams, true>();
|
|
|
|
protected async handle(queryParams: QueryParams, awsProperties: AwsProperties) {
|
|
return {
|
|
"UserId": "AIDASAMPLEUSERID",
|
|
"Account": awsProperties.accountId,
|
|
"Arn": `arn:aws:iam::${awsProperties.accountId}:user/DevAdmin`
|
|
}
|
|
}
|
|
}
|