mmisp-lib 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/PKG-INFO +7 -1
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/README.md +3 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/pyproject.toml +7 -1
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/auth_keys.py +52 -3
- mmisp_lib-0.3.0/src/mmisp/api_schemas/authentication.py +89 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/events.py +45 -45
- mmisp_lib-0.3.0/src/mmisp/api_schemas/galaxy_clusters.py +64 -0
- mmisp_lib-0.3.0/src/mmisp/api_schemas/jobs.py +52 -0
- mmisp_lib-0.3.0/src/mmisp/api_schemas/organisations.py +126 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/roles.py +80 -0
- mmisp_lib-0.3.0/src/mmisp/api_schemas/servers.py +79 -0
- mmisp_lib-0.3.0/src/mmisp/api_schemas/statistics.py +19 -0
- mmisp_lib-0.3.0/src/mmisp/api_schemas/users.py +182 -0
- mmisp_lib-0.3.0/src/mmisp/commandline_tool/main.py +179 -0
- mmisp_lib-0.3.0/src/mmisp/commandline_tool/organisation.py +157 -0
- mmisp_lib-0.3.0/src/mmisp/commandline_tool/setup.py +101 -0
- mmisp_lib-0.3.0/src/mmisp/commandline_tool/user.py +126 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/config.py +6 -1
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/database.py +25 -9
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/identity_provider.py +1 -1
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/organisation.py +1 -2
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/user_setting.py +2 -0
- mmisp_lib-0.3.0/src/mmisp/workflows/__init__.py +0 -0
- mmisp_lib-0.3.0/src/mmisp/workflows/py.typed +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp_lib.egg-info/PKG-INFO +7 -1
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp_lib.egg-info/SOURCES.txt +12 -1
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp_lib.egg-info/requires.txt +3 -0
- mmisp_lib-0.3.0/tests/test_commandline_tool.py +255 -0
- mmisp_lib-0.2.0/src/mmisp/api_schemas/authentication.py +0 -38
- mmisp_lib-0.2.0/src/mmisp/api_schemas/organisations.py +0 -24
- mmisp_lib-0.2.0/src/mmisp/api_schemas/users.py +0 -52
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/LICENSE +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/setup.cfg +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/__init__.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/attributes.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/common.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/feeds.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/galaxies.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/logs.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/noticelists.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/objects.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/py.typed +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/responses/__init__.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/responses/check_graph_response.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/responses/standard_status_response.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/sharing_groups.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/sightings.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/tags.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/taxonomies.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/user_settings.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/warninglists.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/api_schemas/workflows.py +0 -0
- {mmisp_lib-0.2.0/src/mmisp/db → mmisp_lib-0.3.0/src/mmisp/commandline_tool}/__init__.py +0 -0
- {mmisp_lib-0.2.0/src/mmisp/db → mmisp_lib-0.3.0/src/mmisp/commandline_tool}/py.typed +0 -0
- {mmisp_lib-0.2.0/src/mmisp/db/models → mmisp_lib-0.3.0/src/mmisp/db}/__init__.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/all_models.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/mixins.py +0 -0
- {mmisp_lib-0.2.0/src/mmisp/lib → mmisp_lib-0.3.0/src/mmisp/db/models}/__init__.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/admin_setting.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/attribute.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/auth_key.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/event.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/feed.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/galaxy.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/galaxy_cluster.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/log.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/noticelist.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/object.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/role.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/server.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/sharing_group.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/sighting.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/tag.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/taxonomy.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/user.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/warninglist.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/workflow.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/models/workflow_blueprint.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/mypy.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/db/print_changes.py +0 -0
- {mmisp_lib-0.2.0/src/mmisp/lib → mmisp_lib-0.3.0/src/mmisp/db}/py.typed +0 -0
- {mmisp_lib-0.2.0/src/mmisp/util → mmisp_lib-0.3.0/src/mmisp/lib}/__init__.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/lib/actions.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/lib/attributes.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/lib/logging.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/lib/permissions.py +0 -0
- {mmisp_lib-0.2.0/src/mmisp/plugins → mmisp_lib-0.3.0/src/mmisp/lib}/py.typed +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/lib/uuid.py +0 -0
- {mmisp_lib-0.2.0/src/mmisp/util → mmisp_lib-0.3.0/src/mmisp/plugins}/py.typed +0 -0
- {mmisp_lib-0.2.0/src/mmisp/workflows → mmisp_lib-0.3.0/src/mmisp/util}/__init__.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/util/crypto.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/util/models.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/util/partial.py +0 -0
- {mmisp_lib-0.2.0/src/mmisp/workflows → mmisp_lib-0.3.0/src/mmisp/util}/py.typed +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/util/uuid.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/workflows/execution.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/workflows/fastapi.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/workflows/graph.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/workflows/input.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/workflows/legacy.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/workflows/misp_core_format.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp/workflows/modules.py +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp_lib.egg-info/dependency_links.txt +0 -0
- {mmisp_lib-0.2.0 → mmisp_lib-0.3.0}/src/mmisp_lib.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: mmisp-lib
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0
|
4
4
|
Requires-Python: >=3.11.0
|
5
5
|
Description-Content-Type: text/markdown
|
6
6
|
License-File: LICENSE
|
@@ -20,6 +20,7 @@ Requires-Dist: bcrypt==4.1.2
|
|
20
20
|
Requires-Dist: nanoid==2.0.0
|
21
21
|
Requires-Dist: cryptography==42.0.5
|
22
22
|
Requires-Dist: jinja2~=3.1.4
|
23
|
+
Requires-Dist: fire
|
23
24
|
Provides-Extra: dev
|
24
25
|
Requires-Dist: ruff>=0.3.7; extra == "dev"
|
25
26
|
Requires-Dist: mypy==1.8.0; extra == "dev"
|
@@ -30,6 +31,8 @@ Requires-Dist: pytest-asyncio==0.23.5.post1; extra == "dev"
|
|
30
31
|
Requires-Dist: pytest-cov==4.1.0; extra == "dev"
|
31
32
|
Requires-Dist: respx==0.20.2; extra == "dev"
|
32
33
|
Requires-Dist: mysql-connector-python==8.3.0; extra == "dev"
|
34
|
+
Requires-Dist: icecream; extra == "dev"
|
35
|
+
Requires-Dist: asyncio; extra == "dev"
|
33
36
|
|
34
37
|
# Modern MISP - API
|
35
38
|
|
@@ -47,6 +50,9 @@ Create a file called `.env` and copy the contents of `.env.example` into it. Fin
|
|
47
50
|
|
48
51
|
You should now be able to access the api on `localhost:4000`.
|
49
52
|
|
53
|
+
To use the commandline tool run `python .\src\mmisp\commandline_tool\main.py --h` from the base directory to view all commands. For detailed information of all commands: `python .\src\mmisp\commandline_tool\main.py --help`.
|
54
|
+
For setting up the DB use the commandline tool option for setup and then create your user account. In case you have not created a new organisation yet, please add your account to the setup basic organisation: ghost_org.
|
55
|
+
|
50
56
|
Run tests using `make test` (local database container required running) or `make test/lite`.
|
51
57
|
|
52
58
|
## Setting up your IDE
|
@@ -14,6 +14,9 @@ Create a file called `.env` and copy the contents of `.env.example` into it. Fin
|
|
14
14
|
|
15
15
|
You should now be able to access the api on `localhost:4000`.
|
16
16
|
|
17
|
+
To use the commandline tool run `python .\src\mmisp\commandline_tool\main.py --h` from the base directory to view all commands. For detailed information of all commands: `python .\src\mmisp\commandline_tool\main.py --help`.
|
18
|
+
For setting up the DB use the commandline tool option for setup and then create your user account. In case you have not created a new organisation yet, please add your account to the setup basic organisation: ghost_org.
|
19
|
+
|
17
20
|
Run tests using `make test` (local database container required running) or `make test/lite`.
|
18
21
|
|
19
22
|
## Setting up your IDE
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "mmisp-lib"
|
3
|
-
version = "0.
|
3
|
+
version = "0.3.0"
|
4
4
|
description = ""
|
5
5
|
authors = []
|
6
6
|
readme = "README.md"
|
@@ -24,6 +24,7 @@ dependencies = [
|
|
24
24
|
"nanoid==2.0.0",
|
25
25
|
"cryptography==42.0.5",
|
26
26
|
"jinja2~=3.1.4",
|
27
|
+
"fire",
|
27
28
|
]
|
28
29
|
|
29
30
|
|
@@ -38,6 +39,8 @@ dev = [
|
|
38
39
|
"pytest-cov==4.1.0",
|
39
40
|
"respx==0.20.2",
|
40
41
|
"mysql-connector-python==8.3.0",
|
42
|
+
"icecream",
|
43
|
+
"asyncio",
|
41
44
|
]
|
42
45
|
|
43
46
|
[tool.setuptools.package-data]
|
@@ -58,6 +61,9 @@ unsafe-fixes = true
|
|
58
61
|
select = ["E", "F", "W", "I", "ICN", "ANN"]
|
59
62
|
ignore = ["ANN002", "ANN003", "ANN401"]
|
60
63
|
|
64
|
+
[tool.ruff.lint.per-file-ignores]
|
65
|
+
"tests/**" = ["ANN001", "ANN201", "ANN202", "S101"]
|
66
|
+
|
61
67
|
[tool.coverage.run]
|
62
68
|
concurrency = ["greenlet", "thread"]
|
63
69
|
include = [
|
@@ -1,6 +1,7 @@
|
|
1
1
|
from datetime import datetime
|
2
|
+
from typing import List, Self, Union
|
2
3
|
|
3
|
-
from pydantic import BaseModel, PositiveInt, conint
|
4
|
+
from pydantic import BaseModel, PositiveInt, conint, validator
|
4
5
|
|
5
6
|
|
6
7
|
class SearchGetAuthKeysResponseItemUser(BaseModel):
|
@@ -41,6 +42,21 @@ class SearchGetAuthKeysResponseItemAuthKey(BaseModel):
|
|
41
42
|
unique_ips: list[str] | None = []
|
42
43
|
|
43
44
|
|
45
|
+
class SearchGetAuthKeysResponseAuthKey(BaseModel):
|
46
|
+
id: str
|
47
|
+
uuid: str
|
48
|
+
authkey_start: str
|
49
|
+
authkey_end: str
|
50
|
+
created: str
|
51
|
+
expiration: str
|
52
|
+
read_only: bool
|
53
|
+
user_id: str
|
54
|
+
comment: str | None
|
55
|
+
allowed_ips: list[str] | None = None
|
56
|
+
unique_ips: list[str] | None = []
|
57
|
+
last_used: str | None = None
|
58
|
+
|
59
|
+
|
44
60
|
class SearchGetAuthKeysResponseItem(BaseModel):
|
45
61
|
AuthKey: SearchGetAuthKeysResponseItemAuthKey
|
46
62
|
User: SearchGetAuthKeysResponseItemUser
|
@@ -49,6 +65,14 @@ class SearchGetAuthKeysResponseItem(BaseModel):
|
|
49
65
|
orm_mode = True
|
50
66
|
|
51
67
|
|
68
|
+
class SearchGetAuthKeysResponse(BaseModel):
|
69
|
+
AuthKey: SearchGetAuthKeysResponseAuthKey
|
70
|
+
User: SearchGetAuthKeysResponseItemUser
|
71
|
+
|
72
|
+
class Config:
|
73
|
+
orm_mode = True
|
74
|
+
|
75
|
+
|
52
76
|
class SearchAuthKeyBody(BaseModel):
|
53
77
|
page: PositiveInt = 1
|
54
78
|
limit: conint(gt=0, lt=500) = 25 # type: ignore
|
@@ -78,6 +102,20 @@ class EditAuthKeyResponseAuthKey(BaseModel):
|
|
78
102
|
allowed_ips: str | None = None
|
79
103
|
|
80
104
|
|
105
|
+
class EditAuthKeyResponseCompleteAuthKey(BaseModel):
|
106
|
+
id: str
|
107
|
+
uuid: str
|
108
|
+
authkey_start: str
|
109
|
+
authkey_end: str
|
110
|
+
created: str
|
111
|
+
expiration: str
|
112
|
+
read_only: bool
|
113
|
+
user_id: str
|
114
|
+
comment: str
|
115
|
+
allowed_ips: str | None = None
|
116
|
+
unique_ips: list[str] | None = None
|
117
|
+
|
118
|
+
|
81
119
|
class EditAuthKeyResponseUser(BaseModel):
|
82
120
|
id: str
|
83
121
|
org_id: str
|
@@ -88,11 +126,22 @@ class EditAuthKeyResponse(BaseModel):
|
|
88
126
|
User: EditAuthKeyResponseUser
|
89
127
|
|
90
128
|
|
129
|
+
class EditAuthKeyResponseCompl(BaseModel):
|
130
|
+
AuthKey: EditAuthKeyResponseCompleteAuthKey
|
131
|
+
User: EditAuthKeyResponseUser
|
132
|
+
|
133
|
+
|
91
134
|
class EditAuthKeyBody(BaseModel):
|
92
135
|
read_only: bool | None = None
|
93
136
|
comment: str | None = None
|
94
|
-
allowed_ips:
|
95
|
-
expiration:
|
137
|
+
allowed_ips: Union[str, List[str]] | None = None
|
138
|
+
expiration: str | None = None
|
139
|
+
|
140
|
+
@validator("allowed_ips", pre=True)
|
141
|
+
def ensure_list(cls: Self, v: str | List[str]) -> List[str]:
|
142
|
+
if isinstance(v, str):
|
143
|
+
return [v]
|
144
|
+
return v
|
96
145
|
|
97
146
|
|
98
147
|
class AddAuthKeyResponseAuthKey(BaseModel):
|
@@ -0,0 +1,89 @@
|
|
1
|
+
from enum import Enum
|
2
|
+
|
3
|
+
from pydantic import BaseModel
|
4
|
+
|
5
|
+
|
6
|
+
class TokenResponse(BaseModel):
|
7
|
+
token: str
|
8
|
+
|
9
|
+
|
10
|
+
class ChangeLoginInfoResponse(BaseModel):
|
11
|
+
successful: bool
|
12
|
+
|
13
|
+
|
14
|
+
class IdentityProviderBody(BaseModel):
|
15
|
+
name: str
|
16
|
+
org_id: str
|
17
|
+
active: bool
|
18
|
+
base_url: str
|
19
|
+
client_id: str
|
20
|
+
client_secret: str
|
21
|
+
scope: str | None = None
|
22
|
+
|
23
|
+
|
24
|
+
class IdentityProviderCallbackBody(BaseModel):
|
25
|
+
code: str
|
26
|
+
redirect_uri: str
|
27
|
+
|
28
|
+
|
29
|
+
class IdentityProviderEditBody(BaseModel):
|
30
|
+
name: str | None = None
|
31
|
+
org_id: str | None = None
|
32
|
+
active: bool | None = None
|
33
|
+
base_url: str | None = None
|
34
|
+
client_id: str | None = None
|
35
|
+
client_secret: str | None = None
|
36
|
+
scope: str | None = None
|
37
|
+
|
38
|
+
|
39
|
+
class GetIdentityProviderResponse(BaseModel):
|
40
|
+
id: str
|
41
|
+
name: str
|
42
|
+
org_id: str
|
43
|
+
active: bool
|
44
|
+
base_url: str
|
45
|
+
client_id: str
|
46
|
+
client_secret: str
|
47
|
+
scope: str | None = None
|
48
|
+
|
49
|
+
|
50
|
+
class IdentityProviderInfo(BaseModel):
|
51
|
+
id: str
|
52
|
+
name: str
|
53
|
+
url: str | None = None
|
54
|
+
|
55
|
+
class Config:
|
56
|
+
orm_mode = True
|
57
|
+
|
58
|
+
|
59
|
+
class LoginType(Enum):
|
60
|
+
PASSWORD = "password"
|
61
|
+
IDENTITY_PROVIDER = "idp"
|
62
|
+
|
63
|
+
|
64
|
+
class StartLoginBody(BaseModel):
|
65
|
+
email: str
|
66
|
+
|
67
|
+
|
68
|
+
class PasswordLoginBody(BaseModel):
|
69
|
+
email: str
|
70
|
+
password: str
|
71
|
+
|
72
|
+
|
73
|
+
class SetPasswordBody(BaseModel):
|
74
|
+
password: str
|
75
|
+
|
76
|
+
|
77
|
+
class ChangePasswordBody(BaseModel):
|
78
|
+
email: str
|
79
|
+
password: str
|
80
|
+
oldPassword: str | None = None
|
81
|
+
|
82
|
+
|
83
|
+
class ExchangeTokenLoginBody(BaseModel):
|
84
|
+
exchangeToken: str
|
85
|
+
|
86
|
+
|
87
|
+
class StartLoginResponse(BaseModel):
|
88
|
+
loginType: LoginType
|
89
|
+
identityProviders: list[IdentityProviderInfo] = []
|
@@ -23,6 +23,46 @@ class AddEditGetEventGalaxyClusterMeta(BaseModel):
|
|
23
23
|
kill_chain: str | None = None
|
24
24
|
|
25
25
|
|
26
|
+
class FreeTextImportWorkerData(BaseModel):
|
27
|
+
data: str
|
28
|
+
|
29
|
+
|
30
|
+
class FreeTextImportWorkerUser(BaseModel):
|
31
|
+
user_id: int
|
32
|
+
|
33
|
+
|
34
|
+
class FreeTextImportWorkerBody(BaseModel):
|
35
|
+
user: FreeTextImportWorkerUser
|
36
|
+
data: FreeTextImportWorkerData
|
37
|
+
|
38
|
+
class Config:
|
39
|
+
orm_mode = True
|
40
|
+
|
41
|
+
|
42
|
+
class AddAttributeViaFreeTextImportEventResponse(BaseModel):
|
43
|
+
comment: str | None = None
|
44
|
+
value: str
|
45
|
+
original_value: str
|
46
|
+
to_ids: str
|
47
|
+
type: str
|
48
|
+
category: str
|
49
|
+
distribution: str
|
50
|
+
|
51
|
+
class Config:
|
52
|
+
orm_mode = True
|
53
|
+
|
54
|
+
|
55
|
+
class AddAttributeViaFreeTextImportEventAttributes(BaseModel):
|
56
|
+
value: str
|
57
|
+
|
58
|
+
|
59
|
+
class AddAttributeViaFreeTextImportEventBody(BaseModel):
|
60
|
+
Attribute: AddAttributeViaFreeTextImportEventAttributes
|
61
|
+
|
62
|
+
class Config:
|
63
|
+
orm_mode = True
|
64
|
+
|
65
|
+
|
26
66
|
class GetAllEventsGalaxyCluster(BaseModel):
|
27
67
|
id: str
|
28
68
|
uuid: str
|
@@ -130,7 +170,7 @@ class AddEditGetEventGalaxy(BaseModel):
|
|
130
170
|
class AddEditGetEventOrg(BaseModel):
|
131
171
|
id: str
|
132
172
|
name: str
|
133
|
-
uuid: str
|
173
|
+
uuid: str | None = None
|
134
174
|
local: bool | None = None
|
135
175
|
|
136
176
|
|
@@ -254,7 +294,7 @@ class AddEditGetEventResponse(BaseModel):
|
|
254
294
|
class GetAllEventsOrg(BaseModel):
|
255
295
|
id: str
|
256
296
|
name: str
|
257
|
-
uuid: str
|
297
|
+
uuid: str | None = None
|
258
298
|
|
259
299
|
|
260
300
|
class UnpublishEventResponse(BaseModel):
|
@@ -416,8 +456,8 @@ class GetAllEventsEventTag(BaseModel):
|
|
416
456
|
event_id: str
|
417
457
|
tag_id: str
|
418
458
|
local: bool
|
419
|
-
relationship_type: str
|
420
|
-
Tag: GetAllEventsEventTagTag
|
459
|
+
relationship_type: str | None = None
|
460
|
+
Tag: GetAllEventsEventTagTag | None = None
|
421
461
|
|
422
462
|
|
423
463
|
class GetAllEventsResponse(BaseModel):
|
@@ -440,7 +480,7 @@ class GetAllEventsResponse(BaseModel):
|
|
440
480
|
sighting_timestamp: str
|
441
481
|
disable_correlation: bool
|
442
482
|
extends_uuid: str
|
443
|
-
event_creator_email: str # omitted
|
483
|
+
event_creator_email: str | None = None # omitted
|
444
484
|
protected: str | None = None
|
445
485
|
Org: GetAllEventsOrg
|
446
486
|
Orgc: GetAllEventsOrg
|
@@ -451,22 +491,6 @@ class GetAllEventsResponse(BaseModel):
|
|
451
491
|
orm_mode = True
|
452
492
|
|
453
493
|
|
454
|
-
class FreeTextImportWorkerData(BaseModel):
|
455
|
-
data: str
|
456
|
-
|
457
|
-
|
458
|
-
class FreeTextImportWorkerUser(BaseModel):
|
459
|
-
user_id: int
|
460
|
-
|
461
|
-
|
462
|
-
class FreeTextImportWorkerBody(BaseModel):
|
463
|
-
user: FreeTextImportWorkerUser
|
464
|
-
data: FreeTextImportWorkerData
|
465
|
-
|
466
|
-
class Config:
|
467
|
-
orm_mode = True
|
468
|
-
|
469
|
-
|
470
494
|
class EditEventBody(BaseModel):
|
471
495
|
info: str | None = None
|
472
496
|
org_id: str | None = None
|
@@ -546,30 +570,6 @@ class AddEventTag(BaseModel):
|
|
546
570
|
name: str
|
547
571
|
|
548
572
|
|
549
|
-
class AddAttributeViaFreeTextImportEventResponse(BaseModel):
|
550
|
-
comment: str | None = None
|
551
|
-
value: str
|
552
|
-
original_value: str
|
553
|
-
to_ids: str
|
554
|
-
type: str
|
555
|
-
category: str
|
556
|
-
distribution: str
|
557
|
-
|
558
|
-
class Config:
|
559
|
-
orm_mode = True
|
560
|
-
|
561
|
-
|
562
|
-
class AddAttributeViaFreeTextImportEventAttributes(BaseModel):
|
563
|
-
value: str
|
564
|
-
|
565
|
-
|
566
|
-
class AddAttributeViaFreeTextImportEventBody(BaseModel):
|
567
|
-
Attribute: AddAttributeViaFreeTextImportEventAttributes
|
568
|
-
|
569
|
-
class Config:
|
570
|
-
orm_mode = True
|
571
|
-
|
572
|
-
|
573
573
|
class AddEditGetEventRelatedEventAttributesOrg(BaseModel):
|
574
574
|
id: str
|
575
575
|
name: str
|
@@ -0,0 +1,64 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
|
3
|
+
from mmisp.api_schemas.events.add_edit_get_event_response import AddEditGetEventGalaxyClusterRelation
|
4
|
+
from mmisp.api_schemas.events.get_all_events_response import GetAllEventsGalaxyClusterGalaxy
|
5
|
+
from mmisp.api_schemas.galaxies import ExportGalaxyGalaxyElement, GetAllSearchGalaxiesAttributes
|
6
|
+
from mmisp.api_schemas.organisations import GetOrganisationResponse
|
7
|
+
from mmisp.api_schemas.organisations.organisation import Organisation
|
8
|
+
|
9
|
+
|
10
|
+
class GetGalaxyClusterResponse(BaseModel):
|
11
|
+
id: str | None = None
|
12
|
+
uuid: str | None = None
|
13
|
+
collection_uuid: str
|
14
|
+
type: str
|
15
|
+
value: str
|
16
|
+
tag_name: str
|
17
|
+
description: str
|
18
|
+
galaxy_id: str
|
19
|
+
source: str
|
20
|
+
authors: list[str]
|
21
|
+
version: str
|
22
|
+
distribution: str
|
23
|
+
sharing_group_id: str
|
24
|
+
org_id: str
|
25
|
+
orgc_id: str
|
26
|
+
default: bool
|
27
|
+
locked: bool
|
28
|
+
extends_uuid: str
|
29
|
+
extends_version: str
|
30
|
+
published: bool
|
31
|
+
deleted: bool
|
32
|
+
Galaxy: GetAllSearchGalaxiesAttributes
|
33
|
+
GalaxyElement: list[ExportGalaxyGalaxyElement]
|
34
|
+
Org: GetOrganisationResponse
|
35
|
+
Orgc: GetOrganisationResponse
|
36
|
+
|
37
|
+
|
38
|
+
class ExportGalaxyClusterResponse(BaseModel):
|
39
|
+
id: str
|
40
|
+
uuid: str
|
41
|
+
collection_uuid: str
|
42
|
+
type: str
|
43
|
+
value: str
|
44
|
+
tag_name: str
|
45
|
+
description: str
|
46
|
+
galaxy_id: str
|
47
|
+
source: str
|
48
|
+
authors: list[str]
|
49
|
+
version: str
|
50
|
+
distribution: str
|
51
|
+
sharing_group_id: str
|
52
|
+
org_id: str
|
53
|
+
orgc_id: str
|
54
|
+
default: bool
|
55
|
+
locked: bool
|
56
|
+
extends_uuid: str
|
57
|
+
extends_version: str
|
58
|
+
published: bool
|
59
|
+
deleted: bool
|
60
|
+
GalaxyElement: list[ExportGalaxyGalaxyElement]
|
61
|
+
Galaxy: GetAllEventsGalaxyClusterGalaxy
|
62
|
+
GalaxyClusterRelation: list[AddEditGetEventGalaxyClusterRelation] = []
|
63
|
+
Org: Organisation
|
64
|
+
Orgc: Organisation
|
@@ -0,0 +1,52 @@
|
|
1
|
+
from pydantic import BaseModel
|
2
|
+
|
3
|
+
|
4
|
+
class FreeTextProcessID(BaseModel):
|
5
|
+
id: str
|
6
|
+
|
7
|
+
|
8
|
+
class FreeTextImportWorkerData(BaseModel):
|
9
|
+
data: str
|
10
|
+
|
11
|
+
|
12
|
+
class FreeTextImportWorkerUser(BaseModel):
|
13
|
+
user_id: int
|
14
|
+
|
15
|
+
|
16
|
+
class FreeTextImportWorkerBody(BaseModel):
|
17
|
+
user: FreeTextImportWorkerUser
|
18
|
+
data: FreeTextImportWorkerData
|
19
|
+
|
20
|
+
class Config:
|
21
|
+
orm_mode = True
|
22
|
+
|
23
|
+
|
24
|
+
class AddAttributeViaFreeTextImportEventResponse(BaseModel):
|
25
|
+
event_id: str
|
26
|
+
value: str
|
27
|
+
original_value: str
|
28
|
+
to_ids: str
|
29
|
+
type: str
|
30
|
+
category: str
|
31
|
+
distribution: str
|
32
|
+
|
33
|
+
class Config:
|
34
|
+
orm_mode = True
|
35
|
+
|
36
|
+
|
37
|
+
class AddAttributeViaFreeTextImportEventBody(BaseModel):
|
38
|
+
value: str
|
39
|
+
returnMetaAttributes: bool
|
40
|
+
|
41
|
+
class Config:
|
42
|
+
orm_mode = True
|
43
|
+
|
44
|
+
|
45
|
+
class AttributeType(BaseModel):
|
46
|
+
types: list[str]
|
47
|
+
default_type: str
|
48
|
+
value: str
|
49
|
+
|
50
|
+
|
51
|
+
class ProcessFreeTextResponse(BaseModel):
|
52
|
+
attributes: list[AttributeType]
|
@@ -0,0 +1,126 @@
|
|
1
|
+
from datetime import datetime
|
2
|
+
|
3
|
+
from pydantic import BaseModel
|
4
|
+
|
5
|
+
|
6
|
+
class Organisation(BaseModel):
|
7
|
+
id: str
|
8
|
+
name: str
|
9
|
+
date_created: datetime
|
10
|
+
date_modified: datetime
|
11
|
+
description: str | None = None
|
12
|
+
type: str
|
13
|
+
nationality: str | None = None
|
14
|
+
sector: str | None = None
|
15
|
+
created_by: str
|
16
|
+
uuid: str
|
17
|
+
contacts: str | None = None
|
18
|
+
local: bool
|
19
|
+
"""organisation gains access to the local instance, otherwise treated as external"""
|
20
|
+
restricted_to_domain: str | None = None
|
21
|
+
landingpage: str | None = None
|
22
|
+
|
23
|
+
class Config:
|
24
|
+
orm_mode = True
|
25
|
+
|
26
|
+
|
27
|
+
class GetOrganisationResponse(BaseModel):
|
28
|
+
id: str
|
29
|
+
name: str
|
30
|
+
date_created: datetime
|
31
|
+
date_modified: datetime
|
32
|
+
description: str | None = None
|
33
|
+
type: str | None = None
|
34
|
+
nationality: str | None = None
|
35
|
+
sector: str | None = None
|
36
|
+
created_by: str
|
37
|
+
uuid: str | None = None
|
38
|
+
contacts: str | None = None
|
39
|
+
local: bool
|
40
|
+
restricted_to_domain: str | None = None
|
41
|
+
landingpage: str | None = None
|
42
|
+
|
43
|
+
|
44
|
+
class GetAllOrganisationsOrganisation(BaseModel):
|
45
|
+
id: str
|
46
|
+
name: str
|
47
|
+
date_created: datetime
|
48
|
+
date_modified: datetime
|
49
|
+
description: str | None = None
|
50
|
+
type: str | None = None
|
51
|
+
nationality: str | None = None
|
52
|
+
sector: str | None = None
|
53
|
+
created_by: str
|
54
|
+
uuid: str | None = None
|
55
|
+
contacts: str | None = None
|
56
|
+
local: bool
|
57
|
+
restricted_to_domain: str | None = None
|
58
|
+
landingpage: str | None = None
|
59
|
+
user_count: int
|
60
|
+
created_by_email: str
|
61
|
+
|
62
|
+
|
63
|
+
class GetAllOrganisationResponse(BaseModel):
|
64
|
+
Organisation: GetAllOrganisationsOrganisation
|
65
|
+
|
66
|
+
|
67
|
+
class DeleteForceUpdateOrganisationResponse(BaseModel):
|
68
|
+
saved: bool | None = None
|
69
|
+
success: bool | None = None
|
70
|
+
name: str
|
71
|
+
message: str
|
72
|
+
url: str
|
73
|
+
|
74
|
+
class Config:
|
75
|
+
orm_mode = True
|
76
|
+
|
77
|
+
|
78
|
+
class OrganisationUsersResponse(BaseModel):
|
79
|
+
id: int
|
80
|
+
name: str
|
81
|
+
date_created: datetime | None = None
|
82
|
+
date_modified: datetime | None = None
|
83
|
+
description: str | None = None
|
84
|
+
type: str | None = None
|
85
|
+
nationality: str | None = None
|
86
|
+
sector: str | None = None
|
87
|
+
created_by: int | None = None
|
88
|
+
uuid: str | None = None
|
89
|
+
contacts: str | None = None
|
90
|
+
local: bool | None = None
|
91
|
+
restricted_to_domain: str | None = None
|
92
|
+
landingpage: str | None = None
|
93
|
+
|
94
|
+
|
95
|
+
class AddOrganisation(BaseModel):
|
96
|
+
id: str
|
97
|
+
name: str
|
98
|
+
description: str | None = None
|
99
|
+
type: str
|
100
|
+
nationality: str | None = None
|
101
|
+
sector: str | None = None
|
102
|
+
created_by: str
|
103
|
+
contacts: str | None = None
|
104
|
+
local: bool
|
105
|
+
"""organisation gains access to the local instance, otherwise treated as external"""
|
106
|
+
restricted_to_domain: str | None = None
|
107
|
+
landingpage: str | None = None
|
108
|
+
|
109
|
+
class Config:
|
110
|
+
orm_mode = True
|
111
|
+
|
112
|
+
|
113
|
+
class EditOrganisation(BaseModel):
|
114
|
+
name: str
|
115
|
+
description: str | None = None
|
116
|
+
type: str
|
117
|
+
nationality: str | None = None
|
118
|
+
sector: str | None = None
|
119
|
+
contacts: str | None = None
|
120
|
+
local: bool
|
121
|
+
"""organisation gains access to the local instance, otherwise treated as external"""
|
122
|
+
restricted_to_domain: str | None = None
|
123
|
+
landingpage: str | None = None
|
124
|
+
|
125
|
+
class Config:
|
126
|
+
orm_mode = True
|