unstructured
123ad20f - support passing credentials from memory for google connectors (#1888)

Commit
2 years ago
support passing credentials from memory for google connectors (#1888) ### Description ### Google Drive The existing service account parameter was expanded to support either a file path or a json value to generate the credentials when instantiating the google drive client. ### GCS Google Cloud Storage already supports the value being passed in, from their docstring: > - you may supply a token generated by the [gcloud](https://cloud.google.com/sdk/docs/) utility; this is either a python dictionary, the name of a file containing the JSON returned by logging in with the gcloud CLI tool, or a Credentials object. I tested this locally: ```python from gcsfs import GCSFileSystem import json with open("/Users/romanisecke/.ssh/google-cloud-unstructured-ingest-test-d4fc30286d9d.json") as json_file: json_data = json.load(json_file) print(json_data) fs = GCSFileSystem(token=json_data) print(fs.ls(path="gs://utic-test-ingest-fixtures/")) ``` `['utic-test-ingest-fixtures/ideas-page.html', 'utic-test-ingest-fixtures/nested-1', 'utic-test-ingest-fixtures/nested-2']`
Author
Parents
Loading