class documentation

Mask sensitive token parts according to the token version.

A TokenVersionExtractor identifies the token format. The sanitizer then masks sensitive parts such as signatures.

Parameters
extractorThe extractor to use for token version identification.
Static Method access_token_sanitizer Create a sanitizer for access tokens.
Static Method credentials_sanitizer Create a sanitizer for credentials.
Method __init__ Undocumented
Method is_supported Return whether this sanitizer supports the token format.
Method sanitize Mask the sensitive parts of a token.
Instance Variable extractor The extractor used to determine token version and recognition status.
@staticmethod
def access_token_sanitizer() -> TokenSanitizer: (source)

Create a sanitizer for access tokens.

Returns
TokenSanitizerA sanitizer instance with access token versions.
@staticmethod
def credentials_sanitizer() -> TokenSanitizer: (source)

Create a sanitizer for credentials.

Returns
TokenSanitizerA sanitizer instance with credentials versions.
def __init__(self, extractor: TokenVersionExtractor): (source)

Undocumented

def is_supported(self, token: str) -> bool: (source)

Return whether this sanitizer supports the token format.

Parameters
token:strThe token string to check.
Returns
boolTrue if the token format is supported, False otherwise.
def sanitize(self, token: str) -> str: (source)

Mask the sensitive parts of a token.

Parameters
token:strThe token string to sanitize.
Returns
strThe sanitized token with sensitive parts masked.

The extractor used to determine token version and recognition status.