python3-commons 0.20.0__py3-none-any.whl → 0.20.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/auth.py CHANGED
@@ -77,7 +77,7 @@ class OIDCClient:
77
77
  client_secret: str | None = None,
78
78
  *,
79
79
  timeout: float = 10.0,
80
- verify_ssl: bool = True,
80
+ verify_cert: bool = True,
81
81
  connection_limit: int = 100,
82
82
  authority_internal_host: HttpUrl | None = None,
83
83
  ) -> None:
@@ -92,7 +92,7 @@ class OIDCClient:
92
92
  self._connection_limit = connection_limit
93
93
  self._session: aiohttp.ClientSession | None = None
94
94
  self._timeout = timeout
95
- self._verify_ssl = verify_ssl
95
+ self._verify_cert = verify_cert
96
96
 
97
97
  self._config: Mapping[str, Any] | None = None
98
98
  self._jwks: Mapping[str, Any] | None = None
@@ -105,7 +105,7 @@ class OIDCClient:
105
105
  if self._session:
106
106
  return self._session
107
107
 
108
- connector = aiohttp.TCPConnector(verify_ssl=self._verify_ssl, limit=self._connection_limit)
108
+ connector = aiohttp.TCPConnector(verify_ssl=self._verify_cert, limit=self._connection_limit)
109
109
  timeout = aiohttp.ClientTimeout(total=self._timeout)
110
110
  session = aiohttp.ClientSession(connector=connector, timeout=timeout)
111
111
  self._session = session
python3_commons/conf.py CHANGED
@@ -29,6 +29,9 @@ class OIDCSettings(BaseSettings):
29
29
  'email',
30
30
  )
31
31
  audience: StringSeq | str | None = None
32
+ verify_cert: bool = True
33
+ timeout: float = 10
34
+ connection_limit: int = 100
32
35
 
33
36
 
34
37
  class ValkeySettings(BaseSettings):
@@ -55,6 +58,8 @@ class DBSettings(BaseSettings):
55
58
  max_overflow: int = 0
56
59
  pool_timeout: int = 30
57
60
  pool_recycle: int = 1800 # 30 minutes
61
+ pool_pre_ping: bool = True
62
+ statement_timeout: int = 30
58
63
 
59
64
  @model_validator(mode='after')
60
65
  def build_dsn_if_missing(self) -> DBSettings:
@@ -91,7 +96,6 @@ class S3Settings(BaseSettings):
91
96
 
92
97
 
93
98
  settings = CommonSettings()
94
- oidc_settings = OIDCSettings()
95
99
  valkey_settings = ValkeySettings()
96
100
  db_settings = DBSettings()
97
101
  s3_settings = S3Settings()
@@ -43,9 +43,16 @@ class AsyncSessionManager:
43
43
  'max_overflow': db_config.max_overflow,
44
44
  'pool_timeout': db_config.pool_timeout,
45
45
  'pool_recycle': db_config.pool_recycle,
46
+ 'pool_pre_ping': db_config.pool_pre_ping,
46
47
  }
47
48
 
48
- return async_engine_from_config(configuration, prefix='')
49
+ return async_engine_from_config(
50
+ configuration,
51
+ prefix='',
52
+ connect_args={
53
+ 'timeout': 5, # asyncpg timeout
54
+ },
55
+ )
49
56
 
50
57
  def get_engine(self, name: str) -> AsyncEngine:
51
58
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python3-commons
3
- Version: 0.20.0
3
+ Version: 0.20.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
@@ -2,9 +2,9 @@ python3_commons/__init__.py,sha256=0KgaYU46H_IMKn-BuasoRN3C4Hi45KlkHHoPbU9cwiA,1
2
2
  python3_commons/api_client.py,sha256=yerFJNY_SHhYo9FGLv29oHVIGgeXDNzTzMNfFYZpZ0w,5501
3
3
  python3_commons/async_functools.py,sha256=A2HvwFzZHxOWTp4IQM5UiBY2yg1S_0U1CWra5BWK0gk,9101
4
4
  python3_commons/audit.py,sha256=uGoCwenDJ0Gdwbr_VNOZm5scT8luxW1weprJbbMoHo0,2608
5
- python3_commons/auth.py,sha256=iN5Iu8yDk2ClPjQuyxDudWICnjX6gt8dOw5e0kXoRdc,7657
5
+ python3_commons/auth.py,sha256=xgI9CNuqAUpYNkXHBWmNi3d0AAEpR5BAepJvPCmArWs,7661
6
6
  python3_commons/cache.py,sha256=lowiXJqFgFy1Yg86wi9IhuoNqIUGP6nc5eNibmf0dfY,8018
7
- python3_commons/conf.py,sha256=5WzGLwCixc5SMdWvq3j4YBcytqYwcTcCJkFzSPp8fK4,2984
7
+ python3_commons/conf.py,sha256=1HYtNkNBQc5IIABzhH3kz7GnLeF7rj5aNcOoW8xbEa4,3101
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
@@ -12,7 +12,7 @@ python3_commons/helpers.py,sha256=d1xdxiOyskwq_rzSprB7e7Fo8Hp0uDlWSmRWFL4vC6A,49
12
12
  python3_commons/object_storage.py,sha256=2l8v1mDB5WWN6jhxH2t5xmHBXaVPRJl0z44wExmlO80,7175
13
13
  python3_commons/permissions.py,sha256=gaMKSWg0MgPQTdP1voll4ItXcblXku9BlD0Lq3Xv64U,1724
14
14
  python3_commons/soap_client.py,sha256=w2lOyhhtkhwiNnHjvir8DfjGBO51XVg5rlDHyuudU2A,7169
15
- python3_commons/db/__init__.py,sha256=i60JvWiUY8kz8nEaVjc5MA1IN_P5g3tK7jX8KgcUd0Y,3105
15
+ python3_commons/db/__init__.py,sha256=Rbi6WBXTZMJzUPzyND-eASFCWaoBILkOU0-X5N_-6Jo,3285
16
16
  python3_commons/db/helpers.py,sha256=xRpWs4aVkBge6HCLjb6OLSnWc1nlV6rKGyaVhZ_x12w,2001
17
17
  python3_commons/db/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  python3_commons/db/models/auth.py,sha256=t6z_0c7l_1eB-CCdnPSV9OzJ_ymgkwD1cLpecNhQgoA,773
@@ -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.20.0.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
31
- python3_commons-0.20.0.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
32
- python3_commons-0.20.0.dist-info/METADATA,sha256=LbLpc_NPqyj1HQSCDciYLcfOk31s8RWj942uXvrrCis,2333
33
- python3_commons-0.20.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
34
- python3_commons-0.20.0.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
35
- python3_commons-0.20.0.dist-info/RECORD,,
30
+ python3_commons-0.20.2.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
31
+ python3_commons-0.20.2.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
32
+ python3_commons-0.20.2.dist-info/METADATA,sha256=HQgCqZefCAXOB8ZRHcRBaGBtibEJESj4tXkspZa0IHI,2333
33
+ python3_commons-0.20.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
34
+ python3_commons-0.20.2.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
35
+ python3_commons-0.20.2.dist-info/RECORD,,