python3-commons 0.25.0__py3-none-any.whl → 0.25.1__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.
@@ -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
- scheme = base.split('://', 1)[0] + '://' if '://' in base else ''
81
+ prefix = base[: len(base) - len(base_no_scheme)]
82
82
 
83
- return f'{scheme}{path}'
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.0
3
+ Version: 0.25.1
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,8 +12,8 @@ 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.2
16
- Requires-Dist: msgspec~=0.21.1
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"
@@ -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="my-audit-bucket/audit-logs"
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 = "my-audit-bucket/audit-logs"
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=MBZdOZg8-BWoZ_8_i4-nkjlPRYV6pDxSR7fhoQmdFX4,7321
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.0.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
31
- python3_commons-0.25.0.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
32
- python3_commons-0.25.0.dist-info/METADATA,sha256=vNf600tOvWqIn98Kc86RteZ5UhVwx0p_S2t6ZhHpsWA,15092
33
- python3_commons-0.25.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
34
- python3_commons-0.25.0.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
35
- python3_commons-0.25.0.dist-info/RECORD,,
30
+ python3_commons-0.25.1.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
31
+ python3_commons-0.25.1.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
32
+ python3_commons-0.25.1.dist-info/METADATA,sha256=y21we8Oupry9j8LwssFKGa6SqxqRG47zhIS3euqr7cE,15241
33
+ python3_commons-0.25.1.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
34
+ python3_commons-0.25.1.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
35
+ python3_commons-0.25.1.dist-info/RECORD,,