CouchDB.Environment (couchdb_auth v0.2.4)
View SourceRuntime configuration helpers for the CouchDB adapter.
The module reads values either from the application environment
(config/*.exs) or from operating system variables prefixed with
COUCHDB_. Environment variables take precedence, which allows the
library to be configured without recompilation.
Summary
Types
Authentication type configured for the adapter.
Username and password for basic authentication.
CouchDB connection credentials.
HTTP headers are modeled as name/value pairs.
User information map.
CouchDB user role is a simple string; a list of strings represents user roles.
Functions
Returns admin path depending on whether a cluster is configured.
Returns the base URL for admin or cluster-aware endpoints.
Returns the configured authentication type.
Returns the base URL for the CouchDB backend (node management) interface.
Returns the base URL for the primary CouchDB interface.
Returns the configured bearer (JWT) token, if present.
Returns the configured database properties.
Returns the configured OAuth credentials.
Returns proxy authentication configuration.
Returns configured server admin credentials.
Types
@type auth_type() :: :admin_party | :basic | :cookie | :oauth | :bearer | :proxy
Authentication type configured for the adapter.
Username and password for basic authentication.
@type conn() :: %{ protocol: String.t(), hostname: String.t(), database: String.t(), port: String.t() | nil, user: String.t() | nil, password: String.t() | nil }
CouchDB connection credentials.
HTTP headers are modeled as name/value pairs.
User information map.
@type user_roles() :: [String.t()]
CouchDB user role is a simple string; a list of strings represents user roles.
Functions
@spec admin_path() :: String.t()
Returns admin path depending on whether a cluster is configured.
@spec admin_url() :: String.t()
Returns the base URL for admin or cluster-aware endpoints.
@spec auth_type() :: auth_type()
Returns the configured authentication type.
@spec backend_url() :: String.t()
Returns the base URL for the CouchDB backend (node management) interface.
@spec base_url() :: String.t()
Returns the base URL for the primary CouchDB interface.
@spec bearer_token() :: String.t() | nil
Returns the configured bearer (JWT) token, if present.
@spec dbprops() :: %{ protocol: String.t() | nil, hostname: String.t() | nil, port: String.t() | nil, backend_port: String.t() | nil, database: String.t() | nil, cluster: boolean(), node_name: String.t() | nil }
Returns the configured database properties.
@spec oauth_creds() :: %{ optional(:consumer_key) => String.t() | nil, optional(:consumer_secret) => String.t() | nil, optional(:token) => String.t() | nil, optional(:token_secret) => String.t() | nil }
Returns the configured OAuth credentials.
@spec proxy_config() :: %{ user: String.t() | nil, roles: user_roles(), secret: String.t() | nil, token: String.t() | nil }
Returns proxy authentication configuration.
@spec server_admin() :: basic_auth()
Returns configured server admin credentials.