pub struct RevocationRequest<'a, RT, TE>where
    RT: RevocableToken,
    TE: ErrorResponse,{ /* private fields */ }
Expand description

A request to revoke a token via an RFC 7009 compatible endpoint.

Implementations§

source§

impl<'a, RT, TE> RevocationRequest<'a, RT, TE>where RT: RevocableToken, TE: ErrorResponse + 'static,

source

pub fn add_extra_param<N, V>(self, name: N, value: V) -> Selfwhere N: Into<Cow<'a, str>>, V: Into<Cow<'a, str>>,

Appends an extra param to the token revocation request.

This method allows extensions to be used without direct support from this crate. If name conflicts with a parameter managed by this crate, the behavior is undefined. In particular, do not set parameters defined by RFC 6749 or RFC 7662.

Security Warning

Callers should follow the security recommendations for any OAuth2 extensions used with this function, which are beyond the scope of RFC 6749.

source

pub fn request<F, RE>( self, http_client: F ) -> Result<(), RequestTokenError<RE, TE>>where F: FnOnce(HttpRequest) -> Result<HttpResponse, RE>, RE: Error + 'static,

Synchronously sends the request to the authorization server and awaits a response.

A successful response indicates that the server either revoked the token or the token was not known to the server.

Error UnsupportedTokenType will be returned if the type of token type given is not supported by the server.

source

pub async fn request_async<C, F, RE>( self, http_client: C ) -> Result<(), RequestTokenError<RE, TE>>where C: FnOnce(HttpRequest) -> F, F: Future<Output = Result<HttpResponse, RE>>, RE: Error + 'static,

Asynchronously sends the request to the authorization server and returns a Future.

Trait Implementations§

source§

impl<'a, RT, TE> Debug for RevocationRequest<'a, RT, TE>where RT: RevocableToken + Debug, TE: ErrorResponse + Debug,

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, RT, TE> RefUnwindSafe for RevocationRequest<'a, RT, TE>where RT: RefUnwindSafe, TE: RefUnwindSafe,

§

impl<'a, RT, TE> Send for RevocationRequest<'a, RT, TE>where RT: Send, TE: Send,

§

impl<'a, RT, TE> Sync for RevocationRequest<'a, RT, TE>where RT: Sync, TE: Sync,

§

impl<'a, RT, TE> Unpin for RevocationRequest<'a, RT, TE>where RT: Unpin, TE: Unpin,

§

impl<'a, RT, TE> UnwindSafe for RevocationRequest<'a, RT, TE>where RT: UnwindSafe, TE: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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<T> for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more