labfreed 1.0.0b29__py3-none-any.whl → 1.0.0b31__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.
- labfreed/__init__.py +1 -1
- labfreed/labfreed_extended/pac_issuer_lib/app_factory.py +20 -12
- labfreed/pac_attributes/pythonic/attribute_server_factory.py +4 -1
- labfreed/pac_id_resolver/resolver_config.py +4 -2
- {labfreed-1.0.0b29.dist-info → labfreed-1.0.0b31.dist-info}/METADATA +2 -1
- {labfreed-1.0.0b29.dist-info → labfreed-1.0.0b31.dist-info}/RECORD +8 -8
- {labfreed-1.0.0b29.dist-info → labfreed-1.0.0b31.dist-info}/WHEEL +0 -0
- {labfreed-1.0.0b29.dist-info → labfreed-1.0.0b31.dist-info}/licenses/LICENSE +0 -0
labfreed/__init__.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
-
from functools import cache, partial, partialmethod
|
|
2
|
+
from functools import cache, partial, partialmethod, wraps
|
|
3
3
|
import logging
|
|
4
4
|
import os
|
|
5
5
|
from pathlib import Path
|
|
@@ -12,7 +12,9 @@ import jinja2
|
|
|
12
12
|
from labfreed.labfreed_extended.pac_issuer_lib.lib.utils import add_ga_params, add_trace_id_params
|
|
13
13
|
from pydantic import BaseModel, Field
|
|
14
14
|
|
|
15
|
-
from flask import Blueprint, Flask, Response, current_app, flash, render_template, request, send_from_directory, session, url_for
|
|
15
|
+
from flask import Blueprint, Flask, Response, current_app, flash, make_response, render_template, request, send_from_directory, session, url_for
|
|
16
|
+
from flask_cors import CORS
|
|
17
|
+
|
|
16
18
|
from werkzeug.middleware.proxy_fix import ProxyFix
|
|
17
19
|
|
|
18
20
|
|
|
@@ -106,6 +108,20 @@ class IssuerFlaskAppFactory():
|
|
|
106
108
|
resolver_macros=resolver_macros,
|
|
107
109
|
use_issuer_resolver_config = use_issuer_resolver_config)
|
|
108
110
|
app.register_blueprint(bp)
|
|
111
|
+
|
|
112
|
+
CORS(
|
|
113
|
+
app,
|
|
114
|
+
resources={
|
|
115
|
+
r"/resolver_config(\.ya?ml)?": {
|
|
116
|
+
"origins": ["*"],
|
|
117
|
+
"methods": ["GET"],
|
|
118
|
+
},
|
|
119
|
+
r"/attributes/.*": {
|
|
120
|
+
"origins": ["*"],
|
|
121
|
+
"methods": ["GET"]
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
)
|
|
109
125
|
return app
|
|
110
126
|
|
|
111
127
|
|
|
@@ -373,6 +389,7 @@ class IssuerFlaskAppFactory():
|
|
|
373
389
|
def resolver_configuration():
|
|
374
390
|
return Response(bp._resolver_configuration, mimetype="application/x-yaml")
|
|
375
391
|
|
|
392
|
+
|
|
376
393
|
|
|
377
394
|
@bp_landing_page.get('/info_card')
|
|
378
395
|
def pac_card():
|
|
@@ -479,15 +496,6 @@ render_context_utils = {
|
|
|
479
496
|
|
|
480
497
|
|
|
481
498
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
499
|
def attribute_data_from_module(module, default_language):
|
|
492
500
|
try:
|
|
493
501
|
ds = module.data_sources
|
|
@@ -508,5 +516,5 @@ def attribute_data_from_module(module, default_language):
|
|
|
508
516
|
return attribute_data
|
|
509
517
|
|
|
510
518
|
|
|
511
|
-
|
|
519
|
+
|
|
512
520
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
from enum import Enum
|
|
2
|
+
from functools import wraps
|
|
2
3
|
import json
|
|
3
4
|
import logging
|
|
4
5
|
from typing import Any, Protocol
|
|
5
6
|
from urllib.parse import unquote, unquote_plus
|
|
6
7
|
|
|
7
|
-
from flask import Blueprint, current_app, redirect, url_for, send_from_directory
|
|
8
|
+
from flask import Blueprint, current_app, make_response, redirect, url_for, send_from_directory
|
|
8
9
|
from labfreed.pac_attributes.api_data_models.request import AttributeRequestData
|
|
9
10
|
from labfreed.pac_attributes.server.server import AttributeGroupDataSource, AttributeServerRequestHandler, InvalidRequestError, TranslationDataSource
|
|
10
11
|
|
|
@@ -161,6 +162,8 @@ class AttributeFlaskApp(Flask):
|
|
|
161
162
|
return bp
|
|
162
163
|
|
|
163
164
|
|
|
165
|
+
|
|
166
|
+
|
|
164
167
|
|
|
165
168
|
|
|
166
169
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import re
|
|
3
|
-
from typing import Self
|
|
3
|
+
from typing import Literal, Self
|
|
4
4
|
from pydantic import Field, field_validator, model_validator
|
|
5
5
|
import yaml
|
|
6
6
|
import jsonpath_ng.ext as jsonpath
|
|
7
|
+
from urllib.parse import quote as url_encode
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
from labfreed.pac_id_resolver.services import Service, ServiceGroup
|
|
@@ -105,7 +106,7 @@ class ResolverConfigBlock(LabFREED_BaseModel):
|
|
|
105
106
|
|
|
106
107
|
|
|
107
108
|
class ResolverConfig(LabFREED_BaseModel):
|
|
108
|
-
schema_version:
|
|
109
|
+
schema_version: Literal["2.0"] = Field(default='2.0')
|
|
109
110
|
'''Resolver Configuration'''
|
|
110
111
|
origin: str = ''
|
|
111
112
|
model_config = {
|
|
@@ -301,6 +302,7 @@ class ResolverConfig(LabFREED_BaseModel):
|
|
|
301
302
|
res = self._evaluate_jsonpath(pac_id_json, expanded_placeholder) or ['']
|
|
302
303
|
url:str = url.replace(f'{{{placeholder}}}', str(res[0]))
|
|
303
304
|
url = url.strip()
|
|
305
|
+
url = url_encode(url)
|
|
304
306
|
# res = self.substitute_jsonpath_expressions(expanded_placeholder, Patterns.jsonpath.value, as_bool=False)
|
|
305
307
|
# url = url.replace(f'{{{placeholder}}}', res)
|
|
306
308
|
return url
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: labfreed
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0b31
|
|
4
4
|
Summary: Python implementation of LabFREED building blocks
|
|
5
5
|
Author-email: Reto Thürer <thuerer.r@buchi.com>
|
|
6
6
|
Requires-Python: >=3.11
|
|
@@ -33,6 +33,7 @@ Requires-Dist: ruff>=0.11.5 ; extra == "dev"
|
|
|
33
33
|
Requires-Dist: bleak>=2.0.0 ; extra == "experimental"
|
|
34
34
|
Requires-Dist: Flask>=3.1.1 ; extra == "extended"
|
|
35
35
|
Requires-Dist: openpyxl>=3.1.5 ; extra == "extended"
|
|
36
|
+
Requires-Dist: flask-cors>=6.0.2 ; extra == "extended"
|
|
36
37
|
Project-URL: Documentation, https://github.com/retothuerer/LabFREED?tab=readme-ov-file#readme
|
|
37
38
|
Project-URL: Homepage, https://github.com/retothuerer/LabFREED
|
|
38
39
|
Project-URL: Source, https://github.com/retothuerer/LabFREED
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
labfreed/__init__.py,sha256=
|
|
1
|
+
labfreed/__init__.py,sha256=yGo_7_bwgMO8teUgi_H0AFb41hJ10wspYslKvwNtWlg,339
|
|
2
2
|
labfreed/labfreed_infrastructure.py,sha256=ss1PyJl-7Es-lEcxptmdYI9kDAHmh7HB_tAGkPC6UVs,10173
|
|
3
3
|
labfreed/labfreed_extended/app/app_infrastructure.py,sha256=1867Nq40c8Q4bFyRv48vTIFDXoPeZTfYij9PSog6fkE,4427
|
|
4
4
|
labfreed/labfreed_extended/app/formatted_print.py,sha256=DcwWP0ix1e_wYNIdceIp6cETkJdG2DqpU8Gs3aZAL40,1930
|
|
5
5
|
labfreed/labfreed_extended/app/pac_info/pac_info.py,sha256=HWTYA20cIBpwUl4eRs5cNghCHs3_SOS9yARt11YN0XY,9078
|
|
6
|
-
labfreed/labfreed_extended/pac_issuer_lib/app_factory.py,sha256=
|
|
6
|
+
labfreed/labfreed_extended/pac_issuer_lib/app_factory.py,sha256=bSe3BaD9bcUAAdpLu9LrDgxwcqddmNI0GrkWQ0cVLvY,20470
|
|
7
7
|
labfreed/labfreed_extended/pac_issuer_lib/lib/attribute.py,sha256=Nu2NpaPbFIzDMa17oESJK9pZ3Qv86H3fMmuY5kWre7M,7182
|
|
8
8
|
labfreed/labfreed_extended/pac_issuer_lib/lib/bp_landing_page.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
labfreed/labfreed_extended/pac_issuer_lib/lib/utils.py,sha256=aUdJGFLx1HDDXGRqMVJuGn7uqzNXHrEb7cCA-nX920Y,651
|
|
@@ -41,7 +41,7 @@ labfreed/pac_attributes/api_data_models/response.py,sha256=8OhqMrZJSzQlSTG9bES7b
|
|
|
41
41
|
labfreed/pac_attributes/api_data_models/server_capabilities_response.py,sha256=ypDm4f8xZZl036fp8PuIe6lJHNW5Zg1fItgUlnV75V0,178
|
|
42
42
|
labfreed/pac_attributes/client/client.py,sha256=5d-G-1tHOx2PXW7KP366tWr4k4F1ykGHX9e-bauF6_w,7149
|
|
43
43
|
labfreed/pac_attributes/client/client_attribute_group.py,sha256=lZXbMU_Yp7Q1iKc5WRqS6pzEz_mtwZaQ5fYZqJA6784,375
|
|
44
|
-
labfreed/pac_attributes/pythonic/attribute_server_factory.py,sha256=
|
|
44
|
+
labfreed/pac_attributes/pythonic/attribute_server_factory.py,sha256=myomxR9e5zOKmUpA5HSaarsUzHnotwDZ-QcGfe4ocRU,7830
|
|
45
45
|
labfreed/pac_attributes/pythonic/excel_attribute_data_source.py,sha256=IBBGpHgt-HiZeB6dsLcjtqUPP2JdViLz2QMIDMjzmME,8467
|
|
46
46
|
labfreed/pac_attributes/pythonic/py_attributes.py,sha256=9ATeMia7PXZjRrpDouC5siDZ-dbDa6EPhyl7xCEDIG8,7552
|
|
47
47
|
labfreed/pac_attributes/pythonic/py_dict_data_source.py,sha256=nAz6GA7Xx_0IORPPpt_Wl3sFJa1Q5Fnq5vdf1uQiJF8,531
|
|
@@ -62,7 +62,7 @@ labfreed/pac_id/url_serializer.py,sha256=01LB30pNMBtv2rYHsiE_4Ga2iVA515Boj4ikOIY
|
|
|
62
62
|
labfreed/pac_id_resolver/__init__.py,sha256=RNBlrDOSR42gmSNH9wJVhK_xwEX45cvTKVgWW2bjh7Q,113
|
|
63
63
|
labfreed/pac_id_resolver/cit_v1.py,sha256=JGlEH2d9awEu3HxPW7vu0uj4ZC3B02IdmFg7aJ4axQw,9833
|
|
64
64
|
labfreed/pac_id_resolver/resolver.py,sha256=anqteWexD7w78wzd1TjT06enkDIU-P-7NVKNWiASXLU,4127
|
|
65
|
-
labfreed/pac_id_resolver/resolver_config.py,sha256=
|
|
65
|
+
labfreed/pac_id_resolver/resolver_config.py,sha256=cy11oznl5zppcqHPPSb5u9BbmM6Xz97JL6hAyANsKfk,12558
|
|
66
66
|
labfreed/pac_id_resolver/resolver_config_common.py,sha256=JGbgT2YSBc3NQ5x9CV3diqYZgpDGWygGPd5flk4-hWk,2958
|
|
67
67
|
labfreed/pac_id_resolver/services.py,sha256=IGEueWh2UeXKh6dIOs_ZNTvzguHPVuNB7SmV-FHPYns,2650
|
|
68
68
|
labfreed/qr/__init__.py,sha256=fdKwP6W2Js--yMbBUdn-g_2uq2VqPpfQJeDLHsMDO-Y,61
|
|
@@ -90,7 +90,7 @@ labfreed/well_known_keys/labfreed/well_known_keys.py,sha256=p-hXwEEIs7p2SKn9DQeL
|
|
|
90
90
|
labfreed/well_known_keys/unece/UneceUnits.json,sha256=kwfQSp_nTuWbADfBBgqTWrvPl6XtM5SedEVLbMJrM7M,898953
|
|
91
91
|
labfreed/well_known_keys/unece/__init__.py,sha256=MSP9lmjg9_D9iqG9Yq2_ajYfQSNS9wIT7FXA1c--59M,122
|
|
92
92
|
labfreed/well_known_keys/unece/unece_units.py,sha256=J20d64H69qKDE3XlGdJoXIIh0G-d0jKoiIDsg9an5pk,1655
|
|
93
|
-
labfreed-1.0.
|
|
94
|
-
labfreed-1.0.
|
|
95
|
-
labfreed-1.0.
|
|
96
|
-
labfreed-1.0.
|
|
93
|
+
labfreed-1.0.0b31.dist-info/licenses/LICENSE,sha256=gHFOv9FRKHxO8cInP3YXyPoJnuNeqrvcHjaE_wPSsQ8,1100
|
|
94
|
+
labfreed-1.0.0b31.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
95
|
+
labfreed-1.0.0b31.dist-info/METADATA,sha256=uKC23ulmwl-ZjKvUIqWowOToUUQpi7uvlEA0AWFCR14,19913
|
|
96
|
+
labfreed-1.0.0b31.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|