erioon 0.1.0__py3-none-any.whl → 0.1.1__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.
- erioon/client.py +10 -12
- {erioon-0.1.0.dist-info → erioon-0.1.1.dist-info}/METADATA +1 -1
- {erioon-0.1.0.dist-info → erioon-0.1.1.dist-info}/RECORD +6 -6
- {erioon-0.1.0.dist-info → erioon-0.1.1.dist-info}/LICENSE +0 -0
- {erioon-0.1.0.dist-info → erioon-0.1.1.dist-info}/WHEEL +0 -0
- {erioon-0.1.0.dist-info → erioon-0.1.1.dist-info}/top_level.txt +0 -0
erioon/client.py
CHANGED
@@ -79,14 +79,12 @@ class ErioonClient:
|
|
79
79
|
raise Exception("Invalid account")
|
80
80
|
|
81
81
|
def _update_metadata_fields(self):
|
82
|
-
"""
|
83
|
-
Updates internal fields like user_id, database name, and cluster info
|
84
|
-
from login metadata.
|
85
|
-
"""
|
86
82
|
if self.login_metadata:
|
87
83
|
self.user_id = self.login_metadata.get("_id")
|
88
|
-
self.database = self.login_metadata.get("database")
|
89
84
|
self.cluster = self.login_metadata.get("cluster")
|
85
|
+
self.database = self.login_metadata.get("database")
|
86
|
+
self.sas_tokens = self.login_metadata.get("sas_tokens", {})
|
87
|
+
|
90
88
|
|
91
89
|
def _clear_cached_token(self):
|
92
90
|
"""
|
@@ -142,10 +140,6 @@ class ErioonClient:
|
|
142
140
|
raise e
|
143
141
|
|
144
142
|
def _get_database_info(self, db_id):
|
145
|
-
"""
|
146
|
-
Sends a POST request to fetch metadata for a given database ID.
|
147
|
-
Returns a `Database` instance initialized with SAS URL and metadata.
|
148
|
-
"""
|
149
143
|
payload = {"user_id": self.user_id, "db_id": db_id}
|
150
144
|
headers = {"Content-Type": "application/json"}
|
151
145
|
|
@@ -154,8 +148,12 @@ class ErioonClient:
|
|
154
148
|
if response.status_code == 200:
|
155
149
|
db_info = response.json()
|
156
150
|
|
157
|
-
|
158
|
-
|
151
|
+
sas_info = self.sas_tokens.get(db_id)
|
152
|
+
if not sas_info:
|
153
|
+
raise Exception(f"No SAS token info found for database id {db_id}")
|
154
|
+
|
155
|
+
container_url = sas_info.get("container_url")
|
156
|
+
sas_token = sas_info.get("sas_token")
|
159
157
|
|
160
158
|
if not container_url or not sas_token:
|
161
159
|
raise Exception("Missing SAS URL components for storage access")
|
@@ -179,7 +177,7 @@ class ErioonClient:
|
|
179
177
|
except Exception:
|
180
178
|
error_msg = response.text
|
181
179
|
raise Exception(error_msg)
|
182
|
-
|
180
|
+
|
183
181
|
def __str__(self):
|
184
182
|
"""
|
185
183
|
Returns user_id or error string when printed.
|
@@ -1,5 +1,5 @@
|
|
1
1
|
erioon/auth.py,sha256=McktLrdxsWVyxhiFuk0qFokx63RI1yB8_qP3Mo7uZCI,724
|
2
|
-
erioon/client.py,sha256=
|
2
|
+
erioon/client.py,sha256=uxnkd86HQqqIznjby-4wEPavnVd0PxbyHILS9TXxQ3Q,6841
|
3
3
|
erioon/collection.py,sha256=EyNHpoOEBBMH29gMy51zzR338z2uI79kl0_ZB7laHpM,9700
|
4
4
|
erioon/create.py,sha256=ilx0e3urK0lfYiaM3CSUe3Bf3l7GhHuwZyz0Z6ij0ok,10202
|
5
5
|
erioon/database.py,sha256=hj5sgaEDXmItg4aeZlO3MP6_hV3jeS-d9qycEnw7xHQ,2449
|
@@ -8,8 +8,8 @@ erioon/functions.py,sha256=LWrqslAok-l9QlMEynT-Pvksy5hwkogWoeK5rJf464A,12479
|
|
8
8
|
erioon/ping.py,sha256=BC0vZiane5YgCc07syZA5dKFcqbq1_Z8BUTmvIGRPcs,1829
|
9
9
|
erioon/read.py,sha256=kzzqqRuLtYmlniAnkd2xeWNZm4AwMQ2oAMcpKt6JhcQ,10580
|
10
10
|
erioon/update.py,sha256=E3d-dYJWh12bcAHx_vT9NFTscF__hViY3K9ZssN7At4,6060
|
11
|
-
erioon-0.1.
|
12
|
-
erioon-0.1.
|
13
|
-
erioon-0.1.
|
14
|
-
erioon-0.1.
|
15
|
-
erioon-0.1.
|
11
|
+
erioon-0.1.1.dist-info/LICENSE,sha256=xwnq3DNlZpQyteOK9HvtHRhMdYviXTTaCDljEodFRnQ,569
|
12
|
+
erioon-0.1.1.dist-info/METADATA,sha256=X5gjWeQ3dVSzio8GjAYWEjPcAerHeokqRoqZaQ-_PX4,715
|
13
|
+
erioon-0.1.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
14
|
+
erioon-0.1.1.dist-info/top_level.txt,sha256=yjKEg85X5Q5ot46IMML_xukvIGG5YfdrLWcemjalItc,7
|
15
|
+
erioon-0.1.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|