Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/sigstore_protobuf_specs/io/intoto/__init__.py: 91%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

23 statements  

1# Generated by the protocol buffer compiler. DO NOT EDIT! 

2# sources: envelope.proto 

3# plugin: python-betterproto 

4# This file has been @generated 

5 

6from typing import TYPE_CHECKING 

7 

8 

9if TYPE_CHECKING: 

10 from dataclasses import dataclass 

11else: 

12 from pydantic.dataclasses import dataclass 

13 

14from typing import List 

15 

16import betterproto 

17from pydantic.dataclasses import rebuild_dataclass 

18 

19 

20@dataclass(eq=False, repr=False) 

21class Envelope(betterproto.Message): 

22 """An authenticated message of arbitrary type.""" 

23 

24 payload: bytes = betterproto.bytes_field(1) 

25 """ 

26 Message to be signed. (In JSON, this is encoded as base64.) 

27 REQUIRED. 

28 """ 

29 

30 payload_type: str = betterproto.string_field(2) 

31 """ 

32 String unambiguously identifying how to interpret payload. 

33 REQUIRED. 

34 """ 

35 

36 signatures: List["Signature"] = betterproto.message_field(3) 

37 """ 

38 Signature over: 

39 PAE(type, payload) 

40 Where PAE is defined as: 

41 PAE(type, payload) = "DSSEv1" + SP + LEN(type) + SP + type + SP + LEN(payload) + SP + payload 

42 + = concatenation 

43 SP = ASCII space [0x20] 

44 "DSSEv1" = ASCII [0x44, 0x53, 0x53, 0x45, 0x76, 0x31] 

45 LEN(s) = ASCII decimal encoding of the byte length of s, with no leading zeros 

46 REQUIRED (length >= 1). 

47 """ 

48 

49 

50@dataclass(eq=False, repr=False) 

51class Signature(betterproto.Message): 

52 sig: bytes = betterproto.bytes_field(1) 

53 """ 

54 Signature itself. (In JSON, this is encoded as base64.) 

55 REQUIRED. 

56 """ 

57 

58 keyid: str = betterproto.string_field(2) 

59 """ 

60 *Unauthenticated* hint identifying which public key was used. 

61 OPTIONAL. 

62 """ 

63 

64 

65rebuild_dataclass(Envelope) # type: ignore