cecil 0.0.12__tar.gz → 0.0.14__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.
Potentially problematic release.
This version of cecil might be problematic. Click here for more details.
- {cecil-0.0.12 → cecil-0.0.14}/PKG-INFO +1 -1
- cecil-0.0.14/__about__.py +1 -0
- {cecil-0.0.12 → cecil-0.0.14}/src/cecil/client.py +16 -9
- cecil-0.0.12/__about__.py +0 -1
- {cecil-0.0.12 → cecil-0.0.14}/.gitignore +0 -0
- {cecil-0.0.12 → cecil-0.0.14}/CONTRIBUTING.md +0 -0
- {cecil-0.0.12 → cecil-0.0.14}/LICENSE.txt +0 -0
- {cecil-0.0.12 → cecil-0.0.14}/Makefile +0 -0
- {cecil-0.0.12 → cecil-0.0.14}/README.md +0 -0
- {cecil-0.0.12 → cecil-0.0.14}/pyproject.toml +0 -0
- {cecil-0.0.12 → cecil-0.0.14}/src/cecil/__init__.py +0 -0
- {cecil-0.0.12 → cecil-0.0.14}/src/cecil/models.py +0 -0
- {cecil-0.0.12 → cecil-0.0.14}/tests/__init__.py +0 -0
- {cecil-0.0.12 → cecil-0.0.14}/tests/test_client.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.14"
|
|
@@ -21,7 +21,7 @@ from .models import (
|
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
# TODO: find a way to get this version from __about__.py
|
|
24
|
-
SDK_VERSION = "0.0.
|
|
24
|
+
SDK_VERSION = "0.0.14"
|
|
25
25
|
|
|
26
26
|
# TODO: Documentation (Google style)
|
|
27
27
|
# TODO: Add HTTP retries
|
|
@@ -106,6 +106,7 @@ class Client:
|
|
|
106
106
|
res = self._post(
|
|
107
107
|
url=f"/v0/recover-api-key",
|
|
108
108
|
model=RecoverAPIKeyRequest(email=email),
|
|
109
|
+
skip_auth=True,
|
|
109
110
|
)
|
|
110
111
|
|
|
111
112
|
return RecoverAPIKey(**res)
|
|
@@ -115,9 +116,10 @@ class Client:
|
|
|
115
116
|
|
|
116
117
|
return RotateAPIKey(**res)
|
|
117
118
|
|
|
118
|
-
def _request(self, method: str, url: str, **kwargs) -> Dict:
|
|
119
|
+
def _request(self, method: str, url: str, skip_auth=False, **kwargs) -> Dict:
|
|
119
120
|
|
|
120
|
-
|
|
121
|
+
if skip_auth is False:
|
|
122
|
+
self._set_auth()
|
|
121
123
|
|
|
122
124
|
headers = {"cecil-python-sdk-version": SDK_VERSION}
|
|
123
125
|
|
|
@@ -136,17 +138,22 @@ class Client:
|
|
|
136
138
|
except requests.exceptions.ConnectionError as err:
|
|
137
139
|
raise ValueError("Connection error") from err
|
|
138
140
|
except requests.exceptions.HTTPError as err:
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
message = f"Request failed with status code {err.response.status_code}"
|
|
142
|
+
if err.response.text != "":
|
|
143
|
+
message += f": {err.response.text}"
|
|
144
|
+
|
|
145
|
+
raise ValueError(message) from err
|
|
143
146
|
|
|
144
147
|
def _get(self, url: str, **kwargs) -> Dict:
|
|
145
148
|
return self._request(method="get", url=url, **kwargs)
|
|
146
149
|
|
|
147
|
-
def _post(self, url: str, model: BaseModel, **kwargs) -> Dict:
|
|
150
|
+
def _post(self, url: str, model: BaseModel, skip_auth=False, **kwargs) -> Dict:
|
|
148
151
|
return self._request(
|
|
149
|
-
method="post",
|
|
152
|
+
method="post",
|
|
153
|
+
url=url,
|
|
154
|
+
json=model.model_dump(by_alias=True),
|
|
155
|
+
skip_auth=skip_auth,
|
|
156
|
+
**kwargs,
|
|
150
157
|
)
|
|
151
158
|
|
|
152
159
|
def _set_auth(self) -> None:
|
cecil-0.0.12/__about__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.12"
|
|
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
|
|
File without changes
|