api-foundry 0.8.13__tar.gz → 0.8.14__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: api-foundry
3
- Version: 0.8.13
3
+ Version: 0.8.14
4
4
  Summary: The `api_foundry` project is a powerful tool designed to automate the deployment of REST APIs on AWS using Lambda services to access and interact with relational databases (RDBMS). This project leverages the OpenAPI specification to define and manage the APIs
5
5
  Project-URL: Documentation, https://github.com/DanRepik/api-foundry
6
6
  Project-URL: Source, https://github.com/DanRepik/api-foundry
@@ -1,5 +1,5 @@
1
1
  # __init__.py
2
- __version__ = "0.8.13"
2
+ __version__ = "0.8.14"
3
3
 
4
4
  from api_foundry.iac.pulumi.api_foundry import APIFoundry
5
5
  from cloud_foundry import logger
@@ -150,9 +150,11 @@ def throttle_limits(spec: dict, path_prefix: Optional[str] = None) -> dict[str,
150
150
 
151
151
  ``*/*`` is the whole stage: the spec's top-level ``x-af-throttle``, else
152
152
  DEFAULT_THROTTLE. Each path operation with its own ``x-af-throttle`` gets
153
- ``{resource path}/{METHOD}``, the resource path (with ``path_prefix``,
154
- as cloud_foundry prefixes it) written with "~1" for "/", as the stage's
155
- method settings name it.
153
+ ``{resource path}/{METHOD}``: the resource path with ``path_prefix`` (as
154
+ cloud_foundry prefixes it) and without its leading "/", the form the AWS
155
+ provider's ``method_path`` takes. The provider stores and looks up the
156
+ setting under exactly this key, so a "~1"-encoded path deploys without
157
+ error and matches no resource.
156
158
  """
157
159
  limits = {"*/*": _throttle(spec.get("x-af-throttle", DEFAULT_THROTTLE), "spec")}
158
160
  for path, item in (spec.get("paths") or {}).items():
@@ -163,7 +165,7 @@ def throttle_limits(spec: dict, path_prefix: Optional[str] = None) -> dict[str,
163
165
  resource = (
164
166
  f"{path_prefix.rstrip('/')}/{path.lstrip('/')}" if path_prefix else path
165
167
  )
166
- limits[f"{resource.replace('/', '~1')}/{method.upper()}"] = _throttle(
168
+ limits[f"{resource.lstrip('/')}/{method.upper()}"] = _throttle(
167
169
  operation["x-af-throttle"], f"{method.upper()} {path}"
168
170
  )
169
171
  return limits
File without changes
File without changes