Skip to content

Submodule _types

derivepassphrase._types

Types used by derivepassphrase.

VaultConfigGlobalSettings

Bases: TypedDict

Configuration for vault: global settings.

Attributes:

Name Type Description
key NotRequired[str]

The base64-encoded ssh public key to use, overriding the master passphrase. Optional.

phrase NotRequired[str]

The master passphrase. Optional.

unicode_normalization_form NotRequired[Literal['NFC', 'NFD', 'NFKC', 'NFKD']]

The preferred Unicode normalization form; we warn the user if textual passphrases do not match their normalized forms. Optional, and a derivepassphrase extension.

VaultConfigServicesSettings

Bases: VaultConfigGlobalSettings

Configuration for vault: services settings.

Attributes:

Name Type Description
notes NotRequired[str]

Optional notes for this service, to display to the user when generating the passphrase.

length NotRequired[int]

Desired passphrase length.

repeat NotRequired[int]

The maximum number of immediate character repetitions allowed in the passphrase. Disabled if set to 0.

lower NotRequired[int]

Optional constraint on ASCII lowercase characters. If positive, include this many lowercase characters somewhere in the passphrase. If 0, avoid lowercase characters altogether.

upper NotRequired[int]

Same as lower, but for ASCII uppercase characters.

number NotRequired[int]

Same as lower, but for ASCII digits.

space NotRequired[int]

Same as lower, but for the space character.

dash NotRequired[int]

Same as lower, but for the hyphen-minus and underscore characters.

symbol NotRequired[int]

Same as lower, but for all other hitherto unlisted ASCII printable characters (except backquote).

VaultConfig

Bases: TypedDict, _VaultConfig

Configuration for vault.

Usually stored as JSON.

Attributes:

Name Type Description
global NotRequired[VaultConfigGlobalSettings]

Global settings.

services Required[dict[str, VaultConfigServicesSettings]]

Service-specific settings.

KeyCommentPair

Bases: NamedTuple

SSH key plus comment pair. For typing purposes.

Attributes:

Name Type Description
key bytes | bytearray

SSH key.

comment bytes | bytearray

SSH key comment.

SSH_AGENTC

Bases: Enum

SSH agent protocol numbers: client requests.

Attributes:

Name Type Description
REQUEST_IDENTITIES int

List identities. Expecting SSH_AGENT.IDENTITIES_ANSWER.

SIGN_REQUEST int

Sign data. Expecting SSH_AGENT.SIGN_RESPONSE.

SSH_AGENT

Bases: Enum

SSH agent protocol numbers: server replies.

Attributes:

Name Type Description
FAILURE int

Generic failure code.

SUCCESS int

Generic success code.

IDENTITIES_ANSWER int

Successful answer to SSH_AGENTC.REQUEST_IDENTITIES.

SIGN_RESPONSE int

Successful answer to SSH_AGENTC.SIGN_REQUEST.

is_vault_config

is_vault_config(obj: Any) -> TypeGuard[VaultConfig]

Check if obj is a valid vault config, according to typing.

Parameters:

Name Type Description Default
obj Any

The object to test.

required

Returns:

Type Description
TypeGuard[VaultConfig]

True if this is a vault config, false otherwise.