Coverage for src/ssh_agent_client/types.py: 100.000%
13 statements
« prev ^ index » next coverage.py v7.6.0, created at 2024-07-14 11:39 +0200
« prev ^ index » next coverage.py v7.6.0, created at 2024-07-14 11:39 +0200
1# SPDX-FileCopyrightText: 2024 Marco Ricci <m@the13thletter.info>
2#
3# SPDX-License-Identifier: MIT
5"""Common typing declarations for the parent module."""
7from __future__ import annotations
9import enum
11from typing import NamedTuple
13__all__ = ('KeyCommentPair', 'SSH_AGENT', 'SSH_AGENTC')
15class KeyCommentPair(NamedTuple):
16 """SSH key plus comment pair. For typing purposes.
18 Attributes:
19 key: SSH key.
20 comment: SSH key comment.
22 """
23 key: bytes | bytearray
24 comment: bytes | bytearray
26class SSH_AGENTC(enum.Enum):
27 """SSH agent protocol numbers: client requests.
29 Attributes:
30 REQUEST_IDENTITIES:
31 List identities. Expecting `SSH_AGENT.IDENTITIES_ANSWER`.
32 SIGN_REQUEST:
33 Sign data. Expecting `SSH_AGENT.SIGN_RESPONSE`.
35 """
36 REQUEST_IDENTITIES: int = 11
37 SIGN_REQUEST: int = 13
39class SSH_AGENT(enum.Enum):
40 """SSH agent protocol numbers: server replies.
42 Attributes:
43 IDENTITIES_ANSWER:
44 Successful answer to `SSH_AGENTC.REQUEST_IDENTITIES`.
45 SIGN_RESPONSE:
46 Successful answer to `SSH_AGENTC.SIGN_REQUEST`.
48 """
49 IDENTITIES_ANSWER: int = 12
50 SIGN_RESPONSE: int = 14