Struct workstreams_api::auth::AuthRequest
source · [−]Expand description
All authentication requests are compromised of two elements: a) A message that follows EIP4361 b) A signature of said message
EIP4361 Template:
${domain} wants you to sign in with your Ethereum account:
${address}
${statement}
URI: ${uri}
Version: ${version}
Chain ID: ${chain-id}
Nonce: ${nonce}
Issued At: ${issued-at}
Expiration Time: ${expiration-time}
Not Before: ${not-before}
Request ID: ${request-id}
Resources:
- ${resources[0]}
- ${resources[1]}
...
- ${resources[n]}
Source: EIP4361
Fields
message: String
signature: String
Implementations
sourceimpl AuthRequest
impl AuthRequest
sourcepub async fn from_req(req: Request) -> Result<AuthRequest>
pub async fn from_req(req: Request) -> Result<AuthRequest>
Parses a worker::Request struct for an AuthRequest struct, serialized as a JSON object in the body of the request.
let router = Router::new();
router.post_async("/api/v1/authorize", |req, ctx| async move {
let auth_req: AuthRequest = AuthRequest::from_req(req).await?;
}).run(req, ctx).await
Trait Implementations
sourceimpl Debug for AuthRequest
impl Debug for AuthRequest
sourceimpl<'de> Deserialize<'de> for AuthRequest
impl<'de> Deserialize<'de> for AuthRequest
sourcefn 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
sourceimpl Serialize for AuthRequest
impl Serialize for AuthRequest
Auto Trait Implementations
impl RefUnwindSafe for AuthRequest
impl Send for AuthRequest
impl Sync for AuthRequest
impl Unpin for AuthRequest
impl UnwindSafe for AuthRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<T> ToRawKvValue for T where
T: Serialize,
impl<T> ToRawKvValue for T where
T: Serialize,
fn raw_kv_value(&self) -> Result<JsValue, KvError>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more