tracktolib 0.46.0__py3-none-any.whl → 0.46.2__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.
- tracktolib/api.py +0 -24
- {tracktolib-0.46.0.dist-info → tracktolib-0.46.2.dist-info}/METADATA +1 -1
- {tracktolib-0.46.0.dist-info → tracktolib-0.46.2.dist-info}/RECORD +5 -5
- {tracktolib-0.46.0.dist-info → tracktolib-0.46.2.dist-info}/LICENSE +0 -0
- {tracktolib-0.46.0.dist-info → tracktolib-0.46.2.dist-info}/WHEEL +0 -0
tracktolib/api.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import json
|
|
2
|
-
import os
|
|
3
2
|
import warnings
|
|
4
3
|
from dataclasses import field, dataclass
|
|
5
4
|
from inspect import getdoc
|
|
@@ -203,22 +202,6 @@ def _get_method_wrapper(
|
|
|
203
202
|
_NoneType = type(None)
|
|
204
203
|
|
|
205
204
|
|
|
206
|
-
class IgnoreConfig(BaseModel):
|
|
207
|
-
endpoints: dict[str, dict[Method, bool]]
|
|
208
|
-
ignore_missing: bool = True
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
def get_ignore_config() -> IgnoreConfig | None:
|
|
212
|
-
_config = os.getenv("IGNORE_CONFIG")
|
|
213
|
-
return IgnoreConfig.model_validate_json(_config) if _config else None
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
def set_ignore_config(config: str | IgnoreConfig):
|
|
217
|
-
if isinstance(config, str):
|
|
218
|
-
config = IgnoreConfig.model_validate_json(config)
|
|
219
|
-
os.environ["IGNORE_CONFIG"] = config.model_dump_json()
|
|
220
|
-
|
|
221
|
-
|
|
222
205
|
def _get_return_type(fn):
|
|
223
206
|
return_type = get_type_hints(fn)["return"]
|
|
224
207
|
_args = get_args(return_type)
|
|
@@ -234,14 +217,7 @@ def add_endpoint(
|
|
|
234
217
|
*,
|
|
235
218
|
dependencies: Dependencies = None,
|
|
236
219
|
):
|
|
237
|
-
_ignore_config = get_ignore_config()
|
|
238
220
|
for _method, _meta in endpoint.methods.items():
|
|
239
|
-
# Do not add endpoint if it is not in the ignore config
|
|
240
|
-
if _ignore_config is not None:
|
|
241
|
-
_has_access = _ignore_config.endpoints.get(path, {}).get(_method, not _ignore_config.ignore_missing)
|
|
242
|
-
if not _has_access:
|
|
243
|
-
continue
|
|
244
|
-
#
|
|
245
221
|
_fn = _meta["fn"]
|
|
246
222
|
_status_code = _meta["status_code"]
|
|
247
223
|
_dependencies = _meta["dependencies"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
LICENSE,sha256=uUanH0X7SeZEPdsRTHegMSMTiIHMurt9H0jSwEwKE1Y,1081
|
|
2
2
|
tracktolib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
tracktolib/api.py,sha256=
|
|
3
|
+
tracktolib/api.py,sha256=nIS1P0woUwrDNzyPVw5a3dt5GpImps5WZ1HFegHkj2g,7947
|
|
4
4
|
tracktolib/http_utils.py,sha256=dqjRJTNCo1qDnvQBTcImw1ibi1LnqETrpWDAU5txBHs,2633
|
|
5
5
|
tracktolib/logs.py,sha256=enezPjBU4v2s8knG_V6kIbQsoyxfNIKEpKVSSkr_2U8,2212
|
|
6
6
|
tracktolib/pg/__init__.py,sha256=32kKBJzIDyppszZMAOSMgM3ggz7Ow0TaNKiMs740gyw,333
|
|
@@ -13,7 +13,7 @@ tracktolib/s3/minio.py,sha256=JaRpHOM6NqpMieplp58Fpc7uTh7PItyP8On7jMXhB-Q,1234
|
|
|
13
13
|
tracktolib/s3/s3.py,sha256=0aPUo3Vnfy5Rk_Qp_y0KkCZa2kuMWw2JU2xrodn7oAE,3486
|
|
14
14
|
tracktolib/tests.py,sha256=FS0uae3ShiiJOD7WE2WEv9h3QwRJCbLDHpe_8Ikc0j0,554
|
|
15
15
|
tracktolib/utils.py,sha256=YZZROGgOioblJkqgneHGZRbof45nmZ-VLSk9LqcVkkE,4847
|
|
16
|
-
tracktolib-0.46.
|
|
17
|
-
tracktolib-0.46.
|
|
18
|
-
tracktolib-0.46.
|
|
19
|
-
tracktolib-0.46.
|
|
16
|
+
tracktolib-0.46.2.dist-info/LICENSE,sha256=uUanH0X7SeZEPdsRTHegMSMTiIHMurt9H0jSwEwKE1Y,1081
|
|
17
|
+
tracktolib-0.46.2.dist-info/WHEEL,sha256=vxFmldFsRN_Hx10GDvsdv1wroKq8r5Lzvjp6GZ4OO8c,88
|
|
18
|
+
tracktolib-0.46.2.dist-info/METADATA,sha256=llhCmztMMABZ10LT9TtpR72HsPn0dKGV5-MvXbaPo6k,3610
|
|
19
|
+
tracktolib-0.46.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|