pub enum AuthEvent {
Provider {
name: String,
kind: ProviderKind,
label: Option<String>,
},
LoginUrl {
url: String,
state: String,
},
Session {
token: String,
principal: String,
agent: Option<String>,
name: Option<String>,
expires_at: i64,
ceiling: Vec<String>,
},
Waiting {
principal: String,
name: Option<String>,
provider: Option<String>,
since: i64,
},
Whoami {
principal: String,
name: Option<String>,
agent: Option<String>,
memberships: Vec<MembershipEntry>,
ceiling: Vec<String>,
},
LoggedOut {
principal: String,
},
Requires {
method: String,
grant: String,
target: Option<String>,
roles: Vec<String>,
public: bool,
},
Role {
role: String,
grants: Vec<String>,
all: bool,
},
Granted {
principal: String,
role: String,
scope: String,
},
Revoked {
principal: String,
scope: String,
roles: Vec<String>,
},
Error {
message: String,
error_kind: Option<String>,
grant: Option<String>,
scope: Option<String>,
roles: Option<Vec<String>>,
held_on: Option<Vec<String>>,
},
}Expand description
Every event the auth activation sends ({"type": …}).
Variants§
Provider
providers: one way in.
LoginUrl
login {browser} / signup: open this URL.
Session
login: signed in.
Fields
Waiting
signup (asking for access) / waiting (an admin’s list).
Whoami
whoami.
Fields
§
memberships: Vec<MembershipEntry>LoggedOut
logout.
Requires
requires {method}: its grant, its target, the roles that list it.
Role
roles / role_set: a role and its grants (all: every grant —
admin).
Granted
grant.
Revoked
revoke: the roles it removed there.
Error
Anything refused or failed. A refusal (error_kind: "forbidden")
carries AUTH-2’s fields.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AuthEvent
impl<'de> Deserialize<'de> for AuthEvent
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
impl Eq for AuthEvent
Source§impl JsonSchema for AuthEvent
impl JsonSchema for AuthEvent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for AuthEvent
Auto Trait Implementations§
impl Forget for AuthEvent
impl Freeze for AuthEvent
impl RefUnwindSafe for AuthEvent
impl Send for AuthEvent
impl Sync for AuthEvent
impl Unpin for AuthEvent
impl UnsafeUnpin for AuthEvent
impl UnwindSafe for AuthEvent
Blanket Implementations§
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.