GcsFetcher
Google Cloud Storage fetcher (gs://).
Notes
Fetches documents from Google Cloud Storage using references such as
gs://my-bucket/path/to/object.txt.
This fetcher relies on the official google-cloud-nio provider.
Authentication is by default delegated to Google Application Default Credentials (ADC): the file the
GOOGLE_APPLICATION_CREDENTIALS variable points to, or the account the machine is logged in as. A bucket is read
anonymously if there are none.
A Google service account key can also be given as the password of credentials: the content of the JSON key file.
Like any credentials password, it can be encrypted with a passwordKey or supplied from a variable, so the key stays out
of the configuration.
When endpoint is set, the fetcher assumes a local/emulated GCS-compatible
service and connects without authentication.
Examples
The following example uses default Google Application Default Credentials.
- YAML
- JSON
- XML
class: GcsFetcher
{
"class": "GcsFetcher"
}
<class>GcsFetcher</class>
The following example targets a local GCS-compatible endpoint.
- YAML
- JSON
- XML
class: GcsFetcher
endpoint: http://localhost:4443
{
"class": "GcsFetcher",
"endpoint": "http://localhost:4443"
}
<class>GcsFetcher</class>
<endpoint>http://localhost:4443</endpoint>
The following example keeps the secret out of the configuration with encrypted credentials.
- YAML
- JSON
- XML
class: GcsFetcher
credentials:
password: ${serviceAccountKey}
passwordKey:
source: ENVIRONMENT
value: MY_KEY_VAR
{
"class": "GcsFetcher",
"credentials": {
"password": "${serviceAccountKey}",
"passwordKey": {
"source": "ENVIRONMENT",
"value": "MY_KEY_VAR"
}
}
}
<class>GcsFetcher</class>
<credentials>
<password>${serviceAccountKey}</password>
<passwordKey>
<source>ENVIRONMENT</source>
<value>MY_KEY_VAR</value>
</passwordKey>
</credentials>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
class: GcsFetcher
credentials:
password: string
passwordKey:
size: 0
source: KEY
value: string
username: string
endpoint: string
referenceFilters: []
{
"class": "GcsFetcher",
"credentials": {
"password": "string",
"passwordKey": {
"size": 0,
"source": "KEY",
"value": "string"
},
"username": "string"
},
"endpoint": "string",
"referenceFilters": []
}
<gcsFetcher>
<class>GcsFetcher</class>
<credentials>
<password>string</password>
<passwordKey>
<size>0</size>
<source>KEY</source>
<value>string</value>
</passwordKey>
<username>string</username>
</credentials>
<endpoint>string</endpoint>
<referenceFilters>
<referenceFilter/>
</referenceFilters>
</gcsFetcher>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
credentials | Credentials | No | Credentials |
endpoint | string | No | - |
referenceFilters | ReferenceFilter[] | No | - |
Property Details
credentials
Credentials holding a Google service account key: the JSON key file content as the password (the username is not
used). The password can be encrypted. When empty, the Application Default Credentials are used. Ignored when endpoint is
set.
endpoint
Optional endpoint override, mainly intended for local GCS-compatible test servers.
referenceFilters
Filters applied to document references (URLs or file paths) to control which ones are fetched. Documents whose references do not pass the filters are skipped.