Guava.Auth (Guava v0.34.0)

Copy Markdown View Source

Authentication strategies for the Guava API.

Resolves credentials in the same order as the Python SDK:

  1. An explicit API key.
  2. A Guava-deploy token file at /var/run/secrets/guava/token.
  3. The GUAVA_API_KEY environment variable.
  4. A logged-in CLI session ($config/guava/config.json) with OAuth refresh.

Summary

Functions

The path checked for a Guava-deploy token.

Return the auth headers for a strategy, refreshing tokens if needed.

Resolve an auth strategy from an explicit api_key (or nil) and the environment. Raises Guava.Error (type :auth) when nothing is available.

Types

Functions

deploy_token_path()

@spec deploy_token_path() :: Path.t()

The path checked for a Guava-deploy token.

headers(cli)

@spec headers(t()) :: [{String.t(), String.t()}]

Return the auth headers for a strategy, refreshing tokens if needed.

resolve(api_key \\ nil)

@spec resolve(String.t() | nil) :: t()

Resolve an auth strategy from an explicit api_key (or nil) and the environment. Raises Guava.Error (type :auth) when nothing is available.