moto 4.2.1.dev4__py2.py3-none-any.whl → 4.2.1.dev7__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 CHANGED
@@ -210,7 +210,7 @@ mock_all = MockAll
210
210
  # logging.getLogger('boto').setLevel(logging.CRITICAL)
211
211
 
212
212
  __title__ = "moto"
213
- __version__ = "4.2.1.dev4"
213
+ __version__ = "4.2.1.dev7"
214
214
 
215
215
 
216
216
  try:
moto/backend_index.py CHANGED
@@ -1,4 +1,4 @@
1
- # autogenerated by scripts/update_backend_index.py
1
+ # autogenerated by /Users/plussier/dev/github/moto/scripts/update_backend_index.py
2
2
  import re
3
3
 
4
4
  backend_url_patterns = [
@@ -114,7 +114,7 @@ backend_url_patterns = [
114
114
  ),
115
115
  (
116
116
  "meteringmarketplace",
117
- re.compile("https?://metering\\.marketplace.(.+).amazonaws.com"),
117
+ re.compile("https?://metering.marketplace.(.+).amazonaws.com"),
118
118
  ),
119
119
  ("meteringmarketplace", re.compile("https?://aws-marketplace.(.+).amazonaws.com")),
120
120
  ("mq", re.compile("https?://mq\\.(.+)\\.amazonaws\\.com")),
moto/cognitoidp/models.py CHANGED
@@ -1705,6 +1705,25 @@ class CognitoIdpBackend(BaseBackend):
1705
1705
  user_pool.resource_servers[identifier] = resource_server
1706
1706
  return resource_server
1707
1707
 
1708
+ def describe_resource_server(
1709
+ self, user_pool_id: str, identifier: str
1710
+ ) -> CognitoResourceServer:
1711
+ user_pool = self.user_pools.get(user_pool_id)
1712
+ if not user_pool:
1713
+ raise ResourceNotFoundError(f"User pool {user_pool_id} does not exist.")
1714
+
1715
+ resource_server = user_pool.resource_servers.get(identifier)
1716
+ if not resource_server:
1717
+ raise ResourceNotFoundError(f"Resource server {identifier} does not exist.")
1718
+
1719
+ return resource_server
1720
+
1721
+ @paginate(pagination_model=PAGINATION_MODEL) # type: ignore[misc]
1722
+ def list_resource_servers(self, user_pool_id: str) -> List[CognitoResourceServer]:
1723
+ user_pool = self.user_pools[user_pool_id]
1724
+ resource_servers = list(user_pool.resource_servers.values())
1725
+ return resource_servers
1726
+
1708
1727
  def sign_up(
1709
1728
  self,
1710
1729
  client_id: str,
@@ -534,6 +534,30 @@ class CognitoIdpResponse(BaseResponse):
534
534
  )
535
535
  return json.dumps({"ResourceServer": resource_server.to_json()})
536
536
 
537
+ def describe_resource_server(self) -> str:
538
+ user_pool_id = self._get_param("UserPoolId")
539
+ identifier = self._get_param("Identifier")
540
+ resource_server = self.backend.describe_resource_server(
541
+ user_pool_id, identifier
542
+ )
543
+ return json.dumps({"ResourceServer": resource_server.to_json()})
544
+
545
+ def list_resource_servers(self) -> str:
546
+ max_results = self._get_param("MaxResults")
547
+ next_token = self._get_param("NextToken")
548
+ user_pool_id = self._get_param("UserPoolId")
549
+ resource_servers, next_token = self.backend.list_resource_servers(
550
+ user_pool_id, max_results=max_results, next_token=next_token
551
+ )
552
+ response: Dict[str, Any] = {
553
+ "ResourceServers": [
554
+ resource_server.to_json() for resource_server in resource_servers
555
+ ]
556
+ }
557
+ if next_token:
558
+ response["NextToken"] = str(next_token)
559
+ return json.dumps(response)
560
+
537
561
  def sign_up(self) -> str:
538
562
  client_id = self._get_param("ClientId")
539
563
  username = self._get_param("Username")
moto/cognitoidp/utils.py CHANGED
@@ -49,6 +49,12 @@ PAGINATION_MODEL = {
49
49
  "limit_default": 60,
50
50
  "unique_attribute": "id",
51
51
  },
52
+ "list_resource_servers": {
53
+ "input_token": "next_token",
54
+ "limit_key": "max_results",
55
+ "limit_default": 60,
56
+ "unique_attribute": "identifier",
57
+ },
52
58
  }
