clue-api 1.6.0.dev310__tar.gz → 1.6.0.dev320__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.
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/PKG-INFO +1 -1
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/security/__init__.py +11 -11
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/pyproject.toml +1 -1
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/LICENSE +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/README.md +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/.gitignore +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/base.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/v1/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/v1/actions.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/v1/auth.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/v1/configs.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/v1/fetchers.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/v1/lookup.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/v1/registration.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/v1/static.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/api/v1/sync.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/app.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/cache/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/bytes_utils.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/classification.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/classification.yml +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/dict_utils.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/exceptions.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/forge.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/json_utils.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/list_utils.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/logging/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/logging/audit.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/logging/format.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/regex.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/str_utils.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/swagger.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/common/uid.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/config.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/constants/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/constants/env.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/constants/supported_types.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/cronjobs/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/cronjobs/plugins.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/error.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/extensions/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/extensions/config.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/gunicorn_config.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/healthz.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/helper/discover.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/helper/headers.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/helper/oauth.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/actions.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/config.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/fetchers.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/graph.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/model_list.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/network.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/results/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/results/base.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/results/file.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/results/graph.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/results/image.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/results/status.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/results/validation.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/schema.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/selector.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/sync.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/models/validators.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/patched.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/plugin/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/plugin/celery_app.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/plugin/helpers/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/plugin/helpers/central_server.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/plugin/helpers/email_render.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/plugin/helpers/token.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/plugin/helpers/trino.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/plugin/models.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/plugin/utils.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/py.typed +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/remote/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/remote/datatypes/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/remote/datatypes/cache.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/remote/datatypes/events.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/remote/datatypes/hash.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/remote/datatypes/queues/__init__.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/remote/datatypes/queues/comms.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/remote/datatypes/set.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/remote/datatypes/user_quota_tracker.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/security/obo.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/security/utils.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/services/action_service.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/services/auth_service.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/services/config_service.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/services/fetcher_service.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/services/jwt_service.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/services/lookup_service.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/services/mongo_service.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/services/type_service.py +0 -0
- {clue_api-1.6.0.dev310 → clue_api-1.6.0.dev320}/clue/services/user_service.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import functools
|
|
2
2
|
from typing import Callable, Optional
|
|
3
3
|
|
|
4
|
-
import elasticapm
|
|
5
4
|
import requests
|
|
5
|
+
from elasticapm.traces import set_user_context
|
|
6
6
|
from flask import request
|
|
7
7
|
from jwt import ExpiredSignatureError
|
|
8
8
|
from prometheus_client import Counter
|
|
@@ -19,12 +19,8 @@ from clue.common.exceptions import (
|
|
|
19
19
|
NotFoundException,
|
|
20
20
|
)
|
|
21
21
|
from clue.common.forge import APP_NAME
|
|
22
|
-
from clue.common.logging import get_logger
|
|
23
|
-
from clue.common.logging.audit import audit
|
|
24
22
|
from clue.config import AUDIT, config
|
|
25
23
|
|
|
26
|
-
logger = get_logger(__file__)
|
|
27
|
-
|
|
28
24
|
SUCCESSFUL_ATTEMPTS = Counter(
|
|
29
25
|
f"{APP_NAME.replace('-', '_')}_auth_success_total",
|
|
30
26
|
"Successful Authentication Attempts",
|
|
@@ -95,6 +91,10 @@ class api_login(object): # noqa: N801
|
|
|
95
91
|
Returns:
|
|
96
92
|
_type_: _description_
|
|
97
93
|
"""
|
|
94
|
+
from clue.common.logging import get_logger
|
|
95
|
+
from clue.common.logging.audit import audit
|
|
96
|
+
|
|
97
|
+
logger = get_logger(__file__)
|
|
98
98
|
|
|
99
99
|
@functools.wraps(func)
|
|
100
100
|
def base(*args, **kwargs): # noqa: C901
|
|
@@ -189,7 +189,7 @@ class api_login(object): # noqa: N801
|
|
|
189
189
|
return internal_error(err=e.message)
|
|
190
190
|
|
|
191
191
|
if config.core.metrics.apm_server.server_url is not None:
|
|
192
|
-
|
|
192
|
+
set_user_context(
|
|
193
193
|
username=user.get("name", None),
|
|
194
194
|
email=user.get("email", None),
|
|
195
195
|
user_id=user.get("uname", None),
|
|
@@ -201,11 +201,11 @@ class api_login(object): # noqa: N801
|
|
|
201
201
|
SUCCESSFUL_ATTEMPTS.inc()
|
|
202
202
|
return func(*args, **kwargs)
|
|
203
203
|
|
|
204
|
-
base.protected = True
|
|
204
|
+
base.protected = True # type: ignore
|
|
205
205
|
# TODO: Fix type parsing and checks
|
|
206
206
|
# base.required_type = self.required_type
|
|
207
|
-
base.audit = self.audit
|
|
208
|
-
base.required_priv = self.required_priv
|
|
209
|
-
base.required_method = self.required_method
|
|
210
|
-
base.check_xsrf_token = self.check_xsrf_token
|
|
207
|
+
base.audit = self.audit # type: ignore
|
|
208
|
+
base.required_priv = self.required_priv # type: ignore
|
|
209
|
+
base.required_method = self.required_method # type: ignore
|
|
210
|
+
base.check_xsrf_token = self.check_xsrf_token # type: ignore
|
|
211
211
|
return base
|
|
@@ -141,7 +141,7 @@ log_cli_level = "WARN"
|
|
|
141
141
|
[tool.poetry]
|
|
142
142
|
package-mode = true
|
|
143
143
|
name = "clue-api"
|
|
144
|
-
version = "1.6.0.
|
|
144
|
+
version = "1.6.0.dev320"
|
|
145
145
|
description = "Clue distributed enrichment service"
|
|
146
146
|
authors = ["Canadian Centre for Cyber Security <contact@cyber.gc.ca>"]
|
|
147
147
|
license = "MIT"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|