|
1 | 1 | # -*- coding: utf-8 -*- |
2 | 2 | """Archivist connection interface |
3 | 3 |
|
4 | | - This module contains the base Archivist class which manages |
5 | | - the connection parameters to a DataTrails instance and |
6 | | - the basic REST verbs to GET, POST, PATCH and DELETE entities.. |
| 4 | +This module contains the base Archivist class which manages |
| 5 | +the connection parameters to a DataTrails instance and |
| 6 | +the basic REST verbs to GET, POST, PATCH and DELETE entities.. |
7 | 7 |
|
8 | | - The REST methods in this class should only be used directly when |
9 | | - a CRUD endpoint for the specific type of entity is unavailable. |
10 | | - Current CRUD endpoints are assets, events, locations, attachments. |
11 | | - IAM subjects and IAM access policies. |
| 8 | +The REST methods in this class should only be used directly when |
| 9 | +a CRUD endpoint for the specific type of entity is unavailable. |
| 10 | +Current CRUD endpoints are assets, events, locations, attachments. |
| 11 | +IAM subjects and IAM access policies. |
12 | 12 |
|
13 | | - Instantiation of this class encapsulates the URL and authentication |
14 | | - parameters (the max_time parameter is optional): |
| 13 | +Instantiation of this class encapsulates the URL and authentication |
| 14 | +parameters (the max_time parameter is optional): |
15 | 15 |
|
16 | | - .. code-block:: python |
| 16 | +.. code-block:: python |
17 | 17 |
|
18 | | - with open(".auth_token", mode="r", encoding="utf-8") as tokenfile: |
19 | | - authtoken = tokenfile.read().strip() |
| 18 | + with open(".auth_token", mode="r", encoding="utf-8") as tokenfile: |
| 19 | + authtoken = tokenfile.read().strip() |
20 | 20 |
|
21 | | - # Initialize connection to Archivist |
22 | | - arch = Archivist( |
23 | | - "https://app.datatrails.ai", |
24 | | - authtoken, |
25 | | - max_time=300.0, |
26 | | - ) |
| 21 | + # Initialize connection to Archivist |
| 22 | + arch = Archivist( |
| 23 | + "https://app.datatrails.ai", |
| 24 | + authtoken, |
| 25 | + max_time=300.0, |
| 26 | + ) |
27 | 27 |
|
28 | | - The arch variable now has additional endpoints assets,events,locations, |
29 | | - attachments, IAM subjects and IAM access policies documented elsewhere. |
| 28 | + The arch variable now has additional endpoints assets,events,locations, |
| 29 | + attachments, IAM subjects and IAM access policies documented elsewhere. |
30 | 30 |
|
31 | 31 | """ |
| 32 | + |
32 | 33 | from copy import deepcopy |
33 | 34 | from logging import getLogger |
34 | 35 | from time import time |
@@ -253,14 +254,12 @@ def post( |
253 | 254 | response = self.session.post( |
254 | 255 | url, |
255 | 256 | data=request, |
256 | | - verify=self.verify, |
257 | 257 | ) |
258 | 258 | else: |
259 | 259 | response = self.session.post( |
260 | 260 | url, |
261 | 261 | json=request, |
262 | 262 | headers=self._add_headers(headers), |
263 | | - verify=self.verify, |
264 | 263 | ) |
265 | 264 |
|
266 | 265 | error = _parse_response(response) |
@@ -305,7 +304,6 @@ def post_file( |
305 | 304 | url, |
306 | 305 | data=multipart, # pyright: ignore https://github.com/requests/toolbelt/issues/312 |
307 | 306 | headers=self._add_headers(headers), |
308 | | - verify=self.verify, |
309 | 307 | params=_dotdict(params), |
310 | 308 | ) |
311 | 309 |
|
@@ -335,7 +333,6 @@ def delete( |
335 | 333 | response = self.session.delete( |
336 | 334 | url, |
337 | 335 | headers=self._add_headers(headers), |
338 | | - verify=self.verify, |
339 | 336 | ) |
340 | 337 |
|
341 | 338 | self._response_ring_buffer.appendleft(response) |
@@ -371,7 +368,6 @@ def patch( |
371 | 368 | url, |
372 | 369 | json=request, |
373 | 370 | headers=self._add_headers(headers), |
374 | | - verify=self.verify, |
375 | 371 | ) |
376 | 372 |
|
377 | 373 | self._response_ring_buffer.appendleft(response) |
|
0 commit comments