pub struct SuccessfulAuthentication {
pub client_key: PublicKey,
pub mechanism: Mechanism,
}server only.Expand description
Result of a successful authentication handshake.
This struct represents a client that has successfully authenticated itself to the relay
server. The authorization must still be confirmed by calling Self::authorize_if to
complete the protocol and notify the client of success or failure.
Fields§
§client_key: PublicKeyThe authenticated client’s public key.
mechanism: MechanismThe authentication mechanism that was used.
Implementations§
Source§impl SuccessfulAuthentication
impl SuccessfulAuthentication
Authorizes a ClientRequest and completes the authorization protocol.
This invokes AccessControl::on_connect with the ClientRequest and informs the client about the
authorization decision.
Returns OnDisconnectGuard in case the authorization was successful and the confirmation
message was sent to the client. The handshake protocol is now complete.
Returns an error if the authorization failed or if the confirmation message could not be sent.
Completes the authorization protocol by notifying the client of success or failure.
After a client has been successfully authenticated via serverside, the server must
decide whether to authorize the client (allow access) or deny it. This method sends
the authorization decision to the client and completes the handshake protocol.
§Arguments
access- Whether to grant access to the authenticated clientio- The WebSocket stream to send the authorization response on
§Returns
Ok(PublicKey)- The client’s public key if authorization was grantedErr(Error)- If authorization was denied or communication failed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SuccessfulAuthentication
impl RefUnwindSafe for SuccessfulAuthentication
impl Send for SuccessfulAuthentication
impl Sync for SuccessfulAuthentication
impl Unpin for SuccessfulAuthentication
impl UnwindSafe for SuccessfulAuthentication
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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