redditwarp.auth.token_revocation_client_ASYNC#

class redditwarp.auth.token_revocation_client_ASYNC.TokenRevocationClient(http: HTTPClient, url: str, client_creds: ClientCredentials)[source]#

Bases: object

Makes token revocation requests.

http: HTTPClient#
url: str#
client_creds: ClientCredentials#
async revoke_token(token: str, token_type_hint: str = '') None[source]#

Makes a revocation request for a token.

Parameters:
  • token (str) – The token to be revoked.

  • token_type_hint (str) – A hint about the type of the token (e.g. access_token, refresh_token). This is supposed to make the operation slightly quicker for the server. If the given hint is invalid then the server should still attempt to resolve and revoke the token.

async revoke_access_token(token: str) None[source]#

Makes a revocation request for an access token.

Calls self.revoke_token(token, 'access_token').

Parameters:

token (str) – The access token to be revoked.

async revoke_refresh_token(token: str) None[source]#

Makes a revocation request for a refresh token.

Calls self.revoke_token(token, 'refresh_token').

Parameters:

token (str) – The refresh token to be revoked.