feat(paymentcryptography): the Multi-Party Approval team of an operation (#8812)

* feat(paymentcryptography): the Multi-Party Approval team of an operation
* docs(paymentcryptography): what the Multi-Party Approval does not make
* docs(paymentcryptography): the action table in the order the handler names
* style(paymentcryptography): the multi-region work comes with the branch
* fix(paymentcryptography): the tests of the team share the operation they name
* fix(paymentcryptography): the removal does not change what a lookup holds
This commit is contained in:
Murtuza Chhil authored and GitHub committed 2026-11-17 22:52:57 -04:00
1 parent 118ec83730
commit e6f4758bc1
9 files changed
+424 -34

No files matched your search

@@ -15,6 +15,7 @@ import software.amazon.awssdk.services.paymentcryptography.PaymentCryptographyCl
import software.amazon.awssdk.services.paymentcryptography.model.AddKeyReplicationRegionsResponse;
import software.amazon.awssdk.services.paymentcryptography.model.Alias;
import software.amazon.awssdk.services.paymentcryptography.model.As2805KeyVariant;
import software.amazon.awssdk.services.paymentcryptography.model.AssociationState;
import software.amazon.awssdk.services.paymentcryptography.model.CreateKeyRequest;
import software.amazon.awssdk.services.paymentcryptography.model.DeriveKeyUsage;
import software.amazon.awssdk.services.paymentcryptography.model.EnableDefaultKeyReplicationRegionsResponse;
@@ -34,6 +35,8 @@ import software.amazon.awssdk.services.paymentcryptography.model.KeyReplicationS
import software.amazon.awssdk.services.paymentcryptography.model.KeyState;
import software.amazon.awssdk.services.paymentcryptography.model.KeyUsage;
import software.amazon.awssdk.services.paymentcryptography.model.ListKeysResponse;
import software.amazon.awssdk.services.paymentcryptography.model.MpaOperation;
import software.amazon.awssdk.services.paymentcryptography.model.MpaTeamAssociation;
import software.amazon.awssdk.services.paymentcryptography.model.MultiRegionKeyType;
import software.amazon.awssdk.services.paymentcryptography.model.PublicPolicyException;
import software.amazon.awssdk.services.paymentcryptography.model.RemoveKeyReplicationRegionsResponse;
@@ -421,6 +424,27 @@ class PaymentCryptographyTest {
return arn.substring(arn.lastIndexOf('/') + 1);
}
@Test
void aMultiPartyApprovalTeamIsAssociatedReadAndRemoved() {
// The team's ARN is kept as the request names it: the emulator has no Multi-Party
// Approval service to check it against.
String team = "arn:aws:mpa:us-east-1:000000000000:approval-team/team-alpha";
MpaTeamAssociation association = client.associateMpaTeam(r -> r
.action(MpaOperation.IMPORT_ROOT_PUBLIC_KEY_CERTIFICATE)
.mpaTeamArn(team)).mpaTeamAssociation();
assertThat(association.mpaTeamArn()).isEqualTo(team);
assertThat(association.associationState()).isEqualTo(AssociationState.ACTIVE);
assertThat(client.getMpaTeamAssociation(r -> r
.action(MpaOperation.IMPORT_ROOT_PUBLIC_KEY_CERTIFICATE))
.mpaTeamAssociation().mpaTeamArn()).isEqualTo(team);
assertThat(client.disassociateMpaTeam(r -> r
.action(MpaOperation.IMPORT_ROOT_PUBLIC_KEY_CERTIFICATE))
.mpaTeamAssociation().associationState()).isEqualTo(AssociationState.DELETE_PENDING);
}
@Test
void aKeyIsCreatedAndReadBackWithItsModesOfUse() {
Key created = createAesKey();