53
59
 
54
60
 
moto/logs/models.py CHANGED
@@ -898,7 +898,7 @@ class LogsBackend(BaseBackend):
898
898
  ) -> Tuple[List[Dict[str, Any]], Optional[str], Optional[str]]:
899
899
  if log_group_name not in self.groups:
900
900
  raise ResourceNotFoundException()
901
- if limit and limit > 1000:
901
+ if limit and limit > 10000:
902
902
  raise InvalidParameterException(
903
903
  constraint="Member must have value less than or equal to 10000",
904
904
  parameter="limit",
@@ -926,7 +926,7 @@ class LogsBackend(BaseBackend):
926
926
  """
927
927
  if log_group_name not in self.groups:
928
928
  raise ResourceNotFoundException()
929
- if limit and limit > 1000:
929
+ if limit and limit > 10000:
930
930
  raise InvalidParameterException(
931
931
  constraint="Member must have value less than or equal to 10000",
932
932
  parameter="limit",
moto/sqs/models.py CHANGED
@@ -912,8 +912,11 @@ class SQSBackend(BaseBackend):
912
912
  )
913
913
  message.user_id = entry["Id"] # type: ignore[attr-defined]
914
914
  messages.append(message)
915
- except InvalidParameterValue:
916
- failedInvalidDelay.append(entry)
915
+ except InvalidParameterValue as err:
916
+ if "DelaySeconds is invalid" in str(err):
917
+ failedInvalidDelay.append(entry)
918
+ else:
919
+ raise err
917
920
 
918
921
  return messages, failedInvalidDelay
919
922
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: moto
3
- Version: 4.2.1.dev4
3
+ Version: 4.2.1.dev7
4
4
  Home-page: https://github.com/getmoto/moto
5
5
  Author: Steve Pulec
6
6
  Author-email: "spulec@gmail.com"
@@ -1,5 +1,5 @@
1
- moto/__init__.py,sha256=fS7KOB9JGStlrOtHgmfy8yUIr947f6dXh4IuLymlVYI,9543
2
- moto/backend_index.py,sha256=45rRQn6E8jRXagHdZBOL5Gp4P24IYJgE-vWtGxz3zec,10467
1
+ moto/__init__.py,sha256=cw7uvjapdi0-PZBCO79ZX-9tkeY980JgoZDVburS7jo,9543
2
+ moto/backend_index.py,sha256=Kkq-gttKrHlJWuxiICIF5yz9wza2hwq1ZQVKaPJ31lo,10497
3
3
  moto/backends.py,sha256=rC9WUMUUWmVmX7ZEfXpVKAQAw6oI8qYobCEPxP2Zv9U,1805
4
4
  moto/server.py,sha256=cp8kIe5jVOm7Z2BlNN2AMbTfrRvLBEKSb4mt7O8nu34,2858
5
5
  moto/settings.py,sha256=bdluuIi6go1vpnWI8d_8aCYFrqcFyNs8G1Y3-mEzhms,4806
@@ -141,10 +141,10 @@ moto/cognitoidentity/urls.py,sha256=EwCPmD-_m_fiyl0DB82Vhti3VZVpHliimAiGDf5pWyk,
141
141
  moto/cognitoidentity/utils.py,sha256=1jFH2hB04ko1_GdYAB2Ep16VZdW8w-zdy5jb2RLHsyo,143
142
142
  moto/cognitoidp/__init__.py,sha256=nXdnouroOSIuf-0yhvI5GnlajxxsTBDSXbJikUL1jdY,136
143
143
  moto/cognitoidp/exceptions.py,sha256=1a49SBkGGauDhTlPlSOCNG16L1jVr0Hv5LNVJhuIfGc,1959
144
- moto/cognitoidp/models.py,sha256=1gfW-pCxEddLuO7xIBNPOzAb7SmiOY1p9L88V2TBciI,84530
145
- moto/cognitoidp/responses.py,sha256=dH8UQsRurKkl7E5Y-4CVOZC9f3sslmDa8_fiB7clp6g,24950
144
+ moto/cognitoidp/models.py,sha256=mDIZgo75cMOOxMI6qdjqPV_DnuvPCGpIlEyXwv-DacA,85344
145
+ moto/cognitoidp/responses.py,sha256=N3w_kAevofO2mx07JIFtyFOltPqkRVdp8uUYR7gsbYY,25932
146
146
  moto/cognitoidp/urls.py,sha256=J2WNQo5w8oWqxMpnPRhuWJOpmOQdOynschMknIc284k,300
147
- moto/cognitoidp/utils.py,sha256=rSH58ApNAZllqyaCXh41Id--OFTaDoHToxHfi_F6SF8,2940
147
+ moto/cognitoidp/utils.py,sha256=XJqIe9VGZfHezk7muTbHq1Zzypayaa2xPQ-Js02Y73U,3122
148
148
  moto/cognitoidp/resources/jwks-private.json,sha256=CRO_u1fps20PQdhXRVAqIupdevNWTrrVu1CzsLkfXbk,792
149
149
  moto/cognitoidp/resources/jwks-public.json,sha256=d8Ya1alie0JxUbiyBMqJgdFz_oOCSBHitRhZ6VRBm-w,491
150
150
  moto/comprehend/__init__.py,sha256=bwPNumHC-4AY36un_m3p6bKOirKm3MQOcE1Lsxm2L5s,207
@@ -630,7 +630,7 @@ moto/lakeformation/urls.py,sha256=hlqazrDyRKajqlVC-riJynHbmgjv1qqv5nasTfADiiU,97
630
630
  moto/logs/__init__.py,sha256=SjwkEx4_9jREzKLc6RXC1SDkQpL0W50xxJMcpWFGCAQ,118
631
631
  moto/logs/exceptions.py,sha256=stnuTduhFz6jQtb7tTj84W-_WBe49sf9d52ACxAHSsU,1340
632
632
  moto/logs/metric_filters.py,sha256=m5Fu5AksOJu_JjCB4AFCwhCUywsCXjvyAnbEXpjiVQY,2742
633
- moto/logs/models.py,sha256=gWGB3KuBFzq38VPUXXPfIx1opIyxFC-fcUL9TPuNB7o,40640
633
+ moto/logs/models.py,sha256=5grnjdOVnUnXq6gjJNKopRH_GsiUFGMc6hYYbA6ywXk,40642
634
634
  moto/logs/responses.py,sha256=9piI5vcj9hHZVTprlQAw26uPWpG_zQAZcC61PCQaBPo,15543
635
635
  moto/logs/urls.py,sha256=dekDr_vDj3NkvcPb17EQR0xqXvJffWcS_4HStBanKas,136
636
636
  moto/logs/utils.py,sha256=nuPxS7BUV4ufXeTrWa25TTOuWLfNIYs9w2qHfTGXtQA,1899
@@ -882,7 +882,7 @@ moto/sns/utils.py,sha256=tWf2rCATMNBcQYpN1Gwhrh9ddN0PDh-5SYAIrqB3xvs,16358
882
882
  moto/sqs/__init__.py,sha256=q0G8oWLBVvN9jiBZQIBASOlmxPl5yqtEVrHG_LouB7Y,115
883
883
  moto/sqs/constants.py,sha256=0yYf-l1p-dReCyaZGcgYQASn3aSyEhjoL7ALM60eeDM,108
884
884
  moto/sqs/exceptions.py,sha256=5S3D5kghf27iavAnjC0QeFnDKpLwyyDyaksmV7c2rys,3140
885
- moto/sqs/models.py,sha256=ey4wnbSvVcXxs8MsOC0kO6-NcgCnC8Um7hf5xFCaXTA,44097
885
+ moto/sqs/models.py,sha256=Z-OH_a22uQXaDI0Yc8lkgCna45YUTHGWUCXCbskVgAI,44218
886
886
  moto/sqs/responses.py,sha256=I_V3zeVOuAYfctTjTj-aa2Nau_GkR-sGgJ9HUwLx9Xo,38859
887
887
  moto/sqs/urls.py,sha256=rMM5yOZWAymABrVcChxgLaviGckdaYtPcU5mME--qmk,255
888
888
  moto/sqs/utils.py,sha256=dv0_BT9QtXwKRiFt4FRpbuDc8wh5FatvwJeaHIQJ4jg,3142
@@ -1024,10 +1024,10 @@ moto/xray/mock_client.py,sha256=nYl8JVJbl3OY-tnUafkVOG4K4-cFm5bsft3Hxo7fKwI,3809
1024
1024
  moto/xray/models.py,sha256=0QL6nmhpVVwAiyi9aw4pBwVTRhqPW9oIy2uwPDhPKug,11179
1025
1025
  moto/xray/responses.py,sha256=p2xsg2-P9h_1DCyuBC7GenmC5L64tXAX6a-XCb2j5-o,6316
1026
1026
  moto/xray/urls.py,sha256=R6T3gMwobWipukWcC1DQ36CU1Rjt6oqBDoe-7HqaIZU,393
1027
- moto-4.2.1.dev4.dist-info/AUTHORS.md,sha256=dDUhasV8HGSkzb7zj7a0b3alnqY0P1LPOyOUNoo8Mpo,2976
1028
- moto-4.2.1.dev4.dist-info/LICENSE,sha256=8S75_TlqE-kIeGMLG0-rRxxu2ct6SM8quyUWKBYyIY4,10834
1029
- moto-4.2.1.dev4.dist-info/METADATA,sha256=4QeKmmhDxR38M8FaQ89Ei4IHUpyLWThKjwHtJA6CYt8,12101
1030
- moto-4.2.1.dev4.dist-info/WHEEL,sha256=iYlv5fX357PQyRT2o6tw1bN-YcKFFHKqB_LwHO5wP-g,110
1031
- moto-4.2.1.dev4.dist-info/entry_points.txt,sha256=aPovbZuFXCwt8_m2vcolpH4Qr3rOF3yXeRElP9Zkauo,49
1032
- moto-4.2.1.dev4.dist-info/top_level.txt,sha256=TETRKAPcAAvoZDkSkwQiZtTSr-1gzaEAXVm9FmZKj8s,5
1033
- moto-4.2.1.dev4.dist-info/RECORD,,
1027
+ moto-4.2.1.dev7.dist-info/AUTHORS.md,sha256=dDUhasV8HGSkzb7zj7a0b3alnqY0P1LPOyOUNoo8Mpo,2976
1028
+ moto-4.2.1.dev7.dist-info/LICENSE,sha256=8S75_TlqE-kIeGMLG0-rRxxu2ct6SM8quyUWKBYyIY4,10834
1029
+ moto-4.2.1.dev7.dist-info/METADATA,sha256=6zqIZMP3DsrhbSOEFQKr8_fMBeofYZPfJCA-UiRvnZ4,12101
1030
+ moto-4.2.1.dev7.dist-info/WHEEL,sha256=iYlv5fX357PQyRT2o6tw1bN-YcKFFHKqB_LwHO5wP-g,110
1031
+ moto-4.2.1.dev7.dist-info/entry_points.txt,sha256=aPovbZuFXCwt8_m2vcolpH4Qr3rOF3yXeRElP9Zkauo,49
1032
+ moto-4.2.1.dev7.dist-info/top_level.txt,sha256=TETRKAPcAAvoZDkSkwQiZtTSr-1gzaEAXVm9FmZKj8s,5
1033
+ moto-4.2.1.dev7.dist-info/RECORD,,