Skip to content

ClearSignOperation#

Bases: SignOperation

ClearsSignOperation model class.

Source code in pubtools/sign/operations/clearsign.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@dataclass
class ClearSignOperation(SignOperation):
    """ClearsSignOperation model class."""

    ResultType: ClassVar[OperationResult]
    inputs: List[str] = field(
        metadata={
            "type": "list",
            "description": "Signing data",
            "required": "true",
            "sample": ["input1", "input2"],
        },
        default_factory=list,
    )
    signing_key: str = field(
        metadata={
            "type": "str",
            "description": "Signing key short id which should be used for signing",
            "required": "true",
            "sample": "123",
        },
        default="",
    )
    task_id: str = field(
        metadata={
            "type": "str",
            "description": "Usually pub task id, serves as identifier for in signing request",
            "required": "true",
            "sample": "1",
        },
        default="",
    )
    repo: str = field(
        metadata={
            "type": "str",
            "description": "Repository name",
            "required": "true",
            "sample": "repo",
        },
        default="",
    )
    requester: str = field(
        metadata={"description": "Requester of the signing operation"}, default=""
    )

    def to_dict(self) -> dict[str, Any]:
        """Return a dict representation of the object."""
        return dict(
            inputs=self.inputs,
            signing_key=self.signing_key,
            task_id=self.task_id,
            repo=self.repo,
            requester=self.requester,
        )

to_dict() #

Return a dict representation of the object.

Source code in pubtools/sign/operations/clearsign.py
57
58
59
60
61
62
63
64
65
def to_dict(self) -> dict[str, Any]:
    """Return a dict representation of the object."""
    return dict(
        inputs=self.inputs,
        signing_key=self.signing_key,
        task_id=self.task_id,
        repo=self.repo,
        requester=self.requester,
    )