python3-commons 0.9.22__py3-none-any.whl → 0.10.0__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 python3-commons might be problematic. Click here for more details.
- python3_commons/audit.py +1 -1
- python3_commons/conf.py +4 -3
- python3_commons/object_storage.py +5 -5
- {python3_commons-0.9.22.dist-info → python3_commons-0.10.0.dist-info}/METADATA +1 -1
- {python3_commons-0.9.22.dist-info → python3_commons-0.10.0.dist-info}/RECORD +9 -9
- {python3_commons-0.9.22.dist-info → python3_commons-0.10.0.dist-info}/WHEEL +0 -0
- {python3_commons-0.9.22.dist-info → python3_commons-0.10.0.dist-info}/licenses/AUTHORS.rst +0 -0
- {python3_commons-0.9.22.dist-info → python3_commons-0.10.0.dist-info}/licenses/LICENSE +0 -0
- {python3_commons-0.9.22.dist-info → python3_commons-0.10.0.dist-info}/top_level.txt +0 -0
python3_commons/audit.py
CHANGED
|
@@ -138,7 +138,7 @@ logger = logging.getLogger(__name__)
|
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
async def write_audit_data(settings: S3Settings, key: str, data: bytes):
|
|
141
|
-
if settings.
|
|
141
|
+
if settings.aws_secret_access_key:
|
|
142
142
|
try:
|
|
143
143
|
absolute_path = object_storage.get_absolute_path(f'audit/{key}')
|
|
144
144
|
|
python3_commons/conf.py
CHANGED
|
@@ -64,10 +64,11 @@ class DBSettings(BaseSettings):
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
class S3Settings(BaseSettings):
|
|
67
|
+
aws_region: str | None = None
|
|
68
|
+
aws_access_key_id: SecretStr | None = None
|
|
69
|
+
aws_secret_access_key: SecretStr | None = None
|
|
70
|
+
|
|
67
71
|
s3_endpoint_url: str | None = None
|
|
68
|
-
s3_region_name: str | None = Field(default=None, alias='AWS_REGION')
|
|
69
|
-
s3_access_key_id: SecretStr | None = None
|
|
70
|
-
s3_secret_access_key: SecretStr | None = None
|
|
71
72
|
s3_addressing_style: Literal['path', 'virtual'] = 'virtual'
|
|
72
73
|
s3_secure: bool = True
|
|
73
74
|
s3_bucket: str | None = None
|
|
@@ -25,7 +25,7 @@ class ObjectStorage(metaclass=SingletonMeta):
|
|
|
25
25
|
def __init__(self, settings: S3Settings):
|
|
26
26
|
self._session = aiobotocore.session.get_session()
|
|
27
27
|
config = {
|
|
28
|
-
'region_name': settings.
|
|
28
|
+
'region_name': settings.aws_region,
|
|
29
29
|
'use_ssl': settings.s3_secure,
|
|
30
30
|
'verify': settings.s3_cert_verify,
|
|
31
31
|
'config': Config(s3={'addressing_style': settings.s3_addressing_style}, signature_version='s3v4'),
|
|
@@ -34,11 +34,11 @@ class ObjectStorage(metaclass=SingletonMeta):
|
|
|
34
34
|
if s3_endpoint_url := settings.s3_endpoint_url:
|
|
35
35
|
config['endpoint_url'] = s3_endpoint_url
|
|
36
36
|
|
|
37
|
-
if
|
|
38
|
-
config['aws_access_key_id'] =
|
|
37
|
+
if aws_access_key_id := settings.aws_access_key_id:
|
|
38
|
+
config['aws_access_key_id'] = aws_access_key_id.get_secret_value()
|
|
39
39
|
|
|
40
|
-
if
|
|
41
|
-
config['aws_secret_access_key'] =
|
|
40
|
+
if aws_secret_access_key := settings.aws_secret_access_key:
|
|
41
|
+
config['aws_secret_access_key'] = aws_secret_access_key.get_secret_value()
|
|
42
42
|
|
|
43
43
|
self._config = config
|
|
44
44
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
python3_commons/__init__.py,sha256=0KgaYU46H_IMKn-BuasoRN3C4Hi45KlkHHoPbU9cwiA,189
|
|
2
2
|
python3_commons/api_client.py,sha256=0PE8iYW5zq7n89veC6afSkwj_fzD_nldBc5wdXyg5jo,5266
|
|
3
|
-
python3_commons/audit.py,sha256=
|
|
3
|
+
python3_commons/audit.py,sha256=vPwGR0s7RoDpxhK1Q2N44T1pdannxmSgpqcA5hn5bPE,6078
|
|
4
4
|
python3_commons/auth.py,sha256=fWfoh5665F-YnGTgG9wDAosYIM9vFoTsQXEcCyzD72M,2951
|
|
5
5
|
python3_commons/cache.py,sha256=Hib86F1k1SviF-a2RyoTxRrFi0XV2KaWOfBi5TlOu-g,7697
|
|
6
|
-
python3_commons/conf.py,sha256=
|
|
6
|
+
python3_commons/conf.py,sha256=77nqTBL5bAk8iOEdtdHWjYx8wLKtHBj6TCylSo3BWQk,2392
|
|
7
7
|
python3_commons/fs.py,sha256=dn8ZcwsQf9xcAEg6neoxLN6IzJbWpprfm8wV8S55BL0,337
|
|
8
8
|
python3_commons/helpers.py,sha256=utcorGvXvZLsC4H_H8WGwzeIMgCOCHac2jbKpVCeixA,3928
|
|
9
|
-
python3_commons/object_storage.py,sha256=
|
|
9
|
+
python3_commons/object_storage.py,sha256=G8IdaHQwMo-RqIWigkM2XBnTt5ZV0jjajqjsHN04alY,6570
|
|
10
10
|
python3_commons/permissions.py,sha256=bhjTp-tq-oaTGFMHNnSBlcVX5XQCTL0nWcu6SdPEAB4,1555
|
|
11
11
|
python3_commons/db/__init__.py,sha256=PZTIC0RPzYzZ2Fh4HeyKtYIHaUPB7A92yeOK--PGxnw,2942
|
|
12
12
|
python3_commons/db/helpers.py,sha256=n56yYCE0fvzvU7nL1936NfZhbaQmvfumzRsGimBlNV4,1776
|
|
@@ -22,9 +22,9 @@ python3_commons/serializers/common.py,sha256=VkA7C6wODvHk0QBXVX_x2JieDstihx3U__U
|
|
|
22
22
|
python3_commons/serializers/json.py,sha256=Dae0gouk9jiUOkmh8z1AcTIHD52OgBn2aXK9JLKMMms,718
|
|
23
23
|
python3_commons/serializers/msgpack.py,sha256=AwzBSUdbdq8yYdGzmEsiWw0bnL9XRQFa1Vh-nt2s56k,1499
|
|
24
24
|
python3_commons/serializers/msgspec.py,sha256=yp3LvsxDUTIv__3AaLed5ddZ0rHm7BYqmrrehVAJb14,3000
|
|
25
|
-
python3_commons-0.
|
|
26
|
-
python3_commons-0.
|
|
27
|
-
python3_commons-0.
|
|
28
|
-
python3_commons-0.
|
|
29
|
-
python3_commons-0.
|
|
30
|
-
python3_commons-0.
|
|
25
|
+
python3_commons-0.10.0.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
|
|
26
|
+
python3_commons-0.10.0.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
|
|
27
|
+
python3_commons-0.10.0.dist-info/METADATA,sha256=8HSknMK7gYtiMVUjjdB6lBS8FaiS6w9l5tOqr-28Lzg,1134
|
|
28
|
+
python3_commons-0.10.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
29
|
+
python3_commons-0.10.0.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
|
|
30
|
+
python3_commons-0.10.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|