Skip to content

derivepassphrase_sshagentsocketprovider

Definitions for derivepassphrase’s SSH agent socket providers.

ENTRY_POINT_GROUP_NAME module-attribute

ENTRY_POINT_GROUP_NAME = (
    "derivepassphrase.ssh_agent_socket_providers"
)

The name of the entry point group for SSH agent socket providers.

We pledge to not change the interface of the entry point (name, type of the referred object) in a backwards-incompatible way without both

  1. increasing the major version number of the package, and
  2. changing the entry point name.

(We cannot, however, guarantee that all consumers of this API will continue to support superseded entry point definitions forever. That is up to the individual API consumer to decide.)

SSHAgentSocket

Bases: Protocol

An abstract networking socket connected to an SSH agent.

The abstract socket supports the sendall and a recv operation, with the same signatures and semantics as for “real” sockets. The abstract socket also supports use as a context manager, for automatically closing the socket upon exiting the context.

__enter__

__enter__() -> Any

Returns self.

__exit__

__exit__(*args: object) -> bool | None

Closes the socket.

sendall

sendall(data: Buffer, flags: int = 0) -> None

recv

recv(bufsize: int, flags: int = 0) -> bytes

SSHAgentSocketProvider

Bases: Protocol

A callable that provides an SSH agent socket.

__call__

__call__() -> SSHAgentSocket

Returns an SSH agent socket when called without arguments.

SSHAgentSocketProviderEntry

Bases: NamedTuple

Registry information for the table of SSH agent socket providers.

Third-party developers can register new socket providers for auto-discovery by setting up an entry point named derivepassphrase.ssh_agent_socket_providers, referencing an instance of this class. derivepassphrase will then add appropriate entries to the registry.

Attributes:

Name Type Description
provider SSHAgentSocketProvider

The callable that provides the socket.

key str

The table key which this entry is registered as.

aliases tuple[str, ...]

Other keys that shall point to this entry’s key.

Note

The socket provider registry table uses the key as the key, and the provider as the value. It does not store this info object directly.

provider instance-attribute

key instance-attribute

key: str

aliases instance-attribute

aliases: tuple[str, ...]