python3-commons 0.25.0__py3-none-any.whl → 0.25.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.
- python3_commons/object_storage.py +2 -2
- {python3_commons-0.25.0.dist-info → python3_commons-0.25.2.dist-info}/METADATA +13 -13
- {python3_commons-0.25.0.dist-info → python3_commons-0.25.2.dist-info}/RECORD +7 -7
- {python3_commons-0.25.0.dist-info → python3_commons-0.25.2.dist-info}/WHEEL +0 -0
- {python3_commons-0.25.0.dist-info → python3_commons-0.25.2.dist-info}/licenses/AUTHORS.rst +0 -0
- {python3_commons-0.25.0.dist-info → python3_commons-0.25.2.dist-info}/licenses/LICENSE +0 -0
- {python3_commons-0.25.0.dist-info → python3_commons-0.25.2.dist-info}/top_level.txt +0 -0
|
@@ -78,9 +78,9 @@ def build_url(work_path: str, path: str = '') -> str:
|
|
|
78
78
|
base_no_scheme = base.split('://', 1)[-1].lstrip('/')
|
|
79
79
|
|
|
80
80
|
if path.startswith(f'{base_no_scheme}/') or path == base_no_scheme:
|
|
81
|
-
|
|
81
|
+
prefix = base[: len(base) - len(base_no_scheme)]
|
|
82
82
|
|
|
83
|
-
return f'{
|
|
83
|
+
return f'{prefix}{path}'
|
|
84
84
|
|
|
85
85
|
parsed = urlparse(base)
|
|
86
86
|
base_path = parsed.path.lstrip('/')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-commons
|
|
3
|
-
Version: 0.25.
|
|
3
|
+
Version: 0.25.2
|
|
4
4
|
Summary: Re-usable Python3 code
|
|
5
5
|
Author-email: Oleg Korsak <kamikaze.is.waiting.you@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0-only
|
|
@@ -12,13 +12,13 @@ Requires-Python: <3.15.0,>=3.14.0
|
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
14
|
License-File: AUTHORS.rst
|
|
15
|
-
Requires-Dist: msgpack~=1.2.
|
|
16
|
-
Requires-Dist: msgspec~=0.
|
|
15
|
+
Requires-Dist: msgpack~=1.2.3
|
|
16
|
+
Requires-Dist: msgspec~=0.22.0
|
|
17
17
|
Requires-Dist: pydantic-settings~=2.15.0
|
|
18
18
|
Provides-Extra: all
|
|
19
19
|
Requires-Dist: python3_commons[api-client,audit,authn,authz,cache,database,object-storage,soap-client]; extra == "all"
|
|
20
20
|
Provides-Extra: api-client
|
|
21
|
-
Requires-Dist: aiohttp[speedups]<3.15.0,>=3.14.
|
|
21
|
+
Requires-Dist: aiohttp[speedups]<3.15.0,>=3.14.4; extra == "api-client"
|
|
22
22
|
Requires-Dist: certifi~=2026.7.22; extra == "api-client"
|
|
23
23
|
Requires-Dist: python3_commons[audit,object-storage]; extra == "api-client"
|
|
24
24
|
Provides-Extra: audit
|
|
@@ -26,7 +26,7 @@ Requires-Dist: lxml~=6.1.3; extra == "audit"
|
|
|
26
26
|
Requires-Dist: zeep[async]~=4.3.3; extra == "audit"
|
|
27
27
|
Requires-Dist: python3_commons[object-storage]; extra == "audit"
|
|
28
28
|
Provides-Extra: authn
|
|
29
|
-
Requires-Dist: aiohttp[speedups]<3.15.0,>=3.14.
|
|
29
|
+
Requires-Dist: aiohttp[speedups]<3.15.0,>=3.14.4; extra == "authn"
|
|
30
30
|
Requires-Dist: certifi~=2026.7.22; extra == "authn"
|
|
31
31
|
Requires-Dist: python3_commons[api-client]; extra == "authn"
|
|
32
32
|
Provides-Extra: authz
|
|
@@ -35,12 +35,12 @@ Requires-Dist: python3_commons[api-client]; extra == "authz"
|
|
|
35
35
|
Provides-Extra: cache
|
|
36
36
|
Requires-Dist: valkey[libvalkey]~=6.1.1; extra == "cache"
|
|
37
37
|
Provides-Extra: database
|
|
38
|
-
Requires-Dist: asyncpg~=0.
|
|
39
|
-
Requires-Dist: SQLAlchemy[asyncio]~=2.1.
|
|
38
|
+
Requires-Dist: asyncpg~=0.32.0; extra == "database"
|
|
39
|
+
Requires-Dist: SQLAlchemy[asyncio]~=2.1.4; extra == "database"
|
|
40
40
|
Provides-Extra: object-storage
|
|
41
41
|
Requires-Dist: object-storage-client~=0.1.12; extra == "object-storage"
|
|
42
42
|
Provides-Extra: soap-client
|
|
43
|
-
Requires-Dist: aiohttp[speedups]<3.15.0,>=3.14.
|
|
43
|
+
Requires-Dist: aiohttp[speedups]<3.15.0,>=3.14.4; extra == "soap-client"
|
|
44
44
|
Requires-Dist: certifi~=2026.7.22; extra == "soap-client"
|
|
45
45
|
Requires-Dist: lxml~=6.1.3; extra == "soap-client"
|
|
46
46
|
Requires-Dist: requests~=2.34.2; extra == "soap-client"
|
|
@@ -113,7 +113,7 @@ HTTP error status codes and network failures are mapped to built-in Python excep
|
|
|
113
113
|
Audit logging captures the outgoing request (formatted as an executable `curl` command) and the incoming response body, writing them asynchronously to Object Storage.
|
|
114
114
|
|
|
115
115
|
The destination path is resolved as follows:
|
|
116
|
-
- If `ApiClientSettings.audit_path` is configured (via `API_CLIENT_AUDIT_PATH`), it is used directly as the audit root for `api_client` (without prepending `"audit/"`)
|
|
116
|
+
- If `ApiClientSettings.audit_path` is configured (via `API_CLIENT_AUDIT_PATH`), it is used directly as the audit root for `api_client` (without prepending `"audit/"`). Note that `API_CLIENT_AUDIT_PATH` is a full object storage path like `s3://bucket/audit`:
|
|
117
117
|
`<audit_path>/<YYYY/MM/DD>/<audit_name>/<uri>/<method>_<timestamp>_<request_id>_{request,response}.txt`
|
|
118
118
|
- Otherwise, if `ObjectStorageSettings.work_path` is configured (via `OBJECT_STORAGE_WORK_PATH`), it is used as the root with `"audit/"` prepended:
|
|
119
119
|
`<work_path>/audit/<YYYY/MM/DD>/<audit_name>/<uri>/<method>_<timestamp>_<request_id>_{request,response}.txt`
|
|
@@ -123,8 +123,8 @@ The destination path is resolved as follows:
|
|
|
123
123
|
To enable audit logging:
|
|
124
124
|
1. **Configure Object Storage & S3 credentials**:
|
|
125
125
|
```bash
|
|
126
|
-
# API client audit path or Object storage root
|
|
127
|
-
export API_CLIENT_AUDIT_PATH="
|
|
126
|
+
# API client audit path (full object storage path) or Object storage root
|
|
127
|
+
export API_CLIENT_AUDIT_PATH="s3://bucket/audit"
|
|
128
128
|
# or export OBJECT_STORAGE_WORK_PATH="my-audit-bucket"
|
|
129
129
|
|
|
130
130
|
# S3 credentials
|
|
@@ -141,7 +141,7 @@ To enable audit logging:
|
|
|
141
141
|
from python3_commons.conf import api_client_settings, object_storage_settings, s3_settings
|
|
142
142
|
from pydantic import SecretStr
|
|
143
143
|
|
|
144
|
-
api_client_settings.audit_path = "
|
|
144
|
+
api_client_settings.audit_path = "s3://bucket/audit"
|
|
145
145
|
# or object_storage_settings.work_path = "my-audit-bucket"
|
|
146
146
|
|
|
147
147
|
s3_settings.access_key_id = SecretStr("your-access-key-id")
|
|
@@ -373,7 +373,7 @@ Typed application settings powered by Pydantic Settings:
|
|
|
373
373
|
- `DBSettings` / `db_settings`: PostgreSQL database settings (`DB_` environment prefix, with `DB_PASS` alias for password).
|
|
374
374
|
- `S3Settings` / `s3_settings`: S3 credentials and connection configuration (`S3_` environment prefix: `ACCESS_KEY_ID`, `SECRET_ACCESS_KEY`, `REGION`).
|
|
375
375
|
- `ObjectStorageSettings` / `object_storage_settings`: Object storage root configuration (`OBJECT_STORAGE_` environment prefix: `WORK_PATH`).
|
|
376
|
-
- `ApiClientSettings` / `api_client_settings`: API client configuration (`API_CLIENT_` environment prefix: `AUDIT_PATH`).
|
|
376
|
+
- `ApiClientSettings` / `api_client_settings`: API client configuration (`API_CLIENT_` environment prefix: `AUDIT_PATH` full object storage path like `s3://bucket/audit`).
|
|
377
377
|
- `OIDCSettings`: OpenID Connect configuration (`OIDC_` environment prefix).
|
|
378
378
|
- `ValkeySettings` / `valkey_settings`: Valkey/Redis cache configuration (`VALKEY_` environment prefix).
|
|
379
379
|
|
|
@@ -9,7 +9,7 @@ python3_commons/exceptions.py,sha256=EGjHZVBnsM6CeBfPMqhL0IPMKjDJ_2-Z-aSPXwq91LE
|
|
|
9
9
|
python3_commons/fs.py,sha256=dn8ZcwsQf9xcAEg6neoxLN6IzJbWpprfm8wV8S55BL0,337
|
|
10
10
|
python3_commons/generators.py,sha256=P6sKdCFhHT79-DZgzPU-qmwZvHg3wU8a75UFIwrycOY,1163
|
|
11
11
|
python3_commons/helpers.py,sha256=WTPu_jIOGYtxt1GYnH6sBMNDHry99AKv6ZaggGW2l1A,4986
|
|
12
|
-
python3_commons/object_storage.py,sha256=
|
|
12
|
+
python3_commons/object_storage.py,sha256=Hrk-O90GUgenoDrkULMjZqqJfu3Qc4CCCvxthkdfSM8,7304
|
|
13
13
|
python3_commons/permissions.py,sha256=gaMKSWg0MgPQTdP1voll4ItXcblXku9BlD0Lq3Xv64U,1724
|
|
14
14
|
python3_commons/soap_client.py,sha256=w2lOyhhtkhwiNnHjvir8DfjGBO51XVg5rlDHyuudU2A,7169
|
|
15
15
|
python3_commons/db/__init__.py,sha256=u-ZArdz5NQFvDLz2cjKT3_VCW3aPvEqIg1-bQ6rIDoQ,10196
|
|
@@ -27,9 +27,9 @@ python3_commons/serializers/common.py,sha256=VkA7C6wODvHk0QBXVX_x2JieDstihx3U__U
|
|
|
27
27
|
python3_commons/serializers/json.py,sha256=UPkC3ps13x2C_NxwVV-K7Ewp4VjkVHSSUkJVw5k7Wiw,712
|
|
28
28
|
python3_commons/serializers/msgpack.py,sha256=zESFBX34GsZ8rDu6Zk5V6CLT6P0mPilU0r04Ka6TblI,1474
|
|
29
29
|
python3_commons/serializers/msgspec.py,sha256=upy5CBmK66-8hYnK5bAM_sZvZY5CAqZmzCw9GIF346I,2988
|
|
30
|
-
python3_commons-0.25.
|
|
31
|
-
python3_commons-0.25.
|
|
32
|
-
python3_commons-0.25.
|
|
33
|
-
python3_commons-0.25.
|
|
34
|
-
python3_commons-0.25.
|
|
35
|
-
python3_commons-0.25.
|
|
30
|
+
python3_commons-0.25.2.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
|
|
31
|
+
python3_commons-0.25.2.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
|
|
32
|
+
python3_commons-0.25.2.dist-info/METADATA,sha256=i0Vu-W-_ERCuS-eCAeblgYdcMFODI3wH8aCfhdVfjpQ,15241
|
|
33
|
+
python3_commons-0.25.2.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
34
|
+
python3_commons-0.25.2.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
|
|
35
|
+
python3_commons-0.25.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|