python-arango-async 1.2.7__py3-none-any.whl → 1.2.8__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.
arangoasync/client.py CHANGED
@@ -163,16 +163,22 @@ class ArangoClient:
163
163
  - "basic": HTTP authentication.
164
164
  Requires the `auth` parameter. The `token` parameter is ignored.
165
165
  - "jwt": User JWT authentication.
166
- At least one of the `auth` or `token` parameters are required.
167
- If `auth` is provided, but the `token` is not, the token will be
168
- refreshed automatically. This assumes that the clocks of the server
169
- and client are synchronized.
166
+ At least one of `auth` or `token` is required.
167
+ Credentials in `auth` allow token acquisition and renewal,
168
+ including when an initial `token` is provided. Without a token,
169
+ acquisition happens on the first request. After HTTP 401,
170
+ a locally expired token triggers renewal and one replay.
171
+ Keep client and server clocks synchronized.
170
172
  - "superuser": Superuser JWT authentication.
171
173
  The `token` parameter is required. The `auth` parameter is ignored.
172
- auth (Auth | None): Login information (username and password) or
173
- access token.
174
- token (JwtToken | None): JWT token.
174
+ auth (Auth | str | None): Login information (username and password) or
175
+ access token. A string is used as the password with an empty username.
176
+ token (JwtToken | None): Initial JWT token. With `auth_method="jwt"`,
177
+ provide `auth` as well to allow renewal. Without credentials,
178
+ a 401 after local expiration raises `JWTRefreshError`.
175
179
  verify (bool): Verify the connection by sending a test request.
180
+ For JWT authentication without an initial token, this also triggers
181
+ acquisition before returning the database wrapper.
176
182
  compression (CompressionManager | None): If set, supersedes the
177
183
  client-level compression settings.
178
184
  serializer (Serializer | None): If set, supersedes the client-level
@@ -186,6 +192,7 @@ class ArangoClient:
186
192
  Raises:
187
193
  ValueError: If the authentication is invalid.
188
194
  ServerConnectionError: If `verify` is `True` and the connection fails.
