Regc.Credential (regc v0.0.2)

View Source

Registry credentials used by Basic and Bearer authentication.

Credential providers may be a credential, a host-keyed map, a one-argument function, a module exporting fetch/1, or {module, state} where the module exports fetch/2. Provider callbacks may return a credential directly, {:ok, credential}, :none, or {:error, reason}.

Summary

Functions

Builds and validates one credential.

Types

input()

@type input() ::
  t()
  | keyword()
  | map()
  | {:basic, String.t(), String.t()}
  | {:identity_token, String.t()}
  | {:refresh_token, String.t()}
  | {:bearer, String.t()}

provider()

@type provider() ::
  nil
  | input()
  | %{optional(String.t()) => input()}
  | (String.t() -> term())
  | module()
  | {module(), term()}

t()

@type t() :: %Regc.Credential{
  password: String.t() | nil,
  refresh_token: String.t() | nil,
  registry_token: String.t() | nil,
  username: String.t() | nil
}

Functions

new(values \\ [])

@spec new(keyword() | map()) :: t()

Builds and validates one credential.