Skip to main content

Module http_basic

Module http_basic 

Source
Expand description

HTTP Basic credential check against the current request’s Authorization header. 基于当前请求 Authorization 头的 HTTP Basic 凭据校验。

Constants§

DEFAULT_REALM
Default realm string used in WWW-Authenticate. WWW-Authenticate 使用的默认 realm。

Functions§

check
Check HTTP Basic.
check_account
Check using default realm and config / explicit account. 使用默认 realm,以及配置或显式账号进行校验。
ct_eq
Constant-time equality for equal-length byte slices. 等长字节的恒定时间比较(长度不同时直接 false,长度会泄漏,可接受)。
decode_basic_authorization
Decode Authorization: Basic <base64(user:pass)> into user:pass. 将 Authorization: Basic <base64(user:pass)> 解码为 user:pass。