GcpCompute.TokenProvider.Static (GcpCompute v0.2.0)

Copy Markdown View Source

GcpCompute.TokenProvider that returns a fixed token.

Useful for tests, the Compute emulator, or environments where a token is injected out-of-band. The arg may be:

  • a binary — used directly as the bearer token;

  • a %{token: ...} map — returned as-is;

  • a zero-arity function — invoked to produce {:ok, token} / {:error, _}.

    GcpCompute.Config.local(project: "my-project", token: "ya29.fake")

    => token_provider: {GcpCompute.TokenProvider.Static, "ya29.fake"}