nucliadb 6.8.1.post4961__py3-none-any.whl → 6.8.1.post4969__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 nucliadb might be problematic. Click here for more details.
- nucliadb/learning_proxy.py +12 -15
- nucliadb/reader/api/v1/learning_config.py +7 -3
- {nucliadb-6.8.1.post4961.dist-info → nucliadb-6.8.1.post4969.dist-info}/METADATA +6 -6
- {nucliadb-6.8.1.post4961.dist-info → nucliadb-6.8.1.post4969.dist-info}/RECORD +7 -7
- {nucliadb-6.8.1.post4961.dist-info → nucliadb-6.8.1.post4969.dist-info}/WHEEL +0 -0
- {nucliadb-6.8.1.post4961.dist-info → nucliadb-6.8.1.post4969.dist-info}/entry_points.txt +0 -0
- {nucliadb-6.8.1.post4961.dist-info → nucliadb-6.8.1.post4969.dist-info}/top_level.txt +0 -0
nucliadb/learning_proxy.py
CHANGED
|
@@ -43,8 +43,8 @@ logger = logging.getLogger(SERVICE_NAME)
|
|
|
43
43
|
WHITELISTED_HEADERS = {
|
|
44
44
|
"x-nucliadb-user",
|
|
45
45
|
"x-nucliadb-roles",
|
|
46
|
-
"x-
|
|
47
|
-
"x-
|
|
46
|
+
"x-nucliadb-account",
|
|
47
|
+
"x-nucliadb-account-type",
|
|
48
48
|
"x-forwarded-for",
|
|
49
49
|
"x-forwarded-host",
|
|
50
50
|
"x-forwarded-proto",
|
|
@@ -204,14 +204,14 @@ async def learning_config_proxy(
|
|
|
204
204
|
request: Request,
|
|
205
205
|
method: str,
|
|
206
206
|
url: str,
|
|
207
|
-
|
|
207
|
+
headers: dict[str, str] = {},
|
|
208
208
|
) -> Union[Response, StreamingResponse]:
|
|
209
209
|
return await proxy(
|
|
210
210
|
service=LearningService.CONFIG,
|
|
211
211
|
request=request,
|
|
212
212
|
method=method,
|
|
213
213
|
url=url,
|
|
214
|
-
|
|
214
|
+
headers=headers,
|
|
215
215
|
)
|
|
216
216
|
|
|
217
217
|
|
|
@@ -244,24 +244,21 @@ async def proxy(
|
|
|
244
244
|
request: Request,
|
|
245
245
|
method: str,
|
|
246
246
|
url: str,
|
|
247
|
-
|
|
247
|
+
headers: dict[str, str] = {},
|
|
248
248
|
) -> Union[Response, StreamingResponse]:
|
|
249
249
|
"""
|
|
250
250
|
Proxy the request to a learning API.
|
|
251
251
|
|
|
252
|
-
service:
|
|
253
|
-
request:
|
|
254
|
-
method:
|
|
255
|
-
url:
|
|
256
|
-
|
|
252
|
+
service: The learning service to proxy the request to.
|
|
253
|
+
request: The incoming request.
|
|
254
|
+
method: The HTTP method to use.
|
|
255
|
+
url: The URL to proxy the request to.
|
|
256
|
+
headers: Extra headers to include in the proxied request.
|
|
257
257
|
|
|
258
258
|
Returns: Response. The response from the learning API. If the response is chunked, a StreamingResponse is returned.
|
|
259
259
|
"""
|
|
260
|
-
|
|
261
|
-
proxied_headers
|
|
262
|
-
proxied_headers.update(
|
|
263
|
-
{k.lower(): v for k, v in request.headers.items() if is_white_listed_header(k)}
|
|
264
|
-
)
|
|
260
|
+
proxied_headers = {k.lower(): v for k, v in request.headers.items() if is_white_listed_header(k)}
|
|
261
|
+
proxied_headers.update(**headers)
|
|
265
262
|
|
|
266
263
|
async with service_client(
|
|
267
264
|
base_url=get_base_url(service=service),
|
|
@@ -68,7 +68,7 @@ async def get_configuration(
|
|
|
68
68
|
request,
|
|
69
69
|
"GET",
|
|
70
70
|
f"/config/{kbid}",
|
|
71
|
-
|
|
71
|
+
headers={"account-id": request.headers.get("x-nucliadb-account", "")},
|
|
72
72
|
)
|
|
73
73
|
|
|
74
74
|
|
|
@@ -108,7 +108,6 @@ async def get_model(
|
|
|
108
108
|
request,
|
|
109
109
|
"GET",
|
|
110
110
|
f"/models/{kbid}/model/{model_id}",
|
|
111
|
-
extra_headers={"X-STF-USER": request.headers.get("X-NUCLIADB-USER", "")},
|
|
112
111
|
)
|
|
113
112
|
|
|
114
113
|
|
|
@@ -126,7 +125,12 @@ async def get_schema_for_configuration_updates(
|
|
|
126
125
|
request: Request,
|
|
127
126
|
kbid: str,
|
|
128
127
|
):
|
|
129
|
-
return await learning_config_proxy(
|
|
128
|
+
return await learning_config_proxy(
|
|
129
|
+
request,
|
|
130
|
+
"GET",
|
|
131
|
+
f"/schema/{kbid}",
|
|
132
|
+
headers={"account-id": request.headers.get("x-nucliadb-account", "")},
|
|
133
|
+
)
|
|
130
134
|
|
|
131
135
|
|
|
132
136
|
@api.get(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: nucliadb
|
|
3
|
-
Version: 6.8.1.
|
|
3
|
+
Version: 6.8.1.post4969
|
|
4
4
|
Summary: NucliaDB
|
|
5
5
|
Author-email: Nuclia <nucliadb@nuclia.com>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
@@ -19,11 +19,11 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
19
19
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
20
|
Requires-Python: <4,>=3.9
|
|
21
21
|
Description-Content-Type: text/markdown
|
|
22
|
-
Requires-Dist: nucliadb-telemetry[all]>=6.8.1.
|
|
23
|
-
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.8.1.
|
|
24
|
-
Requires-Dist: nucliadb-protos>=6.8.1.
|
|
25
|
-
Requires-Dist: nucliadb-models>=6.8.1.
|
|
26
|
-
Requires-Dist: nidx-protos>=6.8.1.
|
|
22
|
+
Requires-Dist: nucliadb-telemetry[all]>=6.8.1.post4969
|
|
23
|
+
Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.8.1.post4969
|
|
24
|
+
Requires-Dist: nucliadb-protos>=6.8.1.post4969
|
|
25
|
+
Requires-Dist: nucliadb-models>=6.8.1.post4969
|
|
26
|
+
Requires-Dist: nidx-protos>=6.8.1.post4969
|
|
27
27
|
Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
|
|
28
28
|
Requires-Dist: nuclia-models>=0.47.0
|
|
29
29
|
Requires-Dist: uvicorn[standard]
|
|
@@ -47,7 +47,7 @@ migrations/pg/0009_extract_facets_safety.py,sha256=k9Appx7ipp3wDyLy70qgw9oLjN7N6
|
|
|
47
47
|
migrations/pg/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
|
|
48
48
|
nucliadb/__init__.py,sha256=_abCmDJ_0ku483Os4UAjPX7Nywm39cQgAV_DiyjsKeQ,891
|
|
49
49
|
nucliadb/health.py,sha256=UIxxA4oms4HIsCRZM_SZsdkIZIlgzmOxw-qSHLlWuak,3465
|
|
50
|
-
nucliadb/learning_proxy.py,sha256=
|
|
50
|
+
nucliadb/learning_proxy.py,sha256=2ucru4pHfFYWdjt875YKeGBjx1sZ7lGvS5Xnp6l2ZNs,19173
|
|
51
51
|
nucliadb/metrics_exporter.py,sha256=CdfDqKqR-4xMjZxITl6F6mV539iXVsF5ovXCPHjKp40,5341
|
|
52
52
|
nucliadb/openapi.py,sha256=dI5hHSUs2oHf4fd27gGagVltWfjVZPIoVqMtIN04VJk,2290
|
|
53
53
|
nucliadb/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -206,7 +206,7 @@ nucliadb/reader/api/v1/__init__.py,sha256=ieP8lsCCwG66Jupv8II5MSTj6nh3eCtLcF4utH
|
|
|
206
206
|
nucliadb/reader/api/v1/download.py,sha256=F48YM3BPwuHwDgYk0jjRHHJHh732QUb4nCAS5xyNqzg,10819
|
|
207
207
|
nucliadb/reader/api/v1/export_import.py,sha256=x4VBNDFjnlY1nIt5kdq0eZTB_DeRzGzT8T7uB7wUhNU,6448
|
|
208
208
|
nucliadb/reader/api/v1/knowledgebox.py,sha256=e8q7v5JwGxsuPZLc_GkUOkWWSJMI2o483bK9ywhdkk8,3612
|
|
209
|
-
nucliadb/reader/api/v1/learning_config.py,sha256=
|
|
209
|
+
nucliadb/reader/api/v1/learning_config.py,sha256=jDvjhvDgaa8LCLFeDlvEKsh-87BUr2CE93GFsuwqoJ0,6855
|
|
210
210
|
nucliadb/reader/api/v1/resource.py,sha256=WTBIEywfHfy4sIffnVm9s__3--JpHi9hprVpK0Ddd04,14164
|
|
211
211
|
nucliadb/reader/api/v1/router.py,sha256=eyNmEGSP9zHkCIG5XlAXl6sukq950B7gFT3X2peMtIE,1011
|
|
212
212
|
nucliadb/reader/api/v1/services.py,sha256=Fcj4fRDBNnIwnf5Q3VZxpP_6UwdPYOtyEZUGr9_lhqo,13438
|
|
@@ -379,8 +379,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
|
|
|
379
379
|
nucliadb/writer/tus/s3.py,sha256=vu1BGg4VqJ_x2P1u2BxqPKlSfw5orT_a3R-Ln5oPUpU,8483
|
|
380
380
|
nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
|
|
381
381
|
nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
|
|
382
|
-
nucliadb-6.8.1.
|
|
383
|
-
nucliadb-6.8.1.
|
|
384
|
-
nucliadb-6.8.1.
|
|
385
|
-
nucliadb-6.8.1.
|
|
386
|
-
nucliadb-6.8.1.
|
|
382
|
+
nucliadb-6.8.1.post4969.dist-info/METADATA,sha256=nYA6asHxehL1n_SKC9CZ_qbOYqAzMlqw1C0xjZJhvkY,4158
|
|
383
|
+
nucliadb-6.8.1.post4969.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
384
|
+
nucliadb-6.8.1.post4969.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
|
|
385
|
+
nucliadb-6.8.1.post4969.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
|
|
386
|
+
nucliadb-6.8.1.post4969.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|