ivar v0.8.1 Ivar.Auth
Ivar.Auth
manages the authentication credentials used for a request
Summary
Functions
Puts the given credentials
under auth_type
into the existing request
map
Functions
Puts the given credentials
under auth_type
into the existing request
map
Args
request
- the map used to store the credentials, usually created viaIvar.new/2
credentials
- the credentials to be used for authenticationauth_type
- an atom for the type of authentication to be used (:basic
or:bearer
)
Credentials
:basic
auth tuple -{"username", "password"}
:bearer
token -"some.token"
Usage
iex> Ivar.Auth.put(%{}, {"user", "pass"}, :basic)
%{auth: {"authorization", "Basic dXNlcjpwYXNz"}}