python3-commons 0.23.0__py3-none-any.whl → 0.23.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/audit.py +1 -1
- python3_commons/conf.py +4 -5
- python3_commons/object_storage.py +6 -6
- {python3_commons-0.23.0.dist-info → python3_commons-0.23.2.dist-info}/METADATA +1 -1
- {python3_commons-0.23.0.dist-info → python3_commons-0.23.2.dist-info}/RECORD +11 -11
- python3_commons-0.23.2.dist-info/scm_version.json +8 -0
- python3_commons-0.23.0.dist-info/scm_version.json +0 -8
- {python3_commons-0.23.0.dist-info → python3_commons-0.23.2.dist-info}/WHEEL +0 -0
- {python3_commons-0.23.0.dist-info → python3_commons-0.23.2.dist-info}/licenses/AUTHORS.rst +0 -0
- {python3_commons-0.23.0.dist-info → python3_commons-0.23.2.dist-info}/licenses/LICENSE +0 -0
- {python3_commons-0.23.0.dist-info → python3_commons-0.23.2.dist-info}/scm_file_list.json +0 -0
- {python3_commons-0.23.0.dist-info → python3_commons-0.23.2.dist-info}/top_level.txt +0 -0
python3_commons/audit.py
CHANGED
|
@@ -26,7 +26,7 @@ logger = logging.getLogger(__name__)
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
async def write_audit_data(settings: S3Settings, key: str, data: bytes) -> None:
|
|
29
|
-
if settings.
|
|
29
|
+
if settings.s3_secret_access_key:
|
|
30
30
|
try:
|
|
31
31
|
await object_storage.put_object(settings.s3_bucket, f'audit/{key}', io.BytesIO(data), len(data))
|
|
32
32
|
except Exception:
|
python3_commons/conf.py
CHANGED
|
@@ -84,15 +84,14 @@ class DBSettings(BaseSettings):
|
|
|
84
84
|
|
|
85
85
|
|
|
86
86
|
class S3Settings(BaseSettings):
|
|
87
|
-
|
|
88
|
-
aws_access_key_id: SecretStr | None = None
|
|
89
|
-
aws_secret_access_key: SecretStr | None = None
|
|
90
|
-
|
|
87
|
+
s3_access_key_id: SecretStr | None = None
|
|
91
88
|
s3_addressing_style: Literal['path', 'virtual'] = 'virtual'
|
|
92
|
-
|
|
89
|
+
s3_allow_http: bool = False
|
|
93
90
|
s3_bucket: str | None = None
|
|
94
91
|
s3_bucket_root: str | None = None
|
|
95
92
|
s3_cert_verify: bool = True
|
|
93
|
+
s3_region: str | None = None
|
|
94
|
+
s3_secret_access_key: SecretStr | None = None
|
|
96
95
|
|
|
97
96
|
|
|
98
97
|
settings = CommonSettings()
|
|
@@ -44,17 +44,17 @@ class ObjectStorage(metaclass=SingletonMeta):
|
|
|
44
44
|
def __init__(self, settings: S3Settings) -> None:
|
|
45
45
|
self._session = aiobotocore.session.get_session()
|
|
46
46
|
config = {
|
|
47
|
-
'region_name': settings.
|
|
48
|
-
'use_ssl': settings.
|
|
47
|
+
'region_name': settings.s3_region,
|
|
48
|
+
'use_ssl': not settings.s3_allow_http,
|
|
49
49
|
'verify': settings.s3_cert_verify,
|
|
50
50
|
'config': Config(s3={'addressing_style': settings.s3_addressing_style}, signature_version='s3v4'),
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
if
|
|
54
|
-
config['aws_access_key_id'] =
|
|
53
|
+
if s3_access_key_id := settings.s3_access_key_id:
|
|
54
|
+
config['aws_access_key_id'] = s3_access_key_id.get_secret_value()
|
|
55
55
|
|
|
56
|
-
if
|
|
57
|
-
config['aws_secret_access_key'] =
|
|
56
|
+
if s3_secret_access_key := settings.s3_secret_access_key:
|
|
57
|
+
config['aws_secret_access_key'] = s3_secret_access_key.get_secret_value()
|
|
58
58
|
|
|
59
59
|
self._config = config
|
|
60
60
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
python3_commons/__init__.py,sha256=0KgaYU46H_IMKn-BuasoRN3C4Hi45KlkHHoPbU9cwiA,189
|
|
2
2
|
python3_commons/api_client.py,sha256=SThSzLhZJxVsKP8n1xDMCczA7SBFbxGFgrhKy9k-9_g,5532
|
|
3
3
|
python3_commons/async_functools.py,sha256=A2HvwFzZHxOWTp4IQM5UiBY2yg1S_0U1CWra5BWK0gk,9101
|
|
4
|
-
python3_commons/audit.py,sha256=
|
|
4
|
+
python3_commons/audit.py,sha256=yMhNFHYO77efNjMi_Th0SEnIrTAqI0ZBnuiDzT4lEPE,2607
|
|
5
5
|
python3_commons/auth.py,sha256=s928lYwpyX03BDTo1R6LpOgHiUSrjVrd1OVgTjvIiQU,8279
|
|
6
6
|
python3_commons/cache.py,sha256=lowiXJqFgFy1Yg86wi9IhuoNqIUGP6nc5eNibmf0dfY,8018
|
|
7
|
-
python3_commons/conf.py,sha256=
|
|
7
|
+
python3_commons/conf.py,sha256=ZUSVe9KMuwM520QdIWoQ8AXVH2BuujXM8CblCkAw1Ts,3102
|
|
8
8
|
python3_commons/exceptions.py,sha256=EGjHZVBnsM6CeBfPMqhL0IPMKjDJ_2-Z-aSPXwq91LE,36
|
|
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=EkDPTw373UdWp6h3klOYygizx-0uyXT8Sim-zRCbB3g,7176
|
|
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=GP_9GXZUUgNvehFUCsXTIWThIMFW60Hwve7sve2oPgM,10188
|
|
@@ -27,11 +27,11 @@ 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.23.
|
|
31
|
-
python3_commons-0.23.
|
|
32
|
-
python3_commons-0.23.
|
|
33
|
-
python3_commons-0.23.
|
|
34
|
-
python3_commons-0.23.
|
|
35
|
-
python3_commons-0.23.
|
|
36
|
-
python3_commons-0.23.
|
|
37
|
-
python3_commons-0.23.
|
|
30
|
+
python3_commons-0.23.2.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
|
|
31
|
+
python3_commons-0.23.2.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
|
|
32
|
+
python3_commons-0.23.2.dist-info/METADATA,sha256=DiS5NdrdBWckuJF4FMbNsBTA01p50yNtxYI3IySlxLs,9471
|
|
33
|
+
python3_commons-0.23.2.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
|
|
34
|
+
python3_commons-0.23.2.dist-info/scm_file_list.json,sha256=_VHernCbTfExHtROxsobMxaHoIS1TJJ6S-8WTB3Aqvs,2549
|
|
35
|
+
python3_commons-0.23.2.dist-info/scm_version.json,sha256=V5_yyvMlZ-Exjpq47-76hleDNXWeiKea9RhDoprLxdI,161
|
|
36
|
+
python3_commons-0.23.2.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
|
|
37
|
+
python3_commons-0.23.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|