EndPointBlank.Authorization (end_point_blank_elixir v0.3.1)

Copy Markdown

Builds Authorization headers for outbound requests to the EndPointBlank API.

Returns a Bearer token header when a valid cached token exists for the target hostname, otherwise falls back to HTTP Basic auth.

Summary

Functions

Returns Base64-encoded client_id:client_secret.

Returns an HTTP Basic Authorization header value.

Returns the best available Authorization header value for the given hostname.

Functions

basic_credentials()

Returns Base64-encoded client_id:client_secret.

basic_header()

Returns an HTTP Basic Authorization header value.

header(hostname \\ nil)

Returns the best available Authorization header value for the given hostname.

If a valid access token is cached for hostname, returns "Bearer <token>". Otherwise returns "Basic <credentials>".