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

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 

7from __future__ import annotations 

8 

9import enum 

10 

11from typing import NamedTuple 

12 

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

14 

15class 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 

26class 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 

39class 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