Rust

origin

Module

The web origins allowed to run passkey ceremonies for a relying party.

Contents

use utopia_auth::passkeys::origin::Origin;
Rust
pub struct Origin

The web origins allowed to run ceremonies for a relying party: HTTPS on the RP ID or a subdomain, with no path, query, fragment or credentials; HTTP only for localhost.

Rust
use utopia_auth::passkeys::Origin;

let origin = Origin::new("example.com");
assert_eq!(origin.normalize(b"https://app.example.com:443"), Some("https://app.example.com".to_owned()));
assert_eq!(origin.normalize(b"http://app.example.com"), None);
Rust
pub const LOCALHOST: &str = "localhost"

The only host allowed over plain HTTP, when it is also the RP ID.