pub struct CaepEvent {
pub jti: String,
pub iss: String,
pub iat: u64,
pub event_type: String,
pub subject: SubjectIdentifier,
pub initiating_entity: Option<EventReasonAdmin>,
pub reason_admin: Option<String>,
pub reason_user: Option<String>,
pub properties: HashMap<String, Value>,
}Expand description
A CAEP event (carried as a Security Event Token — SET).
Fields§
§jti: StringUnique event ID (jti).
iss: StringIssuer.
iat: u64Issued-at (Unix timestamp).
event_type: StringEvent type URI.
subject: SubjectIdentifierSubject identifier.
initiating_entity: Option<EventReasonAdmin>Initiating entity.
reason_admin: Option<String>Reason string for the event.
reason_user: Option<String>Reason string shown to the user.
properties: HashMap<String, Value>Additional event-specific claims.
Implementations§
Source§impl CaepEvent
impl CaepEvent
Sourcepub fn new(iss: &str, event_type: &str, subject: SubjectIdentifier) -> Self
pub fn new(iss: &str, event_type: &str, subject: SubjectIdentifier) -> Self
Build a new CAEP event with generated ID and timestamp.
Sourcepub fn with_initiating_entity(self, entity: EventReasonAdmin) -> Self
pub fn with_initiating_entity(self, entity: EventReasonAdmin) -> Self
Set the initiating entity.
Sourcepub fn with_reason_admin(self, reason: &str) -> Self
pub fn with_reason_admin(self, reason: &str) -> Self
Set the admin reason.
Sourcepub fn with_reason_user(self, reason: &str) -> Self
pub fn with_reason_user(self, reason: &str) -> Self
Set the user-facing reason.
Sourcepub fn with_property(self, key: &str, value: Value) -> Self
pub fn with_property(self, key: &str, value: Value) -> Self
Add an event-specific property.
Sourcepub fn to_set_claims(&self) -> Value
pub fn to_set_claims(&self) -> Value
Encode the event as a SET (Security Event Token) claims payload.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CaepEvent
impl<'de> Deserialize<'de> for CaepEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CaepEvent
impl RefUnwindSafe for CaepEvent
impl Send for CaepEvent
impl Sync for CaepEvent
impl Unpin for CaepEvent
impl UnsafeUnpin for CaepEvent
impl UnwindSafe for CaepEvent
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more