Lightning.AuthProviders.Store (Lightning v2.14.5-pre1)

View Source

Store module for caching Handlers.

Since Handlers often have to fetch their .well-known files when being initialized we cache these in order to avoid repeatedly making HTTP requests to a providers API.

Summary

Types

finder()

@type finder() :: (name :: String.t() ->
               {:ok, Lightning.AuthProviders.Handler.t()} | {:error, term()})

Functions

get_handler(name, finder \\ &default/1)

@spec get_handler(key :: String.t(), default :: finder()) ::
  {:ok, Lightning.AuthProviders.Handler.t()} | {:error, :not_found}

get_handlers()

@spec get_handlers() :: {:ok, [Lightning.AuthProviders.Handler.t()]}

put_handler(name, handler)

@spec put_handler(
  name :: String.t(),
  handler :: Lightning.AuthProviders.Handler.t()
) :: {:ok, Lightning.AuthProviders.Handler.t()}

remove_handler(name)

@spec remove_handler(name :: String.t()) :: {:ok, true}