195
+ JWTRefreshError: If `verify` is `True` and JWT acquisition or renewal fails.
189
196
  """
190
197
  connection: Connection
191
198
 
arangoasync/connection.py CHANGED
@@ -178,6 +178,7 @@ class BaseConnection(ABC):
178
178
 
179
179
  if request.prefix_needed:
180
180
  request.endpoint = f"{self._db_endpoint}{request.endpoint}"
181
+ request.prefix_needed = False
181
182
  host_index = self._host_resolver.get_host_index()
182
183
  for tries in range(self._host_resolver.max_tries):
183
184
  try:
@@ -432,6 +433,7 @@ class JwtConnection(BaseConnection):
432
433
  ):
433
434
  # If the token has expired, refresh it and retry the request
434
435
  await self.refresh_token()
436
+ request.headers["authorization"] = self._auth_header
435
437
  resp = await self.process_request(request)
436
438
  return resp
437
439
 
arangoasync/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "1.2.7"
1
+ __version__ = "1.2.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-arango-async
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: Async Python Driver for ArangoDB
5
5
  Author-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
6
6
  Maintainer-email: Alexandru Petenchea <alexandru.petenchea@arangodb.com>, Anthony Mahanna <anthony.mahanna@arangodb.com>
@@ -2,11 +2,11 @@ arangoasync/__init__.py,sha256=HEJ7_q_pRcS9Gco3poa89jLQr_zDrDrHAXCEJMgjUFI,196
2
2
  arangoasync/aql.py,sha256=wUB6K2if5IGk6ucIVa5mxjWjQGG7l6p7xdtj39b6yn8,30541
3
3
  arangoasync/auth.py,sha256=16apz1_IvAB_ZSyenoPha6F_JkbHokmOWFHxPL_swxQ,3025
4
4
  arangoasync/backup.py,sha256=6ZUDjP44bilv056K2fo8l7BnmoeksJ9G9keMVP7i9FI,10577
5
- arangoasync/client.py,sha256=MKLYXPdDhBezFIKX1H5e7-dKzYnIHwbfN0CO8AEsAzs,10054
5
+ arangoasync/client.py,sha256=nN4BhuX9-KOgvB4buMjGXZLZsdFUiWQpvVo9h1P2CMs,10684
6
6
  arangoasync/cluster.py,sha256=64GYlpz07wBczeNTrPpxnUd17tFocrhGijGHF_dqdoo,17260
7
7
  arangoasync/collection.py,sha256=BXpFmCxqzB4qkCMMIJth4abq3ehHh62MEYovIzicFCY,124186
8
8
  arangoasync/compression.py,sha256=vMhcg5nQPkbgplk48vxARUnJ6YeIwrCLC6pDCVJSwo0,3804
9
- arangoasync/connection.py,sha256=f6HQOZHayluNVyH-j-sujlE_dvQrVxC1lPWnzrfQLqY,17459
9
+ arangoasync/connection.py,sha256=jU7SG53teq1KeUfl9cfHFRu6-047wVVQ08Olnou39KU,17566
10
10
  arangoasync/cursor.py,sha256=RQJOtNpxEx5n3eKx7UYPl1N8gzWYQESjufvakr18azk,8464
11
11
  arangoasync/database.py,sha256=8GfFG9ZhfjsThoXeNCZkIBbf-LrlkSOx-hgLjw-eTA8,140476
12
12
  arangoasync/errno.py,sha256=4oKY9IyyzjOitbywhjH8S214qeNtpDlQg7JsHENJNoU,25245
@@ -24,9 +24,9 @@ arangoasync/response.py,sha256=VMnoWgtyrh1JGK7mEgRNsUtSawxWMgFjHT-Cff4d8zc,2132
24
24
  arangoasync/result.py,sha256=NVwFxpYUDujHNRCqCZIBOlGLzB7XsiSmjWPFhUgRS6k,233
25
25
  arangoasync/serialization.py,sha256=ExRqrEpbk11Hb3AfFUJGqPlGBD3dbvwQg_xsZUsrm6I,2910
26
26
  arangoasync/typings.py,sha256=Pk738JV370ryqcD72_v1TGVAPePIsfyuWk3ZSQtE5hc,71656
27
- arangoasync/version.py,sha256=49prCLbE3fFzLfxem5rd2dr1iV4_L-bN0N4J7jxU5yA,22
28
- python_arango_async-1.2.7.dist-info/licenses/LICENSE,sha256=6zoGhJon2tcnvzmycirNjLNBZ6rlLJtYDdVGO76RXVM,1065
29
- python_arango_async-1.2.7.dist-info/METADATA,sha256=wBkgegGo-SygnFkimTksoDegD1v5HrHI9LErRYipL9s,7943
30
- python_arango_async-1.2.7.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
31
- python_arango_async-1.2.7.dist-info/top_level.txt,sha256=uabwJ6t-MiIaZQXGUvYikeSbZDcF0RK37GzikBnDz5k,12
32
- python_arango_async-1.2.7.dist-info/RECORD,,
27
+ arangoasync/version.py,sha256=CfVXm0wwlKPW0khOcwhWw61TpgtZiLijCePsAIOK3aU,22
28
+ python_arango_async-1.2.8.dist-info/licenses/LICENSE,sha256=6zoGhJon2tcnvzmycirNjLNBZ6rlLJtYDdVGO76RXVM,1065
29
+ python_arango_async-1.2.8.dist-info/METADATA,sha256=ipV1rWwxVE2n3M5k3c7MThGx0tbnG-PQU6bVv9ZQ_IY,7943
30
+ python_arango_async-1.2.8.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
31
+ python_arango_async-1.2.8.dist-info/top_level.txt,sha256=uabwJ6t-MiIaZQXGUvYikeSbZDcF0RK37GzikBnDz5k,12
32
+ python_arango_async-1.2.8.dist-info/RECORD,,