pub struct DpopSession { /* private fields */ }Expand description
Sends requests with DPoP proofs: a fresh proof per request, the remembered nonce, one retry on a nonce challenge.
Implementations§
Source§impl DpopSession
impl DpopSession
pub fn new(key: DpopKey) -> Self
pub fn key(&self) -> &DpopKey
Sourcepub fn headers(
&self,
method: &str,
url: &str,
access_token: Option<&str>,
) -> Result<Vec<(String, String)>, AuthError>
pub fn headers( &self, method: &str, url: &str, access_token: Option<&str>, ) -> Result<Vec<(String, String)>, AuthError>
The headers to put on a request: DPoP always, Authorization: DPoP <token> when a token goes with it.
Call once per request: a proof is single use.
Sourcepub async fn fetch<F>(
&self,
http: &Client,
method: &str,
url: &str,
request: F,
access_token: Option<&str>,
) -> Result<HttpReply, AuthError>
pub async fn fetch<F>( &self, http: &Client, method: &str, url: &str, request: F, access_token: Option<&str>, ) -> Result<HttpReply, AuthError>
Send a request with the proof added. A DPoP header the caller set is replaced. access_token adds ath (it
does not add an Authorization header: the caller owns that).
request is called with the attempt number (0, then 1 on the one retry after a nonce challenge): it is called
again for the retry, so a request that carries a single-use credential (a private_key_jwt assertion) can mint a
new one instead of replaying the first.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DpopSession
impl RefUnwindSafe for DpopSession
impl Send for DpopSession
impl Sync for DpopSession
impl Unpin for DpopSession
impl UnsafeUnpin for DpopSession
impl UnwindSafe for DpopSession
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
Mutably borrows from an owned value. Read more