OCI.Auth.Adapter behaviour (oci v0.0.5)
View SourceAdapter for authenticating requests to the OCI registry.
Summary
Types
Represents the authorization header value. This is the full authorization header value, including the scheme and credentials.
Represents encoded credentials string. For Basic auth, this is the base64 encoded username:password string. For Bearer auth, this is the encoded token string.
Represents decoded credentials string. For Basic auth, this is the raw username:password string. For Bearer auth, this is the decoded token string.
Represents the authentication scheme type. Currently supports "Basic" and "Bearer" authentication methods.
The subject to set on the request context to be used for authorization.
Types
@type authorization_t() :: String.t()
Represents the authorization header value. This is the full authorization header value, including the scheme and credentials.
@type credentials_enc_t() :: String.t()
Represents encoded credentials string. For Basic auth, this is the base64 encoded username:password string. For Bearer auth, this is the encoded token string.
@type credentials_t() :: String.t()
Represents decoded credentials string. For Basic auth, this is the raw username:password string. For Bearer auth, this is the decoded token string.
@type error_details_t() :: any()
@type scheme_t() :: String.t()
Represents the authentication scheme type. Currently supports "Basic" and "Bearer" authentication methods.
@type subject_t() :: any()
The subject to set on the request context to be used for authorization.
Available in: conn.assigns[:oci_ctx]
@type t() :: struct()
Callbacks
@callback authenticate(auth_strategy :: t(), authorization :: authorization_t()) :: {:ok, subject :: subject_t()} | {:error, error_type :: atom(), details :: error_details_t()}
@callback authorize( auth_strategy :: t(), context :: OCI.Context.t() ) :: :ok | {:error, error_type :: atom(), details :: error_details_t()}
@callback challenge(registry :: OCI.Registry.t()) :: {String.t(), String.t()}