nova_auth_security (nova_auth v0.2.0)

View Source

Nova security callback for route-level authentication. Returns closures suitable for use in Nova route security configuration.

Uses the unified actor session (nova_auth_actor) so it works with any auth strategy (password, OIDC, JWT) that stores an actor there.

Summary

Functions

Return a security fun that checks for any authenticated actor in the session.

Check the session for an authenticated actor and return it or 401.

Functions

require_authenticated()

-spec require_authenticated() -> fun((cowboy_req:req()) -> term()).

Return a security fun that checks for any authenticated actor in the session.

require_authenticated(Req)

-spec require_authenticated(cowboy_req:req()) ->
                               {true, nova_auth:actor()} | {false, integer(), map(), binary()}.

Check the session for an authenticated actor and return it or 401.