A library for ATProtocol identities.

Compare changes

Choose any two refs to compare.

Changed files
+11
crates
atproto-xrpcs
+11
crates/atproto-xrpcs/src/authorization.rs
··· 20 20 /// 21 21 /// Contains JWT header, validated claims, original token, and validation status. 22 22 /// Resolves DID documents via the configured identity resolver. 23 + #[derive(Clone)] 23 24 pub struct Authorization(pub Header, pub Claims, pub String, pub bool); 25 + 26 + impl Authorization { 27 + /// identity returns the optional issuer claim of the authorization structure. 28 + pub fn identity(&self) -> Option<&str> { 29 + if self.3 { 30 + return self.1.jose.issuer.as_deref(); 31 + } 32 + None 33 + } 34 + } 24 35 25 36 impl<S> OptionalFromRequestParts<S> for Authorization 26 37 where