api-foundry-query-engine 0.8.58__tar.gz → 0.8.60__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.
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/PKG-INFO +1 -1
- api_foundry_query_engine-0.8.60/api_foundry_query_engine/__init__.py +1 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/adapters/gateway_adapter.py +31 -4
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/utils/claims_check.py +17 -7
- api_foundry_query_engine-0.8.58/api_foundry_query_engine/__init__.py +0 -1
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/.gitignore +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/LICENSE +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/.pre-commit-config.yaml +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/adapters/adapter.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/adapters/case_change_adapter.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/adapters/security_adapter.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/connectors/connection.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/connectors/connection_factory.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/connectors/oracle_connector.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/connectors/postgres_connection.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/batch_operation_handler.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/dao.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/operation_dao.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/sql_custom_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/sql_delete_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/sql_insert_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/sql_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/sql_restore_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/sql_select_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/sql_subselect_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/dao/sql_update_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/lambda_handler.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/operation.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/services/service.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/services/transactional_service.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/utils/api_model.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/utils/app_exception.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/utils/dependency_resolver.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/utils/logger.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/utils/reference_resolver.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/api_foundry_query_engine/utils/token_decoder.py +0 -0
- {api_foundry_query_engine-0.8.58 → api_foundry_query_engine-0.8.60}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: api-foundry-query-engine
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.60
|
|
4
4
|
Summary: The AWS lambda service handler use by 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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.8.60"
|
|
@@ -39,12 +39,12 @@ class GatewayAdapter(Adapter):
|
|
|
39
39
|
- tuple: Tuple containing data, query and metadata parameters.
|
|
40
40
|
"""
|
|
41
41
|
resource = event.get("resource")
|
|
42
|
-
if resource
|
|
42
|
+
if resource:
|
|
43
43
|
parts = [p for p in resource.split("/") if p] # Remove empty strings
|
|
44
44
|
# Skip common API prefixes like "api", "v1", "v2", etc.
|
|
45
45
|
api_prefixes = {"api", "v1", "v2", "v3"}
|
|
46
|
-
|
|
47
|
-
entity =
|
|
46
|
+
literal_parts = [p for p in parts if p not in api_prefixes and not p.startswith("{")]
|
|
47
|
+
entity = "_".join(literal_parts) if literal_parts else None
|
|
48
48
|
else:
|
|
49
49
|
entity = None
|
|
50
50
|
|
|
@@ -99,7 +99,16 @@ class GatewayAdapter(Adapter):
|
|
|
99
99
|
|
|
100
100
|
event_params = {}
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
raw_path = event.get("path") or ""
|
|
103
|
+
path_parameters = event.get("pathParameters") or {}
|
|
104
|
+
if "proxy" in path_parameters and not raw_path:
|
|
105
|
+
raw_path = f"/{path_parameters['proxy']}"
|
|
106
|
+
extracted_path_params = self._extract_path_params(resource, raw_path)
|
|
107
|
+
for key, value in extracted_path_params.items():
|
|
108
|
+
if key not in path_parameters or path_parameters.get(key) in (None, "", "None"):
|
|
109
|
+
path_parameters[key] = value
|
|
110
|
+
|
|
111
|
+
path_parameters = self._convert_parameters(path_parameters)
|
|
103
112
|
if path_parameters is not None:
|
|
104
113
|
event_params.update(path_parameters)
|
|
105
114
|
|
|
@@ -107,6 +116,8 @@ class GatewayAdapter(Adapter):
|
|
|
107
116
|
if query_string_parameters is not None:
|
|
108
117
|
event_params.update(query_string_parameters)
|
|
109
118
|
query_params, metadata_params = self.split_params(event_params)
|
|
119
|
+
log.info("Unmarshalled query parameters: %s", query_params)
|
|
120
|
+
log.info("Unmarshalled metadata parameters: %s", metadata_params)
|
|
110
121
|
|
|
111
122
|
store_params = {}
|
|
112
123
|
body = event.get("body")
|
|
@@ -146,6 +157,22 @@ class GatewayAdapter(Adapter):
|
|
|
146
157
|
result[parameter] = value
|
|
147
158
|
return result
|
|
148
159
|
|
|
160
|
+
def _extract_path_params(self, resource: Optional[str], path: str) -> Dict[str, str]:
|
|
161
|
+
if not resource or not path:
|
|
162
|
+
return {}
|
|
163
|
+
|
|
164
|
+
resource_parts = [p for p in resource.split("/") if p]
|
|
165
|
+
path_parts = [p for p in path.split("/") if p]
|
|
166
|
+
params: Dict[str, str] = {}
|
|
167
|
+
|
|
168
|
+
for template, actual in zip(resource_parts, path_parts):
|
|
169
|
+
if template.startswith("{") and template.endswith("}"):
|
|
170
|
+
key = template[1:-1]
|
|
171
|
+
if key:
|
|
172
|
+
params[key] = actual
|
|
173
|
+
|
|
174
|
+
return params
|
|
175
|
+
|
|
149
176
|
def split_params(self, parameters: Dict[str, Any]) -> Tuple[Dict[str, Any], Dict[str, Any]]:
|
|
150
177
|
"""
|
|
151
178
|
Split a dictionary into two dictionaries based on keys.
|
|
@@ -403,17 +403,27 @@ def _extract_entity_from_path(event: Dict[str, Any]) -> Optional[str]:
|
|
|
403
403
|
# Remove leading slash and split by slash
|
|
404
404
|
path_parts = path.lstrip("/").split("/")
|
|
405
405
|
|
|
406
|
-
# Find
|
|
406
|
+
# Find literal path parts (ignoring params and common prefixes)
|
|
407
407
|
# For paths like "/comment/123" or "/comment/123/version/1"
|
|
408
|
-
# Skip common API prefixes like "api", "v1", etc.
|
|
409
408
|
api_prefixes = {"api", "v1", "v2", "v3"}
|
|
409
|
+
literal_parts = []
|
|
410
410
|
for part in path_parts:
|
|
411
|
-
if part
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
411
|
+
if not part or part.startswith("{"):
|
|
412
|
+
continue
|
|
413
|
+
if part in api_prefixes:
|
|
414
|
+
continue
|
|
415
|
+
# Skip numeric IDs and known path keywords
|
|
416
|
+
if part.isdigit() or part in {"version", "batch"}:
|
|
417
|
+
continue
|
|
418
|
+
literal_parts.append(part)
|
|
419
|
+
|
|
420
|
+
if not literal_parts:
|
|
421
|
+
return None
|
|
422
|
+
|
|
423
|
+
if len(literal_parts) == 1:
|
|
424
|
+
return literal_parts[0]
|
|
415
425
|
|
|
416
|
-
return
|
|
426
|
+
return "_".join(literal_parts)
|
|
417
427
|
|
|
418
428
|
|
|
419
429
|
def _scope_matches(user_scopes: list, required_scope: str, operation: str, entity: str) -> bool:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.8.58"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|