plexus-auth-core 0.1.0

Sealed-type primitives for the Plexus auth framework: AuthContext, VerifiedUser, Principal.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! AUTHZ-CORE-CRATE-1 §"Required behavior" — Principal::User wraps a
//! sealed VerifiedUser. Because `VerifiedUser::new_sealed` is `pub(crate)`,
//! external crates cannot mint a User principal even if Principal::User is
//! a public variant.

use plexus_auth_core::{Principal, VerifiedUser};

fn main() {
    // Cannot get a VerifiedUser, so cannot get a Principal::User.
    let v = VerifiedUser::new_sealed("alice".into(), "i".into(), 0, 0);
    let _ = Principal::User(v);
}