View Source Buckets.Adapters.GCS.Auth (Buckets v1.0.0-rc.3)
Google Cloud Storage authentication using service account credentials.
Handles JWT token generation and OAuth2 token exchange without external dependencies.
Summary
Functions
Exchanges a JWT token for an access token via Google's OAuth2 endpoint.
Generates a JWT token for Google service account authentication.
Gets an access token for GCS API access.
Get service account credentials from a location config.
Loads service account credentials from a file path.
Parse service account credentials from a JSON string.
Validates that service account credentials contain required fields.
Functions
Exchanges a JWT token for an access token via Google's OAuth2 endpoint.
Generates a JWT token for Google service account authentication.
Gets an access token for GCS API access.
Examples
iex> credentials = %{
...> "client_email" => "test@example.com",
...> "private_key" => "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"
...> }
iex> Buckets.GCS.Auth.get_access_token(credentials)
{:ok, "ya29.c.Ko8..."}
Get service account credentials from a location config.
Loads service account credentials from a file path.
Parse service account credentials from a JSON string.
Validates that service account credentials contain required fields.