api-foundry-query-engine 0.8.65__tar.gz → 0.8.67__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.65 → api_foundry_query_engine-0.8.67}/PKG-INFO +2 -1
- api_foundry_query_engine-0.8.67/api_foundry_query_engine/__init__.py +1 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/sql_delete_query_handler.py +3 -4
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/sql_query_handler.py +14 -1
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/sql_restore_query_handler.py +3 -4
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/sql_select_query_handler.py +1 -2
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/sql_update_query_handler.py +1 -2
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/pyproject.toml +3 -9
- api_foundry_query_engine-0.8.65/api_foundry_query_engine/__init__.py +0 -1
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/.gitignore +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/LICENSE +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/.pre-commit-config.yaml +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/adapters/adapter.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/adapters/case_change_adapter.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/adapters/gateway_adapter.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/adapters/security_adapter.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/connectors/connection.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/connectors/connection_factory.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/connectors/oracle_connector.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/connectors/postgres_connection.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/batch_operation_handler.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/dao.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/operation_dao.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/sql_custom_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/sql_insert_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/dao/sql_subselect_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/lambda_handler.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/operation.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/services/service.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/services/transactional_service.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/utils/api_model.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/utils/app_exception.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/utils/claims_check.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/utils/dependency_resolver.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/utils/logger.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/utils/reference_resolver.py +0 -0
- {api_foundry_query_engine-0.8.65 → api_foundry_query_engine-0.8.67}/api_foundry_query_engine/utils/token_decoder.py +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.67
|
|
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
|
|
@@ -16,6 +16,7 @@ Provides-Extra: dev
|
|
|
16
16
|
Requires-Dist: black>=23.0.0; extra == 'dev'
|
|
17
17
|
Requires-Dist: fixture-foundry>=0.1.0; extra == 'dev'
|
|
18
18
|
Requires-Dist: isort>=5.12.0; extra == 'dev'
|
|
19
|
+
Requires-Dist: pulumi>=3.224.0; extra == 'dev'
|
|
19
20
|
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
20
21
|
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
21
22
|
Requires-Dist: simple-oauth-server; extra == 'dev'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.8.67"
|
|
@@ -93,16 +93,15 @@ class SQLDeleteSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
93
93
|
|
|
94
94
|
# Process audit fields
|
|
95
95
|
audit_props = self.schema_object.get_soft_delete_audit_properties()
|
|
96
|
-
claims = self.operation.claims or {}
|
|
97
|
-
|
|
98
96
|
for _, prop in audit_props.items():
|
|
99
97
|
config = prop.get_soft_delete_config()
|
|
100
98
|
action = config.get("action", "")
|
|
101
99
|
|
|
102
|
-
|
|
100
|
+
claim_sub = self.extract_injected_value("claim:sub")
|
|
101
|
+
if action == "delete" and claim_sub is not None:
|
|
103
102
|
placeholder_key = f"audit_{prop.api_name}"
|
|
104
103
|
columns.append(f"{prop.column_name} = %({placeholder_key})s")
|
|
105
|
-
self.store_placeholders[placeholder_key] =
|
|
104
|
+
self.store_placeholders[placeholder_key] = claim_sub
|
|
106
105
|
|
|
107
106
|
return " SET " + ", ".join(columns) if columns else ""
|
|
108
107
|
|
|
@@ -413,7 +413,20 @@ class SQLQueryHandler:
|
|
|
413
413
|
"""
|
|
414
414
|
if inject_value_source.startswith("claim:"):
|
|
415
415
|
claim_key = inject_value_source[6:]
|
|
416
|
-
|
|
416
|
+
if claim_key in self.operation.claims:
|
|
417
|
+
return self.operation.claims.get(claim_key)
|
|
418
|
+
|
|
419
|
+
claims_payload = self.operation.claims.get("claims")
|
|
420
|
+
if isinstance(claims_payload, dict) and claim_key in claims_payload:
|
|
421
|
+
return claims_payload.get(claim_key)
|
|
422
|
+
|
|
423
|
+
jwt_payload = self.operation.claims.get("jwt")
|
|
424
|
+
if isinstance(jwt_payload, dict):
|
|
425
|
+
jwt_claims = jwt_payload.get("claims")
|
|
426
|
+
if isinstance(jwt_claims, dict):
|
|
427
|
+
return jwt_claims.get(claim_key)
|
|
428
|
+
|
|
429
|
+
return None
|
|
417
430
|
elif inject_value_source == "timestamp":
|
|
418
431
|
return datetime.utcnow().isoformat()
|
|
419
432
|
elif inject_value_source == "date":
|
|
@@ -89,16 +89,15 @@ class SQLRestoreSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
89
89
|
|
|
90
90
|
# Process audit fields for restore action
|
|
91
91
|
audit_props = self.schema_object.get_soft_delete_audit_properties()
|
|
92
|
-
claims = self.operation.claims or {}
|
|
93
|
-
|
|
94
92
|
for _, prop in audit_props.items():
|
|
95
93
|
config = prop.get_soft_delete_config()
|
|
96
94
|
action = config.get("action", "")
|
|
97
95
|
|
|
98
|
-
|
|
96
|
+
claim_sub = self.extract_injected_value("claim:sub")
|
|
97
|
+
if action == "restore" and claim_sub is not None:
|
|
99
98
|
placeholder_key = f"audit_{prop.api_name}"
|
|
100
99
|
columns.append(f"{prop.column_name} = %({placeholder_key})s")
|
|
101
|
-
self.store_placeholders[placeholder_key] =
|
|
100
|
+
self.store_placeholders[placeholder_key] = claim_sub
|
|
102
101
|
elif action == "restore_timestamp":
|
|
103
102
|
columns.append(f"{prop.column_name} = CURRENT_TIMESTAMP")
|
|
104
103
|
|
|
@@ -69,8 +69,7 @@ class SQLSelectSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
69
69
|
|
|
70
70
|
def _replace(m: Match[str]) -> str:
|
|
71
71
|
key = m.group(1)
|
|
72
|
-
|
|
73
|
-
return _quote(claims.get(key))
|
|
72
|
+
return _quote(self.extract_injected_value(f"claim:{key}"))
|
|
74
73
|
|
|
75
74
|
return re.sub(r"\$\{claims\.([A-Za-z0-9_]+)\}", _replace, expr)
|
|
76
75
|
|
|
@@ -26,8 +26,7 @@ class SQLUpdateSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
26
26
|
|
|
27
27
|
def _replace(m: Match[str]) -> str:
|
|
28
28
|
key = m.group(1)
|
|
29
|
-
|
|
30
|
-
return _quote(claims.get(key))
|
|
29
|
+
return _quote(self.extract_injected_value(f"claim:{key}"))
|
|
31
30
|
|
|
32
31
|
return re.sub(r"\$\{claims\.([A-Za-z0-9_]+)\}", _replace, expr)
|
|
33
32
|
|
|
@@ -26,7 +26,8 @@ dev = [
|
|
|
26
26
|
"black>=23.0.0",
|
|
27
27
|
"isort>=5.12.0",
|
|
28
28
|
"fixture_foundry>=0.1.0",
|
|
29
|
-
"simple-oauth-server"
|
|
29
|
+
"simple-oauth-server",
|
|
30
|
+
"pulumi>=3.224.0",
|
|
30
31
|
]
|
|
31
32
|
|
|
32
33
|
[project.urls]
|
|
@@ -40,14 +41,7 @@ include = ["api_foundry_query_engine"]
|
|
|
40
41
|
include = ["api_foundry_query_engine"]
|
|
41
42
|
|
|
42
43
|
[tool.hatch.envs.dev]
|
|
43
|
-
|
|
44
|
-
"pytest>=7.0",
|
|
45
|
-
"pytest-cov>=4.0.0",
|
|
46
|
-
"black>=23.0.0",
|
|
47
|
-
"isort>=5.12.0",
|
|
48
|
-
"fixture_foundry>=0.1.0",
|
|
49
|
-
"simple-oauth-server",
|
|
50
|
-
]
|
|
44
|
+
features = ["dev"]
|
|
51
45
|
|
|
52
46
|
[project.scripts]
|
|
53
47
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.8.65"
|
|
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
|