Struct ServerResponse

Source
pub struct ServerResponse {
    pub protocol_version: ProtocolVersion,
    pub nut: String,
    pub transaction_indication_flags: Vec<TIFValue>,
    pub query_url: String,
    pub success_url: Option<String>,
    pub cancel_url: Option<String>,
    pub secret_index: Option<String>,
    pub server_unlock_key: Option<String>,
    pub ask: Option<String>,
}
Expand description

An object representing a response from the server

Fields§

§protocol_version: ProtocolVersion

The SQRL protocol versions supported by the server (ver)

§nut: String

The nut to be used for signing the next request (nut)

§transaction_indication_flags: Vec<TIFValue>

A collection of transaction indication flags (tif)

§query_url: String

The server object to query in the next request (qry)

§success_url: Option<String>

If CPS set, the url to redirect the client’s browser to after successful authentication (url)

§cancel_url: Option<String>

If CPS set, a url to use to cancel a user’s authentication (can)

§secret_index: Option<String>

The secret index used for requesting a client to return an indexed secret (sin)

§server_unlock_key: Option<String>

The server unlock key requested by the client (suk)

§ask: Option<String>

A way for the server to request that the client display a prompt to the client user and return the selection (ask)

Implementations§

Source§

impl ServerResponse

Source

pub fn new( nut: String, transaction_indication_flags: Vec<TIFValue>, query_url: String, ) -> ServerResponse

Create a new server response object from the nut and tif values

Source

pub fn from_base64(base64_string: &str) -> Result<Self>

Decode a server response from a base64-encoded value

Source

pub fn to_base64(&self) -> String

Return the base64-encoded value of the server response

Trait Implementations§

Source§

impl Debug for ServerResponse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ServerResponse

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromStr for ServerResponse

Source§

type Err = SqrlError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl PartialEq for ServerResponse

Source§

fn eq(&self, other: &ServerResponse) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ServerResponse

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,