nucliadb-utils 5.1.2.post1640__py3-none-any.whl → 5.1.2.post1644__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.
- nucliadb_utils/storages/gcs.py +20 -15
- nucliadb_utils/tests/gcs.py +1 -0
- {nucliadb_utils-5.1.2.post1640.dist-info → nucliadb_utils-5.1.2.post1644.dist-info}/METADATA +3 -3
- {nucliadb_utils-5.1.2.post1640.dist-info → nucliadb_utils-5.1.2.post1644.dist-info}/RECORD +7 -7
- {nucliadb_utils-5.1.2.post1640.dist-info → nucliadb_utils-5.1.2.post1644.dist-info}/WHEEL +0 -0
- {nucliadb_utils-5.1.2.post1640.dist-info → nucliadb_utils-5.1.2.post1644.dist-info}/top_level.txt +0 -0
- {nucliadb_utils-5.1.2.post1640.dist-info → nucliadb_utils-5.1.2.post1644.dist-info}/zip-safe +0 -0
nucliadb_utils/storages/gcs.py
CHANGED
@@ -458,25 +458,30 @@ class GCSStorage(Storage):
|
|
458
458
|
labels: Optional[Dict[str, str]] = None,
|
459
459
|
url: str = "https://www.googleapis.com",
|
460
460
|
scopes: Optional[List[str]] = None,
|
461
|
+
anonymous: bool = False
|
461
462
|
):
|
462
|
-
if
|
463
|
-
self._json_credentials = None
|
464
|
-
elif isinstance(account_credentials, str) and account_credentials.strip() == "":
|
463
|
+
if anonymous:
|
465
464
|
self._json_credentials = None
|
465
|
+
self._credentials = google.auth.credentials.AnonymousCredentials()
|
466
466
|
else:
|
467
|
-
|
467
|
+
if account_credentials is None:
|
468
|
+
self._json_credentials = None
|
469
|
+
elif isinstance(account_credentials, str) and account_credentials.strip() == "":
|
470
|
+
self._json_credentials = None
|
471
|
+
else:
|
472
|
+
self._json_credentials = json.loads(base64.b64decode(account_credentials))
|
468
473
|
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
474
|
+
if self._json_credentials is not None:
|
475
|
+
self._credentials = service_account.Credentials.from_service_account_info(
|
476
|
+
self._json_credentials,
|
477
|
+
scopes=DEFAULT_SCOPES if scopes is None else scopes,
|
478
|
+
)
|
479
|
+
else:
|
480
|
+
try:
|
481
|
+
self._credentials, self._project = google.auth.default()
|
482
|
+
except DefaultCredentialsError:
|
483
|
+
logger.warning("Setting up without credentials as couldn't find workload identity")
|
484
|
+
self._credentials = None
|
480
485
|
|
481
486
|
self.source = CloudFile.GCS
|
482
487
|
self.deadletter_bucket = deadletter_bucket
|
nucliadb_utils/tests/gcs.py
CHANGED
@@ -117,6 +117,7 @@ async def gcs_storage(gcs, gcs_storage_settings: dict[str, Any]):
|
|
117
117
|
deadletter_bucket=extended_storage_settings.gcs_deadletter_bucket,
|
118
118
|
indexing_bucket=extended_storage_settings.gcs_indexing_bucket,
|
119
119
|
labels=storage_settings.gcs_bucket_labels,
|
120
|
+
anonymous=True,
|
120
121
|
)
|
121
122
|
await storage.initialize()
|
122
123
|
yield storage
|
{nucliadb_utils-5.1.2.post1640.dist-info → nucliadb_utils-5.1.2.post1644.dist-info}/METADATA
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: nucliadb_utils
|
3
|
-
Version: 5.1.2.
|
3
|
+
Version: 5.1.2.post1644
|
4
4
|
Home-page: https://nuclia.com
|
5
5
|
License: BSD
|
6
6
|
Classifier: Development Status :: 4 - Beta
|
@@ -24,8 +24,8 @@ Requires-Dist: PyNaCl
|
|
24
24
|
Requires-Dist: pyjwt>=2.4.0
|
25
25
|
Requires-Dist: memorylru>=1.1.2
|
26
26
|
Requires-Dist: mrflagly>=0.2.9
|
27
|
-
Requires-Dist: nucliadb-protos>=5.1.2.
|
28
|
-
Requires-Dist: nucliadb-telemetry>=5.1.2.
|
27
|
+
Requires-Dist: nucliadb-protos>=5.1.2.post1644
|
28
|
+
Requires-Dist: nucliadb-telemetry>=5.1.2.post1644
|
29
29
|
Provides-Extra: cache
|
30
30
|
Requires-Dist: redis>=4.3.4; extra == "cache"
|
31
31
|
Requires-Dist: orjson>=3.6.7; extra == "cache"
|
@@ -42,7 +42,7 @@ nucliadb_utils/nuclia_usage/utils/kb_usage_report.py,sha256=F6dhQWhrWzl3qfAdvrqV
|
|
42
42
|
nucliadb_utils/storages/__init__.py,sha256=5Qc8AUWiJv9_JbGCBpAn88AIJhwDlm0OPQpg2ZdRL4U,872
|
43
43
|
nucliadb_utils/storages/azure.py,sha256=egMDwLNIGSQyVevuySt2AswzFdNAcih05BbRg3-p8IU,16015
|
44
44
|
nucliadb_utils/storages/exceptions.py,sha256=mm_wX4YRtp7u7enkk_4pMSlX5AQQuFbq4xLmupVDt3Y,2502
|
45
|
-
nucliadb_utils/storages/gcs.py,sha256=
|
45
|
+
nucliadb_utils/storages/gcs.py,sha256=ouMGhqQkyc1Fp6yOekGSp5WayN6l_M7QEDAH0jxQXuE,27915
|
46
46
|
nucliadb_utils/storages/local.py,sha256=NxC_nMBd38NDsR266DSgoBLdQlvUwf0_sd50r-BLI0E,10288
|
47
47
|
nucliadb_utils/storages/nuclia.py,sha256=vEv94xAT7QM2g80S25QyrOw2pzvP2BAX-ADgZLtuCVc,2097
|
48
48
|
nucliadb_utils/storages/object_store.py,sha256=Tw10GmpYfM5TMqJ3Tk9pLQ9wLMBk1-snL_m6uasiZDQ,4257
|
@@ -54,13 +54,13 @@ nucliadb_utils/tests/__init__.py,sha256=Oo9CAE7B0eW5VHn8sHd6o30SQzOWUhktLPRXdlDO
|
|
54
54
|
nucliadb_utils/tests/asyncbenchmark.py,sha256=x4be2IwCawle9zWgMOJkmwoUwk5p1tv7cLQGmybkEOg,10587
|
55
55
|
nucliadb_utils/tests/azure.py,sha256=Dg-Eb4KVScG-O6P9y-bVQZTAKTNUMQ0i-CKEd9IdrWw,4474
|
56
56
|
nucliadb_utils/tests/fixtures.py,sha256=i0sqPqe5a5JlKGFdaIvOlHYkZ3pHZ2hTIgTsaIB3vSM,3472
|
57
|
-
nucliadb_utils/tests/gcs.py,sha256=
|
57
|
+
nucliadb_utils/tests/gcs.py,sha256=AORrCo-LTly-g8xAzajCH4EGAzF6PcXt48tLGjq5DLg,4458
|
58
58
|
nucliadb_utils/tests/indexing.py,sha256=YW2QhkhO9Q_8A4kKWJaWSvXvyQ_AiAwY1VylcfVQFxk,1513
|
59
59
|
nucliadb_utils/tests/local.py,sha256=7nuP8EFUAiA8ZH50R1iPV9EUXBySQxOanVm3Zht_e0g,1835
|
60
60
|
nucliadb_utils/tests/nats.py,sha256=xqpww4jZjTKY9oPGlJdDJG67L3FIBQsa9qDHxILR8r8,7687
|
61
61
|
nucliadb_utils/tests/s3.py,sha256=IdMxK_cNdSHLvO1u8BwsKFzD87Hk1MVPDZ57zx6h-rA,3656
|
62
|
-
nucliadb_utils-5.1.2.
|
63
|
-
nucliadb_utils-5.1.2.
|
64
|
-
nucliadb_utils-5.1.2.
|
65
|
-
nucliadb_utils-5.1.2.
|
66
|
-
nucliadb_utils-5.1.2.
|
62
|
+
nucliadb_utils-5.1.2.post1644.dist-info/METADATA,sha256=DWComKW0YvIKU4CpWv06nCGvTEeFkgVAG5faoHZ2BjA,2071
|
63
|
+
nucliadb_utils-5.1.2.post1644.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
64
|
+
nucliadb_utils-5.1.2.post1644.dist-info/top_level.txt,sha256=fE3vJtALTfgh7bcAWcNhcfXkNPp_eVVpbKK-2IYua3E,15
|
65
|
+
nucliadb_utils-5.1.2.post1644.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
66
|
+
nucliadb_utils-5.1.2.post1644.dist-info/RECORD,,
|
File without changes
|
{nucliadb_utils-5.1.2.post1640.dist-info → nucliadb_utils-5.1.2.post1644.dist-info}/top_level.txt
RENAMED
File without changes
|
{nucliadb_utils-5.1.2.post1640.dist-info → nucliadb_utils-5.1.2.post1644.dist-info}/zip-safe
RENAMED
File without changes
|