ExFTP.Auth.Common (ExFTP v1.0.4)

View Source

A module describing types functions common across all ExFTP.Authenticator

Summary

Types

How many milliseconds pass before a user's session is not assumed still-authenticated.

A URL used to check if a user should still be considered authenticated

An HTTP method to use in a request.

HTTP method paired with login_url/0

A URL used to log in a user

Functions

Cleans keys and values of a given map in preparation to build into a config

Grabs the authenticator_config from Application.get_env/2 and validates it.

Types

authenticated_method()

@type authenticated_method() :: http_method()

HTTP method paired with authenticated_url/0

๐Ÿ‘€ See Also

authenticated_ttl_ms()

@type authenticated_ttl_ms() :: integer()

How many milliseconds pass before a user's session is not assumed still-authenticated.

๐Ÿ‘€ See Also

authenticated_url()

@type authenticated_url() :: URI.t() | String.t()

A URL used to check if a user should still be considered authenticated

๐Ÿ‘€ See Also

http_method()

@type http_method() ::
  :get | :head | :post | :put | :connect | :delete | :options | :trace | :patch

An HTTP method to use in a request.

๐Ÿ‘€ See Also

login_method()

@type login_method() :: http_method()

HTTP method paired with login_url/0

๐Ÿ‘€ See Also

login_url()

@type login_url() :: URI.t() | String.t()

A URL used to log in a user

๐Ÿ‘€ See Also

Functions

prepare(m)

@spec prepare(m :: map()) :: list()

Cleans keys and values of a given map in preparation to build into a config

๐Ÿท๏ธ Params

  • m :: A map to prepare before building into a config

validate_config(mod)

Grabs the authenticator_config from Application.get_env/2 and validates it.

๐Ÿท๏ธ Params

โคต๏ธ Returns

โœ… On Success

  `{:ok, config}`

โŒ On Failure

  `{:error, desc}`