Pure MoonBit CORS, CSRF, Helmet, JWT (HS256), PASETO v4.local, Argon2id/PBKDF2 password hashing, and RBAC/ABAC guards for unmbt/ciallo
pub(open) trait PasswordHasher {
fn hash_password(Self, password : StringView, salt~ : BytesView) -> String raise SecurityError
fn verify_password(Self, password : StringView, encoded : StringView) -> Bool raise SecurityError
}impl PasswordHasher for Argon2idHasherfn hash_password(self : Argon2idHasher, password : StringView, salt~ : BytesView) -> String raise SecurityErrorfn verify_password(_self : Argon2idHasher, password : StringView, encoded : StringView) -> Bool raise SecurityErrorfn Argon2idHasher::Argon2idHasher(memory_kib? : Int, iterations? : Int, tag_len? : Int) -> Argon2idHasherfn Argon2idHasher::hash_password(self : Argon2idHasher, password : StringView, salt~ : BytesView) -> String raise SecurityErrorfn Argon2idHasher::verify_password(_self : Argon2idHasher, password : StringView, encoded : StringView) -> Bool raise SecurityErrorfn CorsOptions::CorsOptions(allowed_origins? : Array[String], allowed_methods? : Array[String], allowed_headers? : Array[String], exposed_headers? : Array[String], allow_credentials? : Bool, max_age_secs? : Int) -> CorsOptionsfn CsrfOptions::CsrfOptions(cookie_name? : String, header_name? : String, allowed_origins? : Array[String]) -> CsrfOptionsfn HelmetOptions::HelmetOptions(frame_options? : String, referrer_policy? : String, hsts? : String, content_security_policy? : String, coop? : String, permissions_policy? : String) -> HelmetOptionsimpl PasswordHasher for Pbkdf2Hasherfn hash_password(self : Pbkdf2Hasher, password : StringView, salt~ : BytesView) -> String raise SecurityErrorfn verify_password(_self : Pbkdf2Hasher, password : StringView, encoded : StringView) -> Bool raise SecurityErrorfn Pbkdf2Hasher::hash_password(self : Pbkdf2Hasher, password : StringView, salt~ : BytesView) -> String raise SecurityErrorfn Pbkdf2Hasher::verify_password(_self : Pbkdf2Hasher, password : StringView, encoded : StringView) -> Bool raise SecurityErrorfn paseto_v4_decrypt(token : StringView, key~ : BytesView, implicit_assertion? : BytesView) -> (Bytes, Bytes) raise SecurityErrorfn paseto_v4_encrypt(payload : BytesView, key~ : BytesView, nonce~ : BytesView, footer? : BytesView, implicit_assertion? : BytesView) -> String raise SecurityErrorfn require_policy(policy : (Context, AuthPrincipal) -> Bool, detail? : String) -> (async (Context) -> Response?)fn verify_jwt_hs256(token : StringView, secret~ : BytesView, now_secs? : Int64, issuer? : String, audience? : String, leeway_secs? : Int64) -> JwtClaims raise SecurityErrorInstall
Download zipPure MoonBit CORS, CSRF, Helmet, JWT (HS256), PASETO v4.local, Argon2id/PBKDF2 password hashing, and RBAC/ABAC guards for unmbt/ciallo