| authorize/1 | When API_KEY is set, require Authorization: Bearer <key>
(constant-time compare). |
| error_reply/4 | |
| read_json/1 | Read and decode a JSON request body (max 1 MiB). |
| reply/3 |
authorize(Req::cowboy_req:req()) -> ok | {halt, cowboy_req:req()}
When API_KEY is set, require Authorization: Bearer <key>
(constant-time compare). Replies 401 itself on failure.
error_reply(Status::cowboy:http_status(), Code::atom(), Message::binary(), Req::cowboy_req:req()) -> cowboy_req:req()
read_json(Req0::cowboy_req:req()) -> {ok, term(), cowboy_req:req()} | {error, binary(), cowboy_req:req()}
Read and decode a JSON request body (max 1 MiB).
reply(Status::cowboy:http_status(), Json::term(), Req::cowboy_req:req()) -> cowboy_req:req()
Generated by EDoc