Module Credentials.Provider

type credentials = Awskit.Credentials.t

AWS credentials resolved by this provider.

Credential source that produced, skipped, or failed resolution.

type unavailable = {
  1. source : source;
  2. reason : string;
}

Provider was not configured or not applicable, so a chain may continue.

type resolution =
  1. | Resolved of credentials
  2. | Unavailable of unavailable
  3. | Invalid of Awskit.Error.t
  4. | Failed of Awskit.Error.t

Credential resolution outcome. Chains continue only on Unavailable.

type t

Asynchronous credential provider. Native Lwt.Canceled from the lookup function is preserved.

val create : (unit -> resolution Lwt.t) -> t

Wrap an asynchronous credential lookup function. The function is called each time resolve is called.

val resolve : t -> resolution Lwt.t

Resolve credentials from the provider.

val static : credentials -> t

Provider that always returns the same credentials.

val chain : t list -> t

Try providers in order. The chain continues only when a provider returns Unavailable; Resolved, Invalid, and Failed stop resolution.

val source_label : source -> string

Stable, human-readable label for a credential provider source.