secret_values

class litestar.datastructures.secret_values.SecretBytes[原始碼]

基底類別:SecretValue[bytes]

Represents a secret bytes value.

get_obscured() bytes[原始碼]

Overrides the base class method to return the hidden bytes value.

回傳:

The hidden bytes representation of the secret value.

回傳型別:

bytes

class litestar.datastructures.secret_values.SecretString[原始碼]

基底類別:SecretValue[str]

Represents a secret string value.

get_obscured() str[原始碼]

Overrides the base class method to return the hidden string value.

回傳:

The hidden string representation of the secret value.

回傳型別:

str

class litestar.datastructures.secret_values.SecretT

Type that represents a secret value of type str or bytes.

TypeVar('SecretT', bound=str | bytes) 的別名

class litestar.datastructures.secret_values.SecretValue[原始碼]

基底類別:ABC, Generic[SecretT]

Represents a secret value that can be of type str or bytes.

__init__(secret_value: SecretT) None[原始碼]

Initializes a SecretValue object with a secret value of type str or bytes.

參數:

secret_value (str | bytes) -- The secret value to be encapsulated.

get_secret() SecretT[原始碼]

Returns the actual secret value.

回傳:

The secret value.

回傳型別:

str | bytes

abstractmethod get_obscured() SecretT[原始碼]

Return the hidden representation of the secret value.

引發:

NotImplementedError -- Always raised to enforce implementation in subclasses.

__str__() str[原始碼]

Returns a string representation of the hidden secret value.

回傳:

String representation of the hidden secret value.

回傳型別:

str

__repr__() str[原始碼]

Returns a string representation of the object for debugging purposes.

回傳:

String representation of the object.

回傳型別:

str