djcheckup 0.4.2__tar.gz → 0.4.4__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.
- {djcheckup-0.4.2 → djcheckup-0.4.4}/PKG-INFO +1 -1
- {djcheckup-0.4.2 → djcheckup-0.4.4}/pyproject.toml +8 -2
- {djcheckup-0.4.2 → djcheckup-0.4.4}/src/djcheckup/checks.py +10 -2
- {djcheckup-0.4.2 → djcheckup-0.4.4}/src/djcheckup/cli.py +12 -2
- {djcheckup-0.4.2 → djcheckup-0.4.4}/LICENSE +0 -0
- {djcheckup-0.4.2 → djcheckup-0.4.4}/README.md +0 -0
- {djcheckup-0.4.2 → djcheckup-0.4.4}/src/djcheckup/__init__.py +0 -0
- {djcheckup-0.4.2 → djcheckup-0.4.4}/src/djcheckup/check_defs.py +0 -0
- {djcheckup-0.4.2 → djcheckup-0.4.4}/src/djcheckup/outputs.py +0 -0
- {djcheckup-0.4.2 → djcheckup-0.4.4}/src/djcheckup/run.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "djcheckup"
|
|
3
|
-
version = "0.4.
|
|
3
|
+
version = "0.4.4"
|
|
4
4
|
description = "DJ Checkup is a security scanner for Django sites."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [{ name = "Stuart Maxwell", email = "stuart@amanzi.nz" }]
|
|
@@ -44,7 +44,13 @@ project-includes = ["src/djcheckup/**"]
|
|
|
44
44
|
convention = "google" # Accepts: "google", "numpy", or "pep257".
|
|
45
45
|
|
|
46
46
|
[dependency-groups]
|
|
47
|
-
dev = [
|
|
47
|
+
dev = [
|
|
48
|
+
"nox>=2025.5.1",
|
|
49
|
+
"pre-commit>=4.4.0",
|
|
50
|
+
"pyrefly>=0.34.0",
|
|
51
|
+
"pytest>=8.4.2",
|
|
52
|
+
"pytest-cov>=7.0.0",
|
|
53
|
+
]
|
|
48
54
|
|
|
49
55
|
[tool.pytest.ini_options]
|
|
50
56
|
pythonpath = "."
|
|
@@ -390,7 +390,7 @@ Error message:
|
|
|
390
390
|
name=check_name,
|
|
391
391
|
result=CheckResult.FAILURE,
|
|
392
392
|
severity_score=severity_weight,
|
|
393
|
-
message=f"{error_message}
|
|
393
|
+
message=f"{error_message} \n\n> `{e}`",
|
|
394
394
|
)
|
|
395
395
|
|
|
396
396
|
self.context = create_context(self.url, self.client, response)
|
|
@@ -422,7 +422,15 @@ Error message:
|
|
|
422
422
|
previous_results: dict[str, CheckResponse] = {"first_check": first_check}
|
|
423
423
|
|
|
424
424
|
for check in checks:
|
|
425
|
-
|
|
425
|
+
try:
|
|
426
|
+
result = check.run(self.context, previous_results)
|
|
427
|
+
except (httpx.RequestError, httpx.HTTPStatusError) as exc:
|
|
428
|
+
result = CheckResponse(
|
|
429
|
+
name=check.name,
|
|
430
|
+
result=CheckResult.FAILURE,
|
|
431
|
+
severity_score=check.severity,
|
|
432
|
+
message=f"An error occurred while running this check: \n\n> `{exc}`",
|
|
433
|
+
)
|
|
426
434
|
site_check_results.check_results.append(result)
|
|
427
435
|
previous_results[check.check_id] = result
|
|
428
436
|
|
|
@@ -4,6 +4,8 @@ from typing import Annotated
|
|
|
4
4
|
|
|
5
5
|
import rich
|
|
6
6
|
import typer
|
|
7
|
+
from rich.console import Console
|
|
8
|
+
from rich.progress import Progress, SpinnerColumn, TextColumn
|
|
7
9
|
|
|
8
10
|
from djcheckup.check_defs import all_checks
|
|
9
11
|
from djcheckup.checks import SiteChecker
|
|
@@ -22,8 +24,16 @@ def run_checks(
|
|
|
22
24
|
] = False,
|
|
23
25
|
) -> None:
|
|
24
26
|
"""Run the DJ Checkup tool against a specific URL."""
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
with Progress(
|
|
28
|
+
SpinnerColumn(),
|
|
29
|
+
TextColumn(f"[bold green]Checking {url}..."),
|
|
30
|
+
console=Console(),
|
|
31
|
+
transient=True,
|
|
32
|
+
) as progress:
|
|
33
|
+
task = progress.add_task("checking")
|
|
34
|
+
checker = SiteChecker(url=url)
|
|
35
|
+
results = checker.run_checks(all_checks)
|
|
36
|
+
progress.update(task, completed=True)
|
|
27
37
|
|
|
28
38
|
if output_json:
|
|
29
39
|
rich.print_json(sitecheck_as_json(results))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|