Expand description
Security utilities covering HTTPS enforcement, domain allowlists, and SPKI pinning.
§Threat Model
These helpers assume upstream TLS validation has already succeeded and focus on defending the cache pipeline against downgrade attempts (HTTP redirects), host header confusion, and certificate substitution by validating SPKI fingerprints.
Structs§
- Spki
Fingerprint - SHA-256 fingerprint of a Subject Public Key Info (SPKI) structure.
Functions§
- canonicalize_
dns_ name - Canonicalise a DNS name by trimming whitespace, removing any trailing dot, and lowercasing.
- deserialize_
allowed_ domains serdehelper to normalise allowlist domains during deserialisation.- enforce_
https - Ensure the provided URL uses HTTPS.
- fingerprint_
spki - Compute the SHA-256 fingerprint of a DER-encoded SPKI payload.
- host_
is_ allowed - Evaluate whether the given hostname is allowed by the provided suffix allowlist.
- normalize_
allowlist - Normalise an allowlist by canonicalising entries and removing duplicates/empties.
- verify_
spki_ pins - Validate that at least one configured SPKI fingerprint matches the presented SPKI set.