Coverage for src/ssh_agent_client/types.py: 100.000%

1# SPDX-FileCopyrightText: 2024 Marco Ricci <m@the13thletter.info>

2#

3# SPDX-License-Identifier: MIT

4

5"""Common typing declarations for the parent module."""

6

7 from __future__ import annotations

8

9 import enum

10

11 from typing import NamedTuple

12

13 __all__ = ('KeyCommentPair', 'SSH_AGENT', 'SSH_AGENTC')

14

15 class KeyCommentPair(NamedTuple):

16 """SSH key plus comment pair. For typing purposes.

17

18 Attributes:

19 key: SSH key.

20 comment: SSH key comment.

21

22 """

23 key: bytes | bytearray

24 comment: bytes | bytearray

25

26 class SSH_AGENTC(enum.Enum):

27 """SSH agent protocol numbers: client requests.

28

29 Attributes:

30 REQUEST_IDENTITIES:

31 List identities. Expecting `SSH_AGENT.IDENTITIES_ANSWER`.

32 SIGN_REQUEST:

33 Sign data. Expecting `SSH_AGENT.SIGN_RESPONSE`.

34

35 """

36 REQUEST_IDENTITIES: int = 11

37 SIGN_REQUEST: int = 13

38

39 class SSH_AGENT(enum.Enum):

40 """SSH agent protocol numbers: server replies.

41

42 Attributes:

43 IDENTITIES_ANSWER:

44 Successful answer to `SSH_AGENTC.REQUEST_IDENTITIES`.

45 SIGN_RESPONSE:

46 Successful answer to `SSH_AGENTC.SIGN_REQUEST`.

47

48 """

49 IDENTITIES_ANSWER: int = 12

50 SIGN_RESPONSE: int = 14