Skip to content

Commit 2be4c37

Browse files
committed
Payment Cryptography: add control plane support
1 parent 55e2fbc commit 2be4c37

11 files changed

Lines changed: 1227 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
.. _implementedservice_payment-cryptography:
2+
3+
====================
4+
payment-cryptography
5+
====================
6+
7+
.. autoclass:: moto.paymentcryptography.models.PaymentCryptographyControlPlaneBackend
8+
9+
Implemented features
10+
--------------------
11+
12+
- [X] add_key_replication_regions
13+
- [X] associate_mpa_team
14+
- [X] create_alias
15+
- [X] create_key
16+
- [X] delete_alias
17+
- [X] delete_key
18+
- [X] delete_resource_policy
19+
- [X] disable_default_key_replication_regions
20+
- [X] disassociate_mpa_team
21+
- [X] enable_default_key_replication_regions
22+
- [X] export_key
23+
- [X] get_alias
24+
- [X] get_certificate_signing_request
25+
- [X] get_default_key_replication_regions
26+
- [X] get_key
27+
- [X] get_mpa_team_association
28+
- [X] get_parameters_for_export
29+
- [X] get_parameters_for_import
30+
- [X] get_public_key_certificate
31+
- [X] get_resource_policy
32+
- [X] import_key
33+
- [X] list_aliases
34+
- [X] list_keys
35+
- [X] list_tags_for_resource
36+
- [X] put_resource_policy
37+
- [X] remove_key_replication_regions
38+
- [X] restore_key
39+
- [X] start_key_usage
40+
- [X] stop_key_usage
41+
- [X] tag_resource
42+
- [X] untag_resource
43+
- [X] update_alias
44+
45+
The control plane stores key material only to preserve coherent state for future
46+
data-plane support. Import and export responses are suitable for mocked workflows;
47+
they do not emulate an AWS hardware security module or provide TR-31/TR-34
48+
interoperability guarantees.

moto/backend_index.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@
168168
("opensearchserverless", re.compile("https?://aoss\\.(.+)\\.amazonaws\\.com")),
169169
("organizations", re.compile("https?://organizations\\.(.+)\\.amazonaws\\.com")),
170170
("osis", re.compile("https?://osis\\.(.+)\\.amazonaws\\.com")),
171+
(
172+
"paymentcryptography",
173+
re.compile(
174+
"https?://controlplane\\.payment-cryptography\\.(.+)\\.amazonaws\\.com"
175+
),
176+
),
171177
("personalize", re.compile("https?://personalize\\.(.+)\\.amazonaws\\.com")),
172178
("pinpoint", re.compile("https?://pinpoint\\.(.+)\\.amazonaws\\.com")),
173179
("pipes", re.compile("https?://pipes\\.(.+)\\.amazonaws\\.com")),

moto/moto_server/werkzeug_app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"execute-api": "iot",
5050
"iotdata": "data.iot",
5151
"mobiletargeting": "pinpoint",
52+
"payment-cryptography": "controlplane.payment-cryptography",
5253
}
5354

5455
# Some services are only recognizable by the version
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .models import paymentcryptography_backends # noqa: F401
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
from moto.core.exceptions import JsonRESTError
2+
3+
4+
class PaymentCryptographyError(JsonRESTError):
5+
code = 400
6+
7+
def __init__(self, error_type: str, message: str):
8+
super().__init__(error_type, message)
9+
10+
11+
class ConflictException(PaymentCryptographyError):
12+
code = 409
13+
14+
def __init__(self, message: str):
15+
super().__init__("ConflictException", message)
16+
17+
18+
class ResourceNotFoundException(PaymentCryptographyError):
19+
code = 404
20+
21+
def __init__(self, message: str):
22+
super().__init__("ResourceNotFoundException", message)
23+
24+
25+
class ValidationException(PaymentCryptographyError):
26+
def __init__(self, message: str):
27+
super().__init__("ValidationException", message)

0 commit comments

Comments
 (0)