altcodepro-polydb-python 2.5.4__py3-none-any.whl → 2.5.7__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.
polydb/models.py CHANGED
@@ -19,6 +19,9 @@ class CloudProvider(Enum):
19
19
  S3_COMPATIBLE = "s3_compatible"
20
20
  POSTGRESQL = "postgresql"
21
21
  BLOCKCHAIN = "blockchain"
22
+ VAULT = "vault"
23
+ KAFKA = "kafka"
24
+ RABBITMQ = "rabbitmq"
22
25
 
23
26
 
24
27
  @dataclass
@@ -86,6 +89,38 @@ class StorageConfig:
86
89
  self.name = name
87
90
 
88
91
 
92
+ class AzureKeyVaultConfig(StorageConfig):
93
+ def __init__(self, name: str = "secrets", vault_url: Optional[str] = None):
94
+ super().__init__(CloudProvider.AZURE, name)
95
+ self.vault_url = vault_url
96
+
97
+
98
+ class AWSSecretsManagerConfig(StorageConfig):
99
+ def __init__(self, name: str = "secrets", region: Optional[str] = None):
100
+ super().__init__(CloudProvider.AWS, name)
101
+ self.region = region
102
+
103
+
104
+ class GCPSecretManagerConfig(StorageConfig):
105
+ def __init__(self, name: str = "secrets", project_id: Optional[str] = None):
106
+ super().__init__(CloudProvider.GCP, name)
107
+ self.project_id = project_id
108
+
109
+
110
+ class VaultConfig(StorageConfig):
111
+ def __init__(
112
+ self,
113
+ name: str = "secrets",
114
+ url: Optional[str] = None,
115
+ token: Optional[str] = None,
116
+ mount_point: str = "secret",
117
+ ):
118
+ super().__init__(CloudProvider.VAULT, name)
119
+ self.url = url
120
+ self.token = token
121
+ self.mount_point = mount_point
122
+
123
+
89
124
  class AzureStorageConfig(StorageConfig):
90
125
  def __init__(
91
126
  self,
@@ -170,6 +205,48 @@ class VercelQueueConfig(StorageConfig):
170
205
  self.url = url
171
206
 
172
207
 
208
+ class KafkaQueueConfig(StorageConfig):
209
+ def __init__(
210
+ self,
211
+ name: str = "kafka_queue",
212
+ bootstrap_servers: str = "",
213
+ group_id: str = "",
214
+ security_protocol: str = "",
215
+ sasl_mechanism: Optional[str] = None,
216
+ sasl_plain_username: Optional[str] = None,
217
+ sasl_plain_password: Optional[str] = None,
218
+ ssl_cafile: Optional[str] = None,
219
+ ):
220
+ super().__init__(CloudProvider.KAFKA, name)
221
+ self.bootstrap_servers = bootstrap_servers
222
+ self.group_id = group_id
223
+ self.security_protocol = security_protocol
224
+ self.sasl_mechanism = sasl_mechanism
225
+ self.sasl_plain_username = sasl_plain_username
226
+ self.sasl_plain_password = sasl_plain_password
227
+ self.ssl_cafile = ssl_cafile
228
+
229
+
230
+ class RabbitMQConfig(StorageConfig):
231
+ def __init__(
232
+ self,
233
+ name: str = "rabbitmq",
234
+ url: str = "",
235
+ host: str = "",
236
+ port: int = 0,
237
+ username: str = "",
238
+ password: str = "",
239
+ virtual_host: str = "",
240
+ ):
241
+ super().__init__(CloudProvider.RABBITMQ, name)
242
+ self.url = url
243
+ self.host = host
244
+ self.port = port
245
+ self.username = username
246
+ self.password = password
247
+ self.virtual_host = virtual_host
248
+
249
+
173
250
  class BlockchainStorageConfig(StorageConfig):
174
251
  def __init__(self, name: str = "blockchain", ipfs_url: Optional[str] = None):
175
252
  super().__init__(CloudProvider.BLOCKCHAIN, name)
polydb/retry.py CHANGED
@@ -25,6 +25,13 @@ _NON_RETRYABLE_MARKERS = (
25
25
  "ResourceNotFound",
26
26
  "InvalidArgument",
27
27
  "AuthenticationFailed",
28
+ # session_vars' allow-list rejection (PostgreSQLAdapter._apply_session_vars) --
29
+ # a caller passing a session variable name outside the fixed allow-list is a
30
+ # programming error, not a transient one; the identical resolved call would
31
+ # fail identically on every retry, so this only burns the full backoff window
32
+ # for no chance of a different outcome (same reasoning already applied to the
33
+ # markers above).
34
+ "not in the allow-list",
28
35
  )
29
36
 
30
37