erioon 0.0.5__tar.gz → 0.0.7__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.
- {erioon-0.0.5 → erioon-0.0.7}/PKG-INFO +1 -1
- {erioon-0.0.5 → erioon-0.0.7}/erioon/auth.py +2 -2
- {erioon-0.0.5 → erioon-0.0.7}/erioon/client.py +4 -2
- {erioon-0.0.5 → erioon-0.0.7}/erioon/collection.py +0 -2
- {erioon-0.0.5 → erioon-0.0.7}/erioon.egg-info/PKG-INFO +1 -1
- {erioon-0.0.5 → erioon-0.0.7}/setup.py +1 -1
- {erioon-0.0.5 → erioon-0.0.7}/LICENSE +0 -0
- {erioon-0.0.5 → erioon-0.0.7}/README.md +0 -0
- {erioon-0.0.5 → erioon-0.0.7}/erioon/database.py +0 -0
- {erioon-0.0.5 → erioon-0.0.7}/erioon.egg-info/SOURCES.txt +0 -0
- {erioon-0.0.5 → erioon-0.0.7}/erioon.egg-info/dependency_links.txt +0 -0
- {erioon-0.0.5 → erioon-0.0.7}/erioon.egg-info/requires.txt +0 -0
- {erioon-0.0.5 → erioon-0.0.7}/erioon.egg-info/top_level.txt +0 -0
- {erioon-0.0.5 → erioon-0.0.7}/setup.cfg +0 -0
@@ -16,5 +16,5 @@ def Auth(credential_string):
|
|
16
16
|
>>> client = Auth("<EMAIL>:<PASSWORD>")
|
17
17
|
>>> print(client) # prints user_id if successful or error message if not
|
18
18
|
"""
|
19
|
-
email, password = credential_string.split(":")
|
20
|
-
return ErioonClient(email, password)
|
19
|
+
api, email, password = credential_string.split(":")
|
20
|
+
return ErioonClient(api ,email, password)
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import os
|
2
2
|
import json
|
3
3
|
import requests
|
4
|
+
from werkzeug.security import generate_password_hash
|
4
5
|
from erioon.database import Database
|
5
6
|
|
6
7
|
class ErioonClient:
|
@@ -18,7 +19,7 @@ class ErioonClient:
|
|
18
19
|
token_path (str): Local path to cached authentication token.
|
19
20
|
"""
|
20
21
|
|
21
|
-
def __init__(self, email, password, base_url="https://sdk.erioon.com"):
|
22
|
+
def __init__(self, api, email, password, base_url="https://sdk.erioon.com"):
|
22
23
|
"""
|
23
24
|
Initialize ErioonClient instance, attempts to load cached token or perform login.
|
24
25
|
|
@@ -27,6 +28,7 @@ class ErioonClient:
|
|
27
28
|
password (str): User password for authentication.
|
28
29
|
base_url (str, optional): Base API URL. Defaults to "https://sdk.erioon.com".
|
29
30
|
"""
|
31
|
+
self.api = api
|
30
32
|
self.email = email
|
31
33
|
self.password = password
|
32
34
|
self.base_url = base_url
|
@@ -90,7 +92,7 @@ class ErioonClient:
|
|
90
92
|
dict: Metadata with user_id, database, cluster, etc.
|
91
93
|
"""
|
92
94
|
url = f"{self.base_url}/login_with_credentials"
|
93
|
-
payload = {"email": self.email, "password": self.password}
|
95
|
+
payload = {"api_key": self.api,"email": self.email, "password": self.password}
|
94
96
|
headers = {"Content-Type": "application/json"}
|
95
97
|
|
96
98
|
response = requests.post(url, json=payload, headers=headers)
|
@@ -94,7 +94,6 @@ class Collection:
|
|
94
94
|
new_doc = {"name": "Alice", "age": 25}
|
95
95
|
result = collection.insert_one(new_doc)
|
96
96
|
"""
|
97
|
-
self._print_loading()
|
98
97
|
if self._is_read_only():
|
99
98
|
return {"status": "KO", "error": "Method not allowed. Access is only read."}
|
100
99
|
|
@@ -140,7 +139,6 @@ class Collection:
|
|
140
139
|
Usage:
|
141
140
|
result = collection.delete_one({"name": "John"})
|
142
141
|
"""
|
143
|
-
self._print_loading()
|
144
142
|
if self._is_read_only():
|
145
143
|
return {"status": "KO", "error": "Method not allowed. Access is only read."}
|
146
144
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|