adk_dev_auth (erlang_adk v0.7.0)

View Source

Bearer authentication and same-origin checks for local developer APIs.

Summary

Functions

Compare arbitrary binaries through fixed-size SHA-256 digests.

Functions

authorize(Req, Config)

-spec authorize(cowboy_req:req(), map()) -> ok | {error, unauthorized | forbidden | unavailable}.

constant_time_equal(Left, Right)

-spec constant_time_equal(binary(), binary()) -> boolean().

Compare arbitrary binaries through fixed-size SHA-256 digests.

same_origin(Req)

-spec same_origin(cowboy_req:req()) -> boolean().