addProfilePermission method

Future<AddProfilePermissionResponse> addProfilePermission({
  1. required String action,
  2. required String principal,
  3. required String profileName,
  4. required String statementId,
  5. String? profileVersion,
  6. String? revisionId,
})

Adds cross-account permissions to a signing profile.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServiceErrorException. May throw ResourceNotFoundException. May throw ServiceLimitExceededException. May throw TooManyRequestsException. May throw ValidationException.

Parameter action : For cross-account signing. Grant a designated account permission to perform one or more of the following actions. Each action is associated with a specific API's operations. For more information about cross-account signing, see Using cross-account signing with signing profiles in the AWS Signer Developer Guide.

You can designate the following actions to an account.

  • signer:StartSigningJob. This action isn't supported for container image workflows. For details, see StartSigningJob.
  • signer:SignPayload. This action isn't supported for AWS Lambda workflows. For details, see SignPayload
  • signer:GetSigningProfile. For details, see GetSigningProfile.
  • signer:RevokeSignature. For details, see RevokeSignature.

Parameter principal : The AWS principal receiving cross-account permissions. This may be an IAM role or another AWS account ID.

Parameter profileName : The human-readable name of the signing profile.

Parameter statementId : A unique identifier for the cross-account permission statement.

Parameter profileVersion : The version of the signing profile.

Parameter revisionId : A unique identifier for the current profile revision.

Implementation

Future<AddProfilePermissionResponse> addProfilePermission({
  required String action,
  required String principal,
  required String profileName,
  required String statementId,
  String? profileVersion,
  String? revisionId,
}) async {
  final $payload = <String, dynamic>{
    'action': action,
    'principal': principal,
    'statementId': statementId,
    if (profileVersion != null) 'profileVersion': profileVersion,
    if (revisionId != null) 'revisionId': revisionId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/signing-profiles/${Uri.encodeComponent(profileName)}/permissions',
    exceptionFnMap: _exceptionFns,
  );
  return AddProfilePermissionResponse.fromJson(response);
}