-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbinary_app.py
42 lines (33 loc) · 896 Bytes
/
binary_app.py
1
2
3
4
5
6
7
8
9
10
11
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
from enum import StrEnum
from typing import Literal
from pydantic import Field
from .parent import ParentModel
class HashType(StrEnum):
"""Type of hash to use for the binary."""
SHA256 = "sha256"
SHA512 = "sha512"
MD5 = "md5"
NONE = "none"
class BinaryApp(ParentModel):
"""
Represents a standalone Binary application.
This will fetch a standalone binary, validate its hash and add its
location to that path.
"""
app_type: Literal["binary"]
name: str = Field(
...,
description="Binary filename to use locally",
)
url: str = Field(
...,
description="URL to download the binary from.",
)
hash: str = Field(
"",
description="Hash to verify binary integrity",
)
hash_type: HashType = Field(
...,
description="Type of hash used to check the binary.",
)