[−][src]Struct postgres_protocol::authentication::sasl::ScramSha256
A type which handles the client side of the SCRAM-SHA-256/SCRAM-SHA-256-PLUS authentication process.
During the authentication process, if the backend sends an AuthenticationSASL
message which
includes SCRAM-SHA-256
as an authentication mechanism, this type can be used.
After a ScramSha256
is constructed, the buffer returned by the message()
method should be
sent to the backend in a SASLInitialResponse
message along with the mechanism name.
The server will reply with an AuthenticationSASLContinue
message. Its contents should be
passed to the update()
method, after which the buffer returned by the message()
method
should be sent to the backend in a SASLResponse
message.
The server will reply with an AuthenticationSASLFinal
message. Its contents should be passed
to the finish()
method, after which the authentication process is complete.
Methods
impl ScramSha256
[src]
pub fn new(password: &[u8], channel_binding: ChannelBinding) -> ScramSha256
[src]
Constructs a new instance which will use the provided password for authentication.
pub fn message(&self) -> &[u8]
[src]
Returns the message which should be sent to the backend in an SASLResponse
message.
pub fn update(&mut self, message: &[u8]) -> Result<()>
[src]
Updates the state machine with the response from the backend.
This should be called when an AuthenticationSASLContinue
message is received.
pub fn finish(&mut self, message: &[u8]) -> Result<()>
[src]
Finalizes the authentication process.
This should be called when the backend sends an AuthenticationSASLFinal
message.
Authentication has only succeeded if this method returns Ok(())
.
Auto Trait Implementations
impl Send for ScramSha256
impl Sync for ScramSha256
impl Unpin for ScramSha256
impl UnwindSafe for ScramSha256
impl RefUnwindSafe for ScramSha256
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,