Dpop Verifier
A tiny DPoP proof verifier for Rust:
- ES256 over P-256 only (per spec’s MTI)
- Manual claim checks (htm/htu/iat/ath)
- Pluggable replay store (DB/Redis/etc.)
- Optional Actix helper to canonicalize request URL
Not yet implemented, but planned:
- EdDSA/PS256 support
- DPoP-Nonce support
Made this small crate for my own needs. If you feel it's lacking or is missing something and/or does not actually follow the spec etc. feel free to open an issue.
Install
Crates.io
[]
= "0.1"
Git
[]
= { = "https://github.com/ukonhattu/dpop-verifier"}
Quick start (framework-agnostic)
use ;
;
async
Actix helpers
Enable ["actix-web"] feature
use ;
use ;
async
Proxy trust note: Only use X-Forwarded-* (true option) when you explicitly trust your proxy/load-balancer. Otherwise prefer connection info (false option).
Api Surface
pub async Sized> ;
Replay store
Provide a store that return true only the first time it sees jti withint TTL window:
Actix helpers
pub fn dpop_header_str<'a>(req: &'a actix_web::HttpRequest) -> Result<&'a str, DpopError>;
pub fn expected_htu_from_actix(req: &actix_web::HttpRequest, trust_proxies: bool) -> String;
Issues
- Issues & PRs welcome, please notify me if you find any security vulnerability
- Feel like the crate is missing something, butchers the spec, is not working as it should? -> Make an issue and I will investigate
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.