pub struct EnterReq {
pub identifying_attr: Option<Signed<Attr>>,
pub mode: EnterMode,
pub add_attrs: Vec<Signed<Attr>>,
pub register_only_with_unique_attrs: bool,
}Expand description
Request to log in to an existing account, or register a new one.
Also used to add attributes to the new or existing user account.
May fail with ErrorCode::BadRequest when:
identifying_attris not identifying- The same attribute appears twice among
add_attrsandidentifying_attr. - A non-addable attribute is in
add_attrs(such as a pubhubs card attribute not obtained via theauths::CardEPendpoint. - Neither an identifying nor a auth token (via the
Authorizationheader) is provided. - When the auth token is used, but the mode is not login.
Fields§
§identifying_attr: Option<Signed<Attr>>Attribute identifying the user.
If omitted, an AuthToken must be passed via the Authorization header instead.
mode: EnterModeThe mode determines whether we want to create an account if none exists, and whether we expect an account to exist.
add_attrs: Vec<Signed<Attr>>Add these attributes to your account, required, for example, when registering a new account, or when no bannable attribute is registered for this account.
register_only_with_unique_attrs: boolWhen the registration of a new user account is needed for this request, check that none
of the provided attributes already bans another user. If one of the supplied
attributes does ban another user, EnterResp::AttributeAlreadyTaken is returned.
Checking for this condition is useful when an end-user already has an account, supplied one attribute that bans it, but not an identifying attribute tied to their original account. If this check is not performed, a second account is created, which is not what the user might want. With this check, the frontend can prompt the user to confirm that they really do want to create a (potential) second account.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for EnterReq
impl<'de> Deserialize<'de> for EnterReq
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>,
Auto Trait Implementations§
impl Freeze for EnterReq
impl RefUnwindSafe for EnterReq
impl Send for EnterReq
impl Sync for EnterReq
impl Unpin for EnterReq
impl UnsafeUnpin for EnterReq
impl UnwindSafe for EnterReq
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
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>
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>
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