python3-commons 0.9.15__py3-none-any.whl → 0.9.16__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/conf.py +2 -2
- python3_commons/object_storage.py +9 -3
- {python3_commons-0.9.15.dist-info → python3_commons-0.9.16.dist-info}/METADATA +1 -1
- {python3_commons-0.9.15.dist-info → python3_commons-0.9.16.dist-info}/RECORD +8 -8
- {python3_commons-0.9.15.dist-info → python3_commons-0.9.16.dist-info}/WHEEL +0 -0
- {python3_commons-0.9.15.dist-info → python3_commons-0.9.16.dist-info}/licenses/AUTHORS.rst +0 -0
- {python3_commons-0.9.15.dist-info → python3_commons-0.9.16.dist-info}/licenses/LICENSE +0 -0
- {python3_commons-0.9.15.dist-info → python3_commons-0.9.16.dist-info}/top_level.txt +0 -0
python3_commons/conf.py
CHANGED
@@ -66,8 +66,8 @@ class DBSettings(BaseSettings):
|
|
66
66
|
class S3Settings(BaseSettings):
|
67
67
|
s3_endpoint_url: str | None = None
|
68
68
|
s3_region_name: str | None = None
|
69
|
-
s3_access_key_id: SecretStr =
|
70
|
-
s3_secret_access_key: SecretStr =
|
69
|
+
s3_access_key_id: SecretStr | None = None
|
70
|
+
s3_secret_access_key: SecretStr | None = None
|
71
71
|
s3_addressing_style: Literal['path', 'virtual'] = 'virtual'
|
72
72
|
s3_secure: bool = True
|
73
73
|
s3_bucket: str | None = None
|
@@ -25,16 +25,22 @@ class ObjectStorage(metaclass=SingletonMeta):
|
|
25
25
|
raise ValueError('s3_endpoint_url must be set')
|
26
26
|
|
27
27
|
self._session = aiobotocore.session.get_session()
|
28
|
-
|
28
|
+
config = {
|
29
29
|
'endpoint_url': settings.s3_endpoint_url,
|
30
30
|
'region_name': settings.s3_region_name,
|
31
|
-
'aws_access_key_id': settings.s3_access_key_id.get_secret_value(),
|
32
|
-
'aws_secret_access_key': settings.s3_secret_access_key.get_secret_value(),
|
33
31
|
'use_ssl': settings.s3_secure,
|
34
32
|
'verify': settings.s3_cert_verify,
|
35
33
|
'config': Config(s3={'addressing_style': settings.s3_addressing_style}, signature_version='s3v4'),
|
36
34
|
}
|
37
35
|
|
36
|
+
if s3_access_key_id := settings.s3_access_key_id:
|
37
|
+
config['aws_access_key_id'] = s3_access_key_id.get_secret_value()
|
38
|
+
|
39
|
+
if s3_secret_access_key := settings.s3_secret_access_key:
|
40
|
+
config['aws_secret_access_key'] = s3_secret_access_key.get_secret_value()
|
41
|
+
|
42
|
+
self._config = config
|
43
|
+
|
38
44
|
@asynccontextmanager
|
39
45
|
async def get_client(self) -> AsyncGenerator[S3Client, None]:
|
40
46
|
async with self._session.create_client('s3', **self._config) as client:
|
@@ -3,10 +3,10 @@ python3_commons/api_client.py,sha256=vIWt6QIbHw_x-1yKhXyJEN3Aj22KMsZwJXMsdWR7oaQ
|
|
3
3
|
python3_commons/audit.py,sha256=p4KRKt0ogkHhJSulg6j5GU-JKBBE903H2c0nuW16GtM,6083
|
4
4
|
python3_commons/auth.py,sha256=fINE7zeq-oaEk2lwkdP1KOhfCpcIBaC8P9UzXQI37J0,2922
|
5
5
|
python3_commons/cache.py,sha256=lf27LTD4Z9Iqi5GaK8jH8UC0cL9sHH8wicZ88YDp6Mg,7725
|
6
|
-
python3_commons/conf.py,sha256=
|
6
|
+
python3_commons/conf.py,sha256=UZaIMvIGF0ipgFHq2oMLF5fXqrY8F7aZZJkwASFcp08,2393
|
7
7
|
python3_commons/fs.py,sha256=wfLjybXndwLqNlOxTpm_HRJnuTcC4wbrHEOaEeCo9Wc,337
|
8
8
|
python3_commons/helpers.py,sha256=9m9Q_ImXzOsKmt7ObLUhd11vnGfwUH_KO4IwLaTMrFA,3930
|
9
|
-
python3_commons/object_storage.py,sha256=
|
9
|
+
python3_commons/object_storage.py,sha256=4m5lm7K_c_F1qdufE4aFyWmyhOmhVbYNzVx4GmtzLeA,6590
|
10
10
|
python3_commons/permissions.py,sha256=bhjTp-tq-oaTGFMHNnSBlcVX5XQCTL0nWcu6SdPEAB4,1555
|
11
11
|
python3_commons/db/__init__.py,sha256=5nArsGm17e-pelpOwAeBKy2n_Py20XqklZsNgkcJ-DQ,2947
|
12
12
|
python3_commons/db/helpers.py,sha256=PY0h08aLiGx-J54wmP3GHPCgGCcLd60rayAUnR3aWdI,1742
|
@@ -21,9 +21,9 @@ python3_commons/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
|
|
21
21
|
python3_commons/serializers/json.py,sha256=91UaXLGKGj0yPyrnuMeNrkG2GuPUgcgAsmIokUgEwpU,808
|
22
22
|
python3_commons/serializers/msgpack.py,sha256=WrvaPE187shSK8zkH4UHHMimEZNMv9RaDSwsBE2HlCw,1269
|
23
23
|
python3_commons/serializers/msgspec.py,sha256=0AliXlEl5sewi0UENjI8St5ZScXE5DNRERKzqWKy2Ps,2674
|
24
|
-
python3_commons-0.9.
|
25
|
-
python3_commons-0.9.
|
26
|
-
python3_commons-0.9.
|
27
|
-
python3_commons-0.9.
|
28
|
-
python3_commons-0.9.
|
29
|
-
python3_commons-0.9.
|
24
|
+
python3_commons-0.9.16.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
|
25
|
+
python3_commons-0.9.16.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
|
26
|
+
python3_commons-0.9.16.dist-info/METADATA,sha256=ry21SErt1Z_yGRe2PhmC_xgJBZVvPG94a_qkr84zkvc,1134
|
27
|
+
python3_commons-0.9.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
28
|
+
python3_commons-0.9.16.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
|
29
|
+
python3_commons-0.9.16.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|