logdetective 2.2.0__tar.gz → 2.2.1__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.
- {logdetective-2.2.0 → logdetective-2.2.1}/PKG-INFO +1 -1
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/server.py +9 -9
- {logdetective-2.2.0 → logdetective-2.2.1}/pyproject.toml +1 -1
- {logdetective-2.2.0 → logdetective-2.2.1}/LICENSE +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/README.md +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/__init__.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/constants.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/drain3.ini +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/extractors.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/logdetective.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/models.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/prompts-summary-first.yml +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/prompts-summary-only.yml +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/prompts.yml +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/remote_log.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/__init__.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/compressors.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/config.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/database/__init__.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/database/base.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/database/models/__init__.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/database/models/exceptions.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/database/models/koji.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/database/models/merge_request_jobs.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/database/models/metrics.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/emoji.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/exceptions.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/gitlab.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/koji.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/llm.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/metric.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/models.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/plot.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/templates/gitlab_full_comment.md.j2 +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/templates/gitlab_short_comment.md.j2 +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/utils.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/skip_snippets.yml +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective/utils.py +0 -0
- {logdetective-2.2.0 → logdetective-2.2.1}/logdetective.1.asciidoc +0 -0
|
@@ -106,35 +106,35 @@ async def get_http_session(request: Request) -> aiohttp.ClientSession:
|
|
|
106
106
|
return request.app.http
|
|
107
107
|
|
|
108
108
|
|
|
109
|
-
def requires_token_when_set(
|
|
109
|
+
def requires_token_when_set(authorization: Annotated[str | None, Header()] = None):
|
|
110
110
|
"""
|
|
111
|
-
FastAPI Depend function that expects a header named
|
|
111
|
+
FastAPI Depend function that expects a header named Authorization
|
|
112
112
|
|
|
113
113
|
If LOGDETECTIVE_TOKEN env var is set, validate the client-supplied token
|
|
114
114
|
otherwise ignore it
|
|
115
115
|
"""
|
|
116
116
|
if not API_TOKEN:
|
|
117
|
-
LOG.info("LOGDETECTIVE_TOKEN env var not set,
|
|
117
|
+
LOG.info("LOGDETECTIVE_TOKEN env var not set, authorization disabled")
|
|
118
118
|
# no token required, means local dev environment
|
|
119
119
|
return
|
|
120
|
-
if
|
|
120
|
+
if authorization:
|
|
121
121
|
try:
|
|
122
|
-
token =
|
|
122
|
+
token = authorization.split(" ", 1)[1]
|
|
123
123
|
except (ValueError, IndexError) as ex:
|
|
124
124
|
LOG.warning(
|
|
125
|
-
"
|
|
126
|
-
|
|
125
|
+
"Authorization header has invalid structure '%s', it should be 'Bearer TOKEN'",
|
|
126
|
+
authorization,
|
|
127
127
|
)
|
|
128
128
|
# eat the exception and raise 401 below
|
|
129
129
|
raise HTTPException(
|
|
130
130
|
status_code=401,
|
|
131
|
-
detail=f"Invalid
|
|
131
|
+
detail=f"Invalid authorization, HEADER '{authorization}' not valid.",
|
|
132
132
|
) from ex
|
|
133
133
|
if token == API_TOKEN:
|
|
134
134
|
return
|
|
135
135
|
LOG.info("Provided token '%s' does not match expected value.", token)
|
|
136
136
|
raise HTTPException(status_code=401, detail=f"Token '{token}' not valid.")
|
|
137
|
-
LOG.error("No
|
|
137
|
+
LOG.error("No authorization header provided but LOGDETECTIVE_TOKEN env var is set")
|
|
138
138
|
raise HTTPException(status_code=401, detail="No token provided.")
|
|
139
139
|
|
|
140
140
|
|
|
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
|
{logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/database/models/merge_request_jobs.py
RENAMED
|
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
|
{logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/templates/gitlab_full_comment.md.j2
RENAMED
|
File without changes
|
{logdetective-2.2.0 → logdetective-2.2.1}/logdetective/server/templates/gitlab_short_comment.md.j2
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|