Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/rekor_types/_internal/helm.py: 97%

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

36 statements  

1# generated by datamodel-codegen: 

2# filename: helm_schema.json 

3# version: 0.26.3 

4 

5from __future__ import annotations 

6 

7from enum import Enum 

8from typing import Optional, Union 

9 

10from pydantic import BaseModel, ConfigDict, Field, RootModel, StrictStr 

11 

12 

13class PublicKey(BaseModel): 

14 """The public key that can verify the package signature""" 

15 

16 model_config = ConfigDict( 

17 populate_by_name=True, 

18 ) 

19 content: str = Field( 

20 ..., 

21 description="Specifies the content of the public key inline within the document", 

22 ) 

23 

24 

25class Algorithm(str, Enum): 

26 """The hashing function used to compute the hash value""" 

27 

28 SHA256 = "sha256" 

29 

30 

31class Hash(BaseModel): 

32 """Specifies the hash algorithm and value for the chart""" 

33 

34 model_config = ConfigDict( 

35 populate_by_name=True, 

36 ) 

37 algorithm: Algorithm = Field( 

38 ..., 

39 description="The hashing function used to compute the hash value", 

40 ) 

41 value: StrictStr = Field(..., description="The hash value for the chart") 

42 

43 

44class Signature(BaseModel): 

45 """Information about the included signature in the provenance file""" 

46 

47 model_config = ConfigDict( 

48 populate_by_name=True, 

49 ) 

50 content: str = Field( 

51 ..., 

52 description="Specifies the signature embedded within the provenance file ", 

53 ) 

54 

55 

56class Provenance(BaseModel): 

57 """The provenance entry associated with the signed Helm Chart""" 

58 

59 model_config = ConfigDict( 

60 populate_by_name=True, 

61 ) 

62 signature: Signature = Field( 

63 ..., 

64 description="Information about the included signature in the provenance file", 

65 ) 

66 content: Optional[str] = Field( 

67 default=None, 

68 description="Specifies the content of the provenance file inline within the document", 

69 ) 

70 

71 

72class Provenance1(BaseModel): 

73 """The provenance entry associated with the signed Helm Chart""" 

74 

75 model_config = ConfigDict( 

76 populate_by_name=True, 

77 ) 

78 signature: Optional[Signature] = Field( 

79 default=None, 

80 description="Information about the included signature in the provenance file", 

81 ) 

82 content: str = Field( 

83 ..., 

84 description="Specifies the content of the provenance file inline within the document", 

85 ) 

86 

87 

88class Chart(BaseModel): 

89 """Information about the Helm chart associated with the entry""" 

90 

91 model_config = ConfigDict( 

92 populate_by_name=True, 

93 ) 

94 hash: Optional[Hash] = Field( 

95 default=None, 

96 description="Specifies the hash algorithm and value for the chart", 

97 ) 

98 provenance: Union[Provenance, Provenance1] = Field( 

99 ..., 

100 description="The provenance entry associated with the signed Helm Chart", 

101 ) 

102 

103 

104class HelmV001Schema(BaseModel): 

105 """Schema for Helm object""" 

106 

107 model_config = ConfigDict( 

108 populate_by_name=True, 

109 ) 

110 public_key: PublicKey = Field( 

111 ..., 

112 alias="publicKey", 

113 description="The public key that can verify the package signature", 

114 ) 

115 chart: Chart = Field( 

116 ..., 

117 description="Information about the Helm chart associated with the entry", 

118 ) 

119 

120 

121class HelmSchema(RootModel[HelmV001Schema]): 

122 model_config = ConfigDict( 

123 populate_by_name=True, 

124 ) 

125 root: HelmV001Schema = Field(..., description="Schema for Helm objects", title="Helm Schema")