1# generated by datamodel-codegen:
2# filename: tuf_schema.json
3# version: 0.26.3
4
5from __future__ import annotations
6
7from typing import Any, Dict, Optional
8
9from pydantic import BaseModel, ConfigDict, Field, RootModel, StrictStr
10
11
12class Metadata(BaseModel):
13 """TUF metadata"""
14
15 model_config = ConfigDict(
16 populate_by_name=True,
17 )
18 content: Dict[str, Any] = Field(
19 ...,
20 description="Specifies the metadata inline within the document",
21 )
22
23
24class Root(BaseModel):
25 """root metadata containing about the public keys used to sign the manifest"""
26
27 model_config = ConfigDict(
28 populate_by_name=True,
29 )
30 content: Dict[str, Any] = Field(
31 ...,
32 description="Specifies the metadata inline within the document",
33 )
34
35
36class TufV001Schema(BaseModel):
37 """Schema for TUF metadata entries"""
38
39 model_config = ConfigDict(
40 populate_by_name=True,
41 )
42 spec_version: Optional[StrictStr] = Field(default=None, description="TUF specification version")
43 metadata: Metadata = Field(..., description="TUF metadata")
44 root: Root = Field(
45 ...,
46 description="root metadata containing about the public keys used to sign the manifest",
47 )
48
49
50class TufSchema(RootModel[TufV001Schema]):
51 model_config = ConfigDict(
52 populate_by_name=True,
53 )
54 root: TufV001Schema = Field(
55 ...,
56 description="Schema for TUF metadata objects",
57 title="TUF Schema",
58 )