clear-skies 1.19.23__py3-none-any.whl → 1.19.25__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.
Potentially problematic release.
This version of clear-skies might be problematic. Click here for more details.
- {clear_skies-1.19.23.dist-info → clear_skies-1.19.25.dist-info}/METADATA +1 -1
- {clear_skies-1.19.23.dist-info → clear_skies-1.19.25.dist-info}/RECORD +8 -8
- clearskies/handlers/base.py +6 -0
- clearskies/handlers/callable.py +4 -2
- clearskies/handlers/simple_routing.py +2 -0
- clearskies/model.py +10 -2
- {clear_skies-1.19.23.dist-info → clear_skies-1.19.25.dist-info}/LICENSE +0 -0
- {clear_skies-1.19.23.dist-info → clear_skies-1.19.25.dist-info}/WHEEL +0 -0
|
@@ -127,8 +127,8 @@ clearskies/functional/string.py,sha256=HHXou_lyjntX7SMi0-hfe91Kk3grxQnU-7oi4Lon3
|
|
|
127
127
|
clearskies/functional/validations.py,sha256=f1fTQ4rdFZouxoovAPg-YAgf0Q0QNpKEzxWWL7EFUHI,645
|
|
128
128
|
clearskies/handlers/__init__.py,sha256=9tH0zk4g7Mt22opD1NlynqXwwMX2DHzLmAVihZsJsfU,1011
|
|
129
129
|
clearskies/handlers/advanced_search.py,sha256=UbWDntGAGD5NM61yKEws5MfG0Xy3K_fn-i-X9FG-mKs,13746
|
|
130
|
-
clearskies/handlers/base.py,sha256=
|
|
131
|
-
clearskies/handlers/callable.py,sha256=
|
|
130
|
+
clearskies/handlers/base.py,sha256=aFRm5R6oDJWO4TTxz9BusxuDF3aH_-QVGJUP9atNzLc,22787
|
|
131
|
+
clearskies/handlers/callable.py,sha256=SLgCln-6jvZJjmBOlxrnRXamICM_Wj3zY5Uah4_Wutg,8269
|
|
132
132
|
clearskies/handlers/create.py,sha256=xj_hVYma2sKDK5Vq_R9wo8f0ZXfGlXTkYU71AMyKF2U,1232
|
|
133
133
|
clearskies/handlers/crud_by_method.py,sha256=BOkPX-LUvQrbRLSbyTfRh4c8nPF51dZEXSKOl7m9ZYA,435
|
|
134
134
|
clearskies/handlers/database_connector.py,sha256=XLF_Y3aYnjDtOVP_MOtT5mbI3lHR8S-viOxPiqEAamE,1050
|
|
@@ -148,7 +148,7 @@ clearskies/handlers/request_method_routing.py,sha256=DgPEz3tgbaUkXHsOriPbIctfSf4
|
|
|
148
148
|
clearskies/handlers/restful_api.py,sha256=1rJ2REX1sTAdbqaRuCclP375agrho4zNNQx6hXGa4nQ,9258
|
|
149
149
|
clearskies/handlers/routing.py,sha256=uWKWcEaiHVqfDebPkQVuG9AS8pOixW31wW0yIQ-25Aw,3079
|
|
150
150
|
clearskies/handlers/schema_helper.py,sha256=62644USvFlZu_6tT7rb-k6t_5J3Q0uZsJwP5KREk_WM,4961
|
|
151
|
-
clearskies/handlers/simple_routing.py,sha256=
|
|
151
|
+
clearskies/handlers/simple_routing.py,sha256=xMVfBas51pZOP8xvDmeH6L-iO6CGIrICyT5yUYceJOs,9550
|
|
152
152
|
clearskies/handlers/simple_routing_route.py,sha256=3U3dixEKuf-Xo88RQGH_grm1x79-px6idt1-xaLUSiY,8953
|
|
153
153
|
clearskies/handlers/simple_search.py,sha256=bSfq8rzdqkBj-dTGUBSZ1EkfjzUWHID7mKD2xEf8VzQ,6165
|
|
154
154
|
clearskies/handlers/update.py,sha256=rx8HW87Pfh95e_9nEfKKnxfkh2HBlCUdYqVwljtXiJ8,4116
|
|
@@ -176,7 +176,7 @@ clearskies/input_requirements/unique.py,sha256=gpbm9uoXcy8WCHsuWqAotwockbjDfJOWi
|
|
|
176
176
|
clearskies/mocks/__init__.py,sha256=T68OUB9gGCX0WoisGzsY3Bt2cCFX7ILHKPqi6XKTJM0,113
|
|
177
177
|
clearskies/mocks/input_output.py,sha256=2wD5GbUyVSkXcBg1GTZ-Oz9VzcYxNHfTlmZAODW-7CI,3898
|
|
178
178
|
clearskies/mocks/models.py,sha256=DCzsnMddBvPoBA8JwwbSOhzY7enQWrosgeYD4gx2deI,5124
|
|
179
|
-
clearskies/model.py,sha256=
|
|
179
|
+
clearskies/model.py,sha256=6H6eGQqMBz22bWu20N4xy7XPa1qYgfvNWik5cXH2DZg,13137
|
|
180
180
|
clearskies/models.py,sha256=lKZM2WXIPcziApee_4Iwabcd5xb4gexxKN71PTiQuOY,12332
|
|
181
181
|
clearskies/secrets/__init__.py,sha256=ctTmA_etV9G_5U21APWENI1HvThrBS4DidGWRtEDHQs,1053
|
|
182
182
|
clearskies/secrets/additional_configs/__init__.py,sha256=cFCrbtKF5nuR061S2y1iKZp349x-y8Srdwe3VZbfSFU,1119
|
|
@@ -200,7 +200,7 @@ clearskies/tests/simple_api/models/__init__.py,sha256=nUA0W6fgXw_Bxa9CudkaDkC80t
|
|
|
200
200
|
clearskies/tests/simple_api/models/status.py,sha256=PEhPbaQh5qdUNHp8O0gz91LOLENAEBtqSaHxUPXchaM,699
|
|
201
201
|
clearskies/tests/simple_api/models/user.py,sha256=5_P4Tp1tTdX7PkMJ__epPM5MA7JAeVYGas69vcWloLc,819
|
|
202
202
|
clearskies/tests/simple_api/users_api.py,sha256=KYXCgEofDxHeRdQK67txN5oYUPvxxmB8JTku7L-apk4,2344
|
|
203
|
-
clear_skies-1.19.
|
|
204
|
-
clear_skies-1.19.
|
|
205
|
-
clear_skies-1.19.
|
|
206
|
-
clear_skies-1.19.
|
|
203
|
+
clear_skies-1.19.25.dist-info/LICENSE,sha256=3Ehd0g3YOpCj8sqj0Xjq5qbOtjjgk9qzhhD9YjRQgOA,1053
|
|
204
|
+
clear_skies-1.19.25.dist-info/METADATA,sha256=SOYzyXMqcRVfA4-Rb0Fu79TxkrY3c9mPjtiUD_Iwp7s,1712
|
|
205
|
+
clear_skies-1.19.25.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
|
|
206
|
+
clear_skies-1.19.25.dist-info/RECORD,,
|
clearskies/handlers/base.py
CHANGED
|
@@ -195,6 +195,12 @@ class Base(ABC):
|
|
|
195
195
|
return self.error(input_output, str(client_error), 400)
|
|
196
196
|
except exceptions.InputError as input_error:
|
|
197
197
|
return self.input_errors(input_output, input_error.errors)
|
|
198
|
+
except exceptions.Authentication as auth_error:
|
|
199
|
+
return self.error(input_output, str(auth_error), 401)
|
|
200
|
+
except exceptions.Authorization as auth_error:
|
|
201
|
+
return self.error(input_output, str(auth_error), 403)
|
|
202
|
+
except exceptions.NotFound as auth_error:
|
|
203
|
+
return self.error(input_output, str(auth_error), 404)
|
|
198
204
|
|
|
199
205
|
return response
|
|
200
206
|
|
clearskies/handlers/callable.py
CHANGED
|
@@ -47,16 +47,18 @@ class Callable(Base, SchemaHelper):
|
|
|
47
47
|
return self.input_errors(input_output, input_errors)
|
|
48
48
|
response = self._di.call_function(
|
|
49
49
|
self.configuration("callable"),
|
|
50
|
-
request_data=request_data,
|
|
51
50
|
**input_output.routing_data(),
|
|
52
51
|
**input_output.context_specifics(),
|
|
52
|
+
request_data=request_data,
|
|
53
|
+
authorization_data=input_output.get_authorization_data(),
|
|
53
54
|
)
|
|
54
55
|
else:
|
|
55
56
|
response = self._di.call_function(
|
|
56
57
|
self.configuration("callable"),
|
|
57
|
-
request_data=self.request_data(input_output, required=False),
|
|
58
58
|
**input_output.routing_data(),
|
|
59
59
|
**input_output.context_specifics(),
|
|
60
|
+
request_data=self.request_data(input_output, required=False),
|
|
61
|
+
authorization_data=input_output.get_authorization_data(),
|
|
60
62
|
)
|
|
61
63
|
if response:
|
|
62
64
|
return self.success(input_output, response)
|
|
@@ -157,6 +157,8 @@ class SimpleRouting(Base):
|
|
|
157
157
|
"Each route must specify the handler configuration via 'handler_config' key, "
|
|
158
158
|
+ f"but 'handler_config' was missing for route #{i+1}"
|
|
159
159
|
)
|
|
160
|
+
if route_config.get("authentication"):
|
|
161
|
+
authentication = self._di.build(route_config.get("authentication"), cache=True)
|
|
160
162
|
route = SimpleRoutingRoute(self._di)
|
|
161
163
|
route.configure(
|
|
162
164
|
route_config["handler_class"],
|
clearskies/model.py
CHANGED
|
@@ -141,7 +141,7 @@ class Model(Models):
|
|
|
141
141
|
if data is None:
|
|
142
142
|
raise ValueError("pre_save forgot to return the data array!")
|
|
143
143
|
|
|
144
|
-
to_save = self.columns_to_backend(data, save_columns)
|
|
144
|
+
[to_save, temporary_data] = self.columns_to_backend(data, save_columns)
|
|
145
145
|
to_save = self.to_backend(to_save, save_columns)
|
|
146
146
|
if self.exists:
|
|
147
147
|
new_data = self._backend.update(self._data[self.id_column_name], to_save, self)
|
|
@@ -149,6 +149,12 @@ class Model(Models):
|
|
|
149
149
|
new_data = self._backend.create(to_save, self)
|
|
150
150
|
id = self._backend.column_from_backend(save_columns[self.id_column_name], new_data[self.id_column_name])
|
|
151
151
|
|
|
152
|
+
# if we had any temporary columns add them back in
|
|
153
|
+
new_data = {
|
|
154
|
+
**temporary_data,
|
|
155
|
+
**new_data,
|
|
156
|
+
}
|
|
157
|
+
|
|
152
158
|
data = self.columns_post_save(data, id, save_columns)
|
|
153
159
|
self.post_save(data, id)
|
|
154
160
|
|
|
@@ -254,8 +260,10 @@ class Model(Models):
|
|
|
254
260
|
|
|
255
261
|
def columns_to_backend(self, data, columns):
|
|
256
262
|
backend_data = {**data}
|
|
263
|
+
temporary_data = {}
|
|
257
264
|
for column in columns.values():
|
|
258
265
|
if column.is_temporary and column.name in backend_data:
|
|
266
|
+
temporary_data[column.name] = backend_data[column.name]
|
|
259
267
|
del backend_data[column.name]
|
|
260
268
|
continue
|
|
261
269
|
|
|
@@ -265,7 +273,7 @@ class Model(Models):
|
|
|
265
273
|
f"Column {column.name} of type {column.__class__.__name__} did not return any data for to_database"
|
|
266
274
|
)
|
|
267
275
|
|
|
268
|
-
return backend_data
|
|
276
|
+
return [backend_data, temporary_data]
|
|
269
277
|
|
|
270
278
|
def to_backend(self, data, columns):
|
|
271
279
|
return data
|
|
File without changes
|
|
File without changes
|