pmdb_utils 0.3.2__tar.gz → 0.3.4__tar.gz
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.
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/PKG-INFO +1 -1
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/pyproject.toml +1 -1
- pmdb_utils-0.3.4/src/pmdb_utils/dataacceslayer/storageoptions.py +49 -0
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/.gitignore +0 -0
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/.python-version +0 -0
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/README.md +0 -0
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/src/pmdb_utils/__init__.py +0 -0
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/src/pmdb_utils/api_related.py +0 -0
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/src/pmdb_utils/dataacceslayer/__init__.py +0 -0
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/src/pmdb_utils/dataacceslayer/storageclient.py +0 -0
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/src/pmdb_utils/key_vault_client.py +0 -0
- {pmdb_utils-0.3.2 → pmdb_utils-0.3.4}/uv.lock +0 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class StorageOptions:
|
|
5
|
+
"""
|
|
6
|
+
Configuration class for AWS/MinIO storage credentials and endpoints.
|
|
7
|
+
Allows initialization from arguments or environment variables.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
access_key_id=None,
|
|
13
|
+
secret_access_key=None,
|
|
14
|
+
endpoint_url=None,
|
|
15
|
+
allow_http="true",
|
|
16
|
+
):
|
|
17
|
+
"""
|
|
18
|
+
Initialize DeltaStorageOptions.
|
|
19
|
+
Args:
|
|
20
|
+
aws_access_key_id (str, optional): AWS access key ID. Defaults to None.
|
|
21
|
+
aws_secret_access_key (str, optional): AWS secret access key. Defaults to None.
|
|
22
|
+
aws_endpoint_url (str, optional): AWS/MinIO endpoint URL. Defaults to None.
|
|
23
|
+
region (str, optional): AWS region. Defaults to None.
|
|
24
|
+
allow_http (str, optional): Allow HTTP connections. Defaults to "true".
|
|
25
|
+
"""
|
|
26
|
+
self.access_key_id = access_key_id or os.getenv("MINIO_ROOT_USER")
|
|
27
|
+
self.secret_access_key = secret_access_key or os.getenv("MINIO_ROOT_PASSWORD")
|
|
28
|
+
self.endpoint_url = endpoint_url or os.getenv("MINIO_ENDPOINT_URL")
|
|
29
|
+
self.allow_http = allow_http
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def minio(self) -> dict:
|
|
33
|
+
"""
|
|
34
|
+
Return a dictionary of credentials and endpoint for MinIO/AWS SDKs.
|
|
35
|
+
Returns:
|
|
36
|
+
dict: Dictionary with keys 'aws_access_key_id', 'aws_secret_access_key', 'endpoint_url', 'allow_http'.
|
|
37
|
+
"""
|
|
38
|
+
if (
|
|
39
|
+
not self.access_key_id
|
|
40
|
+
or not self.secret_access_key
|
|
41
|
+
or not self.endpoint_url
|
|
42
|
+
):
|
|
43
|
+
raise ValueError("AWS credentials and endpoint URL must be provided.")
|
|
44
|
+
return {
|
|
45
|
+
"aws_access_key_id": self.access_key_id,
|
|
46
|
+
"aws_secret_access_key": self.secret_access_key,
|
|
47
|
+
"endpoint_url": self.endpoint_url,
|
|
48
|
+
"allow_http": self.allow_http,
|
|
49
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|