Oidcc.Plug.Cache behaviour (Oidcc Plug v0.3.1)

View Source

Behaviour to cache introspection / userinfo requests

Usage

Summary

Callbacks

Check cache if userinfo / introspection is stored for token.

Store userinfo / introspection for token.

Types

t()

(since 0.1.0)
@type t() :: module()

Callbacks

get(type, token, conn)

(since 0.1.0)
@callback get(type :: :userinfo, token :: String.t(), conn :: Plug.Conn.t()) ::
  {:ok, :oidcc_jwt_util.claims()} | :miss
@callback get(type :: :introspection, token :: String.t(), conn :: Plug.Conn.t()) ::
  {:ok, Oidcc.TokenIntrospection.t()} | :miss

Check cache if userinfo / introspection is stored for token.

put(type, token, data, conn)

(since 0.1.0)
@callback put(
  type :: :userinfo,
  token :: String.t(),
  data :: :oidcc_jwt_util.claims(),
  conn :: Plug.Conn.t()
) :: :ok
@callback put(
  type :: :introspection,
  token :: String.t(),
  data :: Oidcc.TokenIntrospection.t(),
  conn :: Plug.Conn.t()
) :: :ok

Store userinfo / introspection for token.