class documentation

Main class for sanitizing tokens based on extracted version information.

This class uses a TokenVersionExtractor to identify the token format and applies appropriate sanitization rules to mask sensitive parts like signatures.

Parameters
extractorThe extractor to use for token version identification.
Static Method access_token_sanitizer Create a TokenSanitizer configured for access tokens.
Static Method credentials_sanitizer Create a TokenSanitizer configured for credentials.
Method __init__ Undocumented
Method is_supported Check if a token is supported by this sanitizer.
Method sanitize Sanitize a token by masking its sensitive parts.
Instance Variable extractor The extractor used to determine token version and recognition status.
@staticmethod
def access_token_sanitizer() -> TokenSanitizer: (source)

Create a TokenSanitizer configured for access tokens.

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

Create a TokenSanitizer configured for credentials.

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

Undocumented

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

Check if a token is supported by this sanitizer.

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

Sanitize a token by masking its sensitive parts.

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.