moto 4.2.7.dev32__py2.py3-none-any.whl → 4.2.8.dev3__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- moto/__init__.py +1 -1
- moto/ses/models.py +5 -1
- moto/ses/responses.py +7 -1
- moto/signer/models.py +27 -12
- moto/signer/responses.py +32 -1
- moto/signer/urls.py +7 -6
- {moto-4.2.7.dev32.dist-info → moto-4.2.8.dev3.dist-info}/METADATA +3 -3
- {moto-4.2.7.dev32.dist-info → moto-4.2.8.dev3.dist-info}/RECORD +13 -13
- {moto-4.2.7.dev32.dist-info → moto-4.2.8.dev3.dist-info}/AUTHORS.md +0 -0
- {moto-4.2.7.dev32.dist-info → moto-4.2.8.dev3.dist-info}/LICENSE +0 -0
- {moto-4.2.7.dev32.dist-info → moto-4.2.8.dev3.dist-info}/WHEEL +0 -0
- {moto-4.2.7.dev32.dist-info → moto-4.2.8.dev3.dist-info}/entry_points.txt +0 -0
- {moto-4.2.7.dev32.dist-info → moto-4.2.8.dev3.dist-info}/top_level.txt +0 -0
moto/__init__.py
CHANGED
moto/ses/models.py
CHANGED
|
@@ -182,7 +182,11 @@ class SESBackend(BaseBackend):
|
|
|
182
182
|
if domain.lower() not in self.domains:
|
|
183
183
|
self.domains.append(domain.lower())
|
|
184
184
|
|
|
185
|
-
def list_identities(self) -> List[str]:
|
|
185
|
+
def list_identities(self, identity_type: str) -> List[str]:
|
|
186
|
+
if identity_type == "Domain":
|
|
187
|
+
return self.domains
|
|
188
|
+
if identity_type == "EmailAddress":
|
|
189
|
+
return self.addresses
|
|
186
190
|
return self.domains + self.addresses
|
|
187
191
|
|
|
188
192
|
def list_verified_email_addresses(self) -> List[str]:
|
moto/ses/responses.py
CHANGED
|
@@ -3,6 +3,7 @@ from typing import Any, Dict, List
|
|
|
3
3
|
|
|
4
4
|
from moto.core.responses import BaseResponse
|
|
5
5
|
from moto.core.utils import utcnow
|
|
6
|
+
from .exceptions import ValidationError
|
|
6
7
|
from .models import ses_backends, SESBackend
|
|
7
8
|
|
|
8
9
|
|
|
@@ -27,7 +28,12 @@ class EmailResponse(BaseResponse):
|
|
|
27
28
|
return template.render()
|
|
28
29
|
|
|
29
30
|
def list_identities(self) -> str:
|
|
30
|
-
|
|
31
|
+
identity_type = self._get_param("IdentityType")
|
|
32
|
+
if identity_type not in [None, "EmailAddress", "Domain"]:
|
|
33
|
+
raise ValidationError(
|
|
34
|
+
f"Value '{identity_type}' at 'identityType' failed to satisfy constraint: Member must satisfy enum value set: [Domain, EmailAddress]"
|
|
35
|
+
)
|
|
36
|
+
identities = self.backend.list_identities(identity_type)
|
|
31
37
|
template = self.response_template(LIST_IDENTITIES_RESPONSE)
|
|
32
38
|
return template.render(identities=identities)
|
|
33
39
|
|
moto/signer/models.py
CHANGED
|
@@ -2,17 +2,17 @@ from typing import Any, Dict, List, Optional
|
|
|
2
2
|
|
|
3
3
|
from moto.core import BaseBackend, BackendDict, BaseModel
|
|
4
4
|
from moto.moto_api._internal import mock_random
|
|
5
|
+
from moto.utilities.tagging_service import TaggingService
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class SigningProfile(BaseModel):
|
|
8
9
|
def __init__(
|
|
9
10
|
self,
|
|
10
|
-
|
|
11
|
-
region: str,
|
|
11
|
+
backend: "SignerBackend",
|
|
12
12
|
name: str,
|
|
13
13
|
platform_id: str,
|
|
14
|
+
signing_material: Dict[str, str],
|
|
14
15
|
signature_validity_period: Optional[Dict[str, Any]],
|
|
15
|
-
tags: Dict[str, str],
|
|
16
16
|
):
|
|
17
17
|
self.name = name
|
|
18
18
|
self.platform_id = platform_id
|
|
@@ -20,12 +20,13 @@ class SigningProfile(BaseModel):
|
|
|
20
20
|
"value": 135,
|
|
21
21
|
"type": "MONTHS",
|
|
22
22
|
}
|
|
23
|
-
self.
|
|
23
|
+
self.backend = backend
|
|
24
24
|
|
|
25
25
|
self.status = "Active"
|
|
26
|
-
self.arn = f"arn:aws:signer:{
|
|
26
|
+
self.arn = f"arn:aws:signer:{backend.region_name}:{backend.account_id}:/signing-profiles/{name}"
|
|
27
27
|
self.profile_version = mock_random.get_random_hex(10)
|
|
28
28
|
self.profile_version_arn = f"{self.arn}/{self.profile_version}"
|
|
29
|
+
self.signing_material = signing_material
|
|
29
30
|
|
|
30
31
|
def cancel(self) -> None:
|
|
31
32
|
self.status = "Canceled"
|
|
@@ -43,7 +44,7 @@ class SigningProfile(BaseModel):
|
|
|
43
44
|
"profileName": self.name,
|
|
44
45
|
"platformId": self.platform_id,
|
|
45
46
|
"signatureValidityPeriod": self.signature_validity_period,
|
|
46
|
-
"signingMaterial":
|
|
47
|
+
"signingMaterial": self.signing_material,
|
|
47
48
|
"platformDisplayName": next(
|
|
48
49
|
(
|
|
49
50
|
p["displayName"]
|
|
@@ -54,8 +55,9 @@ class SigningProfile(BaseModel):
|
|
|
54
55
|
),
|
|
55
56
|
}
|
|
56
57
|
)
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
tags = self.backend.list_tags_for_resource(self.arn)
|
|
59
|
+
if tags:
|
|
60
|
+
small.update({"tags": tags})
|
|
59
61
|
return small
|
|
60
62
|
|
|
61
63
|
|
|
@@ -160,6 +162,7 @@ class SignerBackend(BaseBackend):
|
|
|
160
162
|
def __init__(self, region_name: str, account_id: str):
|
|
161
163
|
super().__init__(region_name, account_id)
|
|
162
164
|
self.signing_profiles: Dict[str, SigningProfile] = dict()
|
|
165
|
+
self.tagger = TaggingService()
|
|
163
166
|
|
|
164
167
|
def cancel_signing_profile(self, profile_name: str) -> None:
|
|
165
168
|
self.signing_profiles[profile_name].cancel()
|
|
@@ -172,20 +175,21 @@ class SignerBackend(BaseBackend):
|
|
|
172
175
|
profile_name: str,
|
|
173
176
|
signature_validity_period: Optional[Dict[str, Any]],
|
|
174
177
|
platform_id: str,
|
|
178
|
+
signing_material: Dict[str, str],
|
|
175
179
|
tags: Dict[str, str],
|
|
176
180
|
) -> SigningProfile:
|
|
177
181
|
"""
|
|
178
|
-
The following parameters are not yet implemented:
|
|
182
|
+
The following parameters are not yet implemented: Overrides, SigningParameters
|
|
179
183
|
"""
|
|
180
184
|
profile = SigningProfile(
|
|
181
|
-
|
|
182
|
-
region=self.region_name,
|
|
185
|
+
backend=self,
|
|
183
186
|
name=profile_name,
|
|
184
187
|
platform_id=platform_id,
|
|
188
|
+
signing_material=signing_material,
|
|
185
189
|
signature_validity_period=signature_validity_period,
|
|
186
|
-
tags=tags,
|
|
187
190
|
)
|
|
188
191
|
self.signing_profiles[profile_name] = profile
|
|
192
|
+
self.tag_resource(profile.arn, tags)
|
|
189
193
|
return profile
|
|
190
194
|
|
|
191
195
|
def list_signing_platforms(self) -> List[Dict[str, Any]]:
|
|
@@ -194,6 +198,17 @@ class SignerBackend(BaseBackend):
|
|
|
194
198
|
"""
|
|
195
199
|
return SignerBackend.platforms
|
|
196
200
|
|
|
201
|
+
def list_tags_for_resource(self, resource_arn: str) -> Dict[str, str]:
|
|
202
|
+
return self.tagger.get_tag_dict_for_resource(resource_arn)
|
|
203
|
+
|
|
204
|
+
def tag_resource(self, resource_arn: str, tags: Dict[str, str]) -> None:
|
|
205
|
+
self.tagger.tag_resource(
|
|
206
|
+
resource_arn, TaggingService.convert_dict_to_tags_input(tags)
|
|
207
|
+
)
|
|
208
|
+
|
|
209
|
+
def untag_resource(self, resource_arn: str, tag_keys: List[str]) -> None:
|
|
210
|
+
self.tagger.untag_resource_using_names(resource_arn, tag_keys)
|
|
211
|
+
|
|
197
212
|
|
|
198
213
|
# Using the lambda-regions
|
|
199
214
|
# boto3.Session().get_available_regions("signer") still returns an empty list
|
moto/signer/responses.py
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"""Handles incoming signer requests, invokes methods, returns responses."""
|
|
2
2
|
import json
|
|
3
|
+
from typing import Any
|
|
4
|
+
from urllib.parse import unquote
|
|
3
5
|
|
|
4
6
|
from moto.core.responses import BaseResponse
|
|
5
7
|
from .models import signer_backends, SignerBackend
|
|
6
8
|
|
|
7
9
|
|
|
8
|
-
class
|
|
10
|
+
class SignerResponse(BaseResponse):
|
|
9
11
|
def __init__(self) -> None:
|
|
10
12
|
super().__init__(service_name="signer")
|
|
11
13
|
|
|
@@ -30,10 +32,12 @@ class signerResponse(BaseResponse):
|
|
|
30
32
|
signature_validity_period = params.get("signatureValidityPeriod")
|
|
31
33
|
platform_id = params.get("platformId")
|
|
32
34
|
tags = params.get("tags")
|
|
35
|
+
signing_material = params.get("signingMaterial")
|
|
33
36
|
profile = self.signer_backend.put_signing_profile(
|
|
34
37
|
profile_name=profile_name,
|
|
35
38
|
signature_validity_period=signature_validity_period,
|
|
36
39
|
platform_id=platform_id,
|
|
40
|
+
signing_material=signing_material,
|
|
37
41
|
tags=tags,
|
|
38
42
|
)
|
|
39
43
|
return json.dumps(profile.to_dict(full=False))
|
|
@@ -41,3 +45,30 @@ class signerResponse(BaseResponse):
|
|
|
41
45
|
def list_signing_platforms(self) -> str:
|
|
42
46
|
platforms = self.signer_backend.list_signing_platforms()
|
|
43
47
|
return json.dumps(dict(platforms=platforms))
|
|
48
|
+
|
|
49
|
+
def list_tags_for_resource(self) -> str:
|
|
50
|
+
resource_arn = unquote(self.path.split("/tags/")[-1])
|
|
51
|
+
return json.dumps(
|
|
52
|
+
{"tags": self.signer_backend.list_tags_for_resource(resource_arn)}
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
def tag_resource(self) -> str:
|
|
56
|
+
resource_arn = unquote(self.path.split("/tags/")[-1])
|
|
57
|
+
tags = self._get_param("tags")
|
|
58
|
+
self.signer_backend.tag_resource(resource_arn, tags)
|
|
59
|
+
return "{}"
|
|
60
|
+
|
|
61
|
+
def untag_resource(self) -> str:
|
|
62
|
+
resource_arn = unquote(self.path.split("/tags/")[-1])
|
|
63
|
+
tag_keys = self.querystring.get("tagKeys")
|
|
64
|
+
self.signer_backend.untag_resource(resource_arn, tag_keys) # type: ignore
|
|
65
|
+
return "{}"
|
|
66
|
+
|
|
67
|
+
def tags(self, request: Any, full_url: str, headers: Any) -> str: # type: ignore[return]
|
|
68
|
+
self.setup_class(request, full_url, headers)
|
|
69
|
+
if request.method == "GET":
|
|
70
|
+
return self.list_tags_for_resource()
|
|
71
|
+
if request.method == "POST":
|
|
72
|
+
return self.tag_resource()
|
|
73
|
+
if request.method == "DELETE":
|
|
74
|
+
return self.untag_resource()
|
moto/signer/urls.py
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"""signer base URL and path."""
|
|
2
|
-
from .responses import
|
|
2
|
+
from .responses import SignerResponse
|
|
3
3
|
|
|
4
4
|
url_bases = [
|
|
5
5
|
r"https?://signer\.(.+)\.amazonaws\.com",
|
|
6
6
|
]
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
response = signerResponse()
|
|
10
|
-
|
|
11
|
-
|
|
12
9
|
url_paths = {
|
|
13
|
-
"{0}/
|
|
14
|
-
"{0}/signing-
|
|
10
|
+
"{0}/tags/(?P<profile_arn>[^/]+)$": SignerResponse.dispatch,
|
|
11
|
+
"{0}/tags/(?P<arn_prefix>[^/]+)/signing-profiles/(?P<profile_name>[^/]+)$": SignerResponse.method_dispatch(
|
|
12
|
+
SignerResponse.tags # type: ignore
|
|
13
|
+
),
|
|
14
|
+
"{0}/signing-profiles/(?P<profile_name>[^/]+)$": SignerResponse.dispatch,
|
|
15
|
+
"{0}/signing-platforms$": SignerResponse.dispatch,
|
|
15
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: moto
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.8.dev3
|
|
4
4
|
Home-page: https://github.com/getmoto/moto
|
|
5
5
|
Author: Steve Pulec
|
|
6
6
|
Author-email: "spulec@gmail.com"
|
|
@@ -304,7 +304,7 @@ def test_my_model_save():
|
|
|
304
304
|
assert body == "is awesome"
|
|
305
305
|
```
|
|
306
306
|
|
|
307
|
-
With the decorator wrapping the test, all the calls to s3 are automatically mocked out. The mock keeps the state of the buckets and keys.
|
|
307
|
+
With the decorator wrapping the test, all the calls to s3 are automatically mocked out. The mock keeps track of the state of the buckets and keys.
|
|
308
308
|
|
|
309
309
|
For a full list of which services and features are covered, please see our [implementation coverage](https://github.com/getmoto/moto/blob/master/IMPLEMENTATION_COVERAGE.md).
|
|
310
310
|
|
|
@@ -316,7 +316,7 @@ The full documentation can be found here:
|
|
|
316
316
|
|
|
317
317
|
|
|
318
318
|
### Financial Contributions
|
|
319
|
-
Support this project and continued development, by sponsoring us!
|
|
319
|
+
Support this project and its continued development, by sponsoring us!
|
|
320
320
|
|
|
321
321
|
Click the `Sponsor`-button at the top of the page for more information.
|
|
322
322
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
moto/__init__.py,sha256=
|
|
1
|
+
moto/__init__.py,sha256=AtsO80qdHP78QhPO-ffXJsE_5sY2FUvaGmgyKMYS0Iw,9736
|
|
2
2
|
moto/backend_index.py,sha256=LvyWuvNURVUzNmMxRpCbL8AOb2Gaux-k5y1d8Ht4qH8,10853
|
|
3
3
|
moto/backends.py,sha256=rC9WUMUUWmVmX7ZEfXpVKAQAw6oI8qYobCEPxP2Zv9U,1805
|
|
4
4
|
moto/proxy.py,sha256=G1eDJn7_VBPymkqMcREfMDforRDRYkEWI2-3H3MBvrc,3113
|
|
@@ -888,8 +888,8 @@ moto/servicequotas/resources/default_quotas/vpc.py,sha256=P6NE0p43tqEEl713g6F6p_
|
|
|
888
888
|
moto/ses/__init__.py,sha256=cUg6jlwiNv_pDXfKLynZgQgOiB2ga-SeQblaAPQ0_4Q,115
|
|
889
889
|
moto/ses/exceptions.py,sha256=wLFjK-hG347szIo9vvOQmMBMFlTzj13YWhEw3HGC5wU,2364
|
|
890
890
|
moto/ses/feedback.py,sha256=35e9iaIjtG9Kt3TgZgC-2ewGOlryp2Qy1joIxGFtTaM,2424
|
|
891
|
-
moto/ses/models.py,sha256=
|
|
892
|
-
moto/ses/responses.py,sha256=
|
|
891
|
+
moto/ses/models.py,sha256=ZTCXwXiCG7H3KyESV8uwkVWZu2V5OqhB_hnppTa1Kvc,23670
|
|
892
|
+
moto/ses/responses.py,sha256=7f2lfpUMuOj8uAbblKliyVqZNUh5JygcMGh6-x_F8zM,33386
|
|
893
893
|
moto/ses/template.py,sha256=SPB4omirJpNVwxyU70Ixk9rDiSVoRWcwQrkFi_cYGh4,6147
|
|
894
894
|
moto/ses/urls.py,sha256=Pyb4WPSbX42HDTzV1tBGGctaIQdZudD42P5UUkRn3jg,189
|
|
895
895
|
moto/ses/utils.py,sha256=Na9Swj2pmbWR4O2xPQ51orksaeDxCd07ZIkCM0kT5n4,648
|
|
@@ -900,9 +900,9 @@ moto/sesv2/responses.py,sha256=HMEbHxTLyMVUsyB6xYicYAj1gbyNbmkLyW27Yi0w8Ys,4245
|
|
|
900
900
|
moto/sesv2/urls.py,sha256=7rQa-Zm1ItCdCHyXbirYLSwPwqqDW_hbQ8_eKXByMMY,569
|
|
901
901
|
moto/signer/__init__.py,sha256=ybpTQwvBIYd6UKDK0VuFwr0QnKcG3tvm4j8ciAJL_z0,191
|
|
902
902
|
moto/signer/exceptions.py,sha256=itpR-x9UvMREeBgujdENBVa2YMWM22_wDv9U87sBQMo,47
|
|
903
|
-
moto/signer/models.py,sha256=
|
|
904
|
-
moto/signer/responses.py,sha256=
|
|
905
|
-
moto/signer/urls.py,sha256=
|
|
903
|
+
moto/signer/models.py,sha256=NRLJX4UevMQdaEEZscWtk09I12dM9Ek1RmC_O3Xgwm8,7747
|
|
904
|
+
moto/signer/responses.py,sha256=70GmPa1FIoE4kV-RIrCoNBuvtbV2y8dtNBB1wcA4uSQ,2890
|
|
905
|
+
moto/signer/urls.py,sha256=cvMkrfFGQ6HWsSrJASFK1ai0zuLpgLgGJOYTy9nrFL0,512
|
|
906
906
|
moto/sns/__init__.py,sha256=CpOkt-MeQp-ZskG1wkpPLNrdyn_RbwsfMf0MURELycw,115
|
|
907
907
|
moto/sns/exceptions.py,sha256=71EJlm9xdg67v8ZSf7Cy1hMbCQDE7gNYB5Wj06Oa7Dg,2271
|
|
908
908
|
moto/sns/models.py,sha256=gqnvOCjJeFZ3WVhveSKgfgOA9DugHfdyR-JDVnahQ7M,43968
|
|
@@ -1054,10 +1054,10 @@ moto/xray/mock_client.py,sha256=nYl8JVJbl3OY-tnUafkVOG4K4-cFm5bsft3Hxo7fKwI,3809
|
|
|
1054
1054
|
moto/xray/models.py,sha256=0QL6nmhpVVwAiyi9aw4pBwVTRhqPW9oIy2uwPDhPKug,11179
|
|
1055
1055
|
moto/xray/responses.py,sha256=p2xsg2-P9h_1DCyuBC7GenmC5L64tXAX6a-XCb2j5-o,6316
|
|
1056
1056
|
moto/xray/urls.py,sha256=R6T3gMwobWipukWcC1DQ36CU1Rjt6oqBDoe-7HqaIZU,393
|
|
1057
|
-
moto-4.2.
|
|
1058
|
-
moto-4.2.
|
|
1059
|
-
moto-4.2.
|
|
1060
|
-
moto-4.2.
|
|
1061
|
-
moto-4.2.
|
|
1062
|
-
moto-4.2.
|
|
1063
|
-
moto-4.2.
|
|
1057
|
+
moto-4.2.8.dev3.dist-info/AUTHORS.md,sha256=dDUhasV8HGSkzb7zj7a0b3alnqY0P1LPOyOUNoo8Mpo,2976
|
|
1058
|
+
moto-4.2.8.dev3.dist-info/LICENSE,sha256=8S75_TlqE-kIeGMLG0-rRxxu2ct6SM8quyUWKBYyIY4,10834
|
|
1059
|
+
moto-4.2.8.dev3.dist-info/METADATA,sha256=nIg_3p1q7hjppvucLmP1bLFdVrTJuE7VUODBFVDl1Ok,12926
|
|
1060
|
+
moto-4.2.8.dev3.dist-info/WHEEL,sha256=iYlv5fX357PQyRT2o6tw1bN-YcKFFHKqB_LwHO5wP-g,110
|
|
1061
|
+
moto-4.2.8.dev3.dist-info/entry_points.txt,sha256=QWCojULQb54Hi_2KamEEYHA6Cwek_vN685aS8DbI9rU,78
|
|
1062
|
+
moto-4.2.8.dev3.dist-info/top_level.txt,sha256=TETRKAPcAAvoZDkSkwQiZtTSr-1gzaEAXVm9FmZKj8s,5
|
|
1063
|
+
moto-4.2.8.dev3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|