Lightning.Storage.GCS.TokenSource behaviour (Lightning v2.19.0-pre)

View Source

Source of the OAuth bearer token used for Google Cloud Storage requests.

Lightning.Storage.GCS needs a token on every call, but Goth is only started when STORAGE_BACKEND=gcs (see Lightning.Application), so it isn't running under test. This indirection lets the test suite supply a token without a live Goth process, in the same way Lightning.Config swaps its implementation for Lightning.MockConfig.

Summary

Functions

Fetches a bearer token for the Google Cloud Storage scopes.

Callbacks

fetch()

@callback fetch() :: {:ok, %{token: String.t()}} | {:error, term()}

Functions

fetch()

@spec fetch() :: {:ok, %{token: String.t()}} | {:error, term()}

Fetches a bearer token for the Google Cloud Storage scopes.