api-foundry-query-engine 0.8.36__tar.gz → 0.8.38__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.36 → api_foundry_query_engine-0.8.38}/PKG-INFO +1 -1
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_delete_query_handler.py +1 -1
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_insert_query_handler.py +30 -3
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_restore_query_handler.py +3 -2
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_select_query_handler.py +1 -1
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_update_query_handler.py +3 -2
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/pyproject.toml +1 -1
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/.gitignore +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/LICENSE +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/.pre-commit-config.yaml +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/__init__.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/adapters/adapter.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/adapters/case_change_adapter.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/adapters/gateway_adapter.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/adapters/security_adapter.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/connectors/connection.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/connectors/connection_factory.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/connectors/oracle_connector.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/connectors/postgres_connection.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/batch_operation_handler.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/dao.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/operation_dao.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_custom_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/dao/sql_subselect_query_handler.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/lambda_handler.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/operation.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/services/service.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/services/transactional_service.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/api_model.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/app_exception.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/claims_check.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/dependency_resolver.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/gateway_operation.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/logger.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/api_foundry_query_engine/utils/reference_resolver.py +0 -0
- {api_foundry_query_engine-0.8.36 → api_foundry_query_engine-0.8.38}/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.38
|
|
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
|
|
@@ -110,7 +110,7 @@ class SQLDeleteSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
110
110
|
def sql(self) -> str:
|
|
111
111
|
if not self.check_permission():
|
|
112
112
|
raise ApplicationException(
|
|
113
|
-
|
|
113
|
+
403, f"Subject is not allowed to delete {self.schema_object.api_name}"
|
|
114
114
|
)
|
|
115
115
|
|
|
116
116
|
concurrency_property = self.schema_object.concurrency_property
|
|
@@ -45,10 +45,14 @@ class SQLInsertSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
45
45
|
@property
|
|
46
46
|
def sql(self) -> str:
|
|
47
47
|
self.concurrency_property = self.schema_object.concurrency_property
|
|
48
|
+
# Get columns to return - use read permissions if available,
|
|
49
|
+
# otherwise fall back to primary key
|
|
50
|
+
returning_clause = self._get_returning_clause()
|
|
51
|
+
|
|
48
52
|
if not self.concurrency_property:
|
|
49
53
|
return (
|
|
50
54
|
f"INSERT INTO {self.table_expression}{self.insert_values} "
|
|
51
|
-
+
|
|
55
|
+
+ returning_clause
|
|
52
56
|
)
|
|
53
57
|
|
|
54
58
|
if self.operation.store_params.get(self.concurrency_property.api_name):
|
|
@@ -61,9 +65,32 @@ class SQLInsertSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
61
65
|
)
|
|
62
66
|
return (
|
|
63
67
|
f"INSERT INTO {self.table_expression}{self.insert_values}"
|
|
64
|
-
+
|
|
68
|
+
+ returning_clause
|
|
65
69
|
)
|
|
66
70
|
|
|
71
|
+
def _get_returning_clause(self) -> str:
|
|
72
|
+
"""
|
|
73
|
+
Get RETURNING clause with fallback to primary key
|
|
74
|
+
if no read permissions.
|
|
75
|
+
"""
|
|
76
|
+
try:
|
|
77
|
+
select_list = self.select_list
|
|
78
|
+
if select_list:
|
|
79
|
+
return f"RETURNING {select_list}"
|
|
80
|
+
except ApplicationException:
|
|
81
|
+
# If read permissions filter everything,
|
|
82
|
+
# return at least the primary key
|
|
83
|
+
pass
|
|
84
|
+
|
|
85
|
+
# Fallback to primary key
|
|
86
|
+
pk_property = self.schema_object.primary_key_property
|
|
87
|
+
if pk_property:
|
|
88
|
+
return f"RETURNING {pk_property.column_name}"
|
|
89
|
+
|
|
90
|
+
# Last resort - return nothing
|
|
91
|
+
# (should never happen with properly defined schemas)
|
|
92
|
+
return ""
|
|
93
|
+
|
|
67
94
|
@property
|
|
68
95
|
def insert_values(self) -> str:
|
|
69
96
|
self.store_placeholders = {}
|
|
@@ -106,7 +133,7 @@ class SQLInsertSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
106
133
|
raise ApplicationException(400, f"Invalid property: {name}")
|
|
107
134
|
else:
|
|
108
135
|
raise ApplicationException(
|
|
109
|
-
|
|
136
|
+
403,
|
|
110
137
|
f"Subject is not allowed to create with property: {parts[0]}",
|
|
111
138
|
)
|
|
112
139
|
|
|
@@ -171,8 +171,9 @@ class SQLRestoreSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
171
171
|
def sql(self) -> str:
|
|
172
172
|
if not self.check_permission():
|
|
173
173
|
raise ApplicationException(
|
|
174
|
-
|
|
175
|
-
"Subject is not allowed to restore "
|
|
174
|
+
403,
|
|
175
|
+
f"Subject is not allowed to restore "
|
|
176
|
+
f"{self.schema_object.api_name}",
|
|
176
177
|
)
|
|
177
178
|
|
|
178
179
|
if not self.schema_object.has_soft_delete_support():
|
|
@@ -169,8 +169,9 @@ class SQLUpdateSchemaQueryHandler(SQLSchemaQueryHandler):
|
|
|
169
169
|
|
|
170
170
|
if invalid_columns:
|
|
171
171
|
raise ApplicationException(
|
|
172
|
-
|
|
173
|
-
f"Subject does not have permission to update properties:
|
|
172
|
+
403,
|
|
173
|
+
f"Subject does not have permission to update properties: "
|
|
174
|
+
f"{invalid_columns}",
|
|
174
175
|
)
|
|
175
176
|
return f" SET {', '.join(columns)}"
|
|
176
177
|
|
|
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
|