redirect_uris
ModuleA client's registered redirect URIs and how a presented one matches.
Contents
use utopia_auth::oauth2::redirect_uris::RedirectUris;Rust
pub struct RedirectUris(Vec<Vec<u8>>)A client's registered redirect URIs: exact matching, plus any port on http loopback URIs when asked for (RFC 8252 §7.3, public clients only).
Rust
use utopia_auth::oauth2::RedirectUris;
let uris = RedirectUris::from_strings([&b"https://app.example/callback"[..], b"http://127.0.0.1/cb"]);
assert!(uris.matches(b"https://app.example/callback", false));
assert!(!uris.matches(b"https://app.example/other", false));
// Loopback redirects may use any port, when allowed.
assert!(uris.matches(b"http://127.0.0.1:51004/cb", true));