djcheckup 0.2.1__tar.gz → 0.2.2__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.2.1 → djcheckup-0.2.2}/PKG-INFO +1 -1
- {djcheckup-0.2.1 → djcheckup-0.2.2}/pyproject.toml +11 -1
- {djcheckup-0.2.1 → djcheckup-0.2.2}/src/djcheckup/checks.py +22 -8
- {djcheckup-0.2.1 → djcheckup-0.2.2}/LICENSE +0 -0
- {djcheckup-0.2.1 → djcheckup-0.2.2}/README.md +0 -0
- {djcheckup-0.2.1 → djcheckup-0.2.2}/src/djcheckup/__init__.py +0 -0
- {djcheckup-0.2.1 → djcheckup-0.2.2}/src/djcheckup/check_defs.py +0 -0
- {djcheckup-0.2.1 → djcheckup-0.2.2}/src/djcheckup/cli.py +0 -0
- {djcheckup-0.2.1 → djcheckup-0.2.2}/src/djcheckup/outputs.py +0 -0
- {djcheckup-0.2.1 → djcheckup-0.2.2}/src/djcheckup/run.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "djcheckup"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.2"
|
|
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" }]
|
|
@@ -26,5 +26,15 @@ target-version = "py313"
|
|
|
26
26
|
[tool.ruff.lint]
|
|
27
27
|
select = ["ALL"]
|
|
28
28
|
|
|
29
|
+
[tool.ruff.lint.extend-per-file-ignores]
|
|
30
|
+
"tests/**" = ["S101", "ANN201", "ANN001", "ARG001"]
|
|
31
|
+
|
|
29
32
|
[tool.ruff.lint.pydocstyle]
|
|
30
33
|
convention = "google" # Accepts: "google", "numpy", or "pep257".
|
|
34
|
+
|
|
35
|
+
[dependency-groups]
|
|
36
|
+
dev = ["pytest>=8.4.2"]
|
|
37
|
+
|
|
38
|
+
[tool.pytest.ini_options]
|
|
39
|
+
pythonpath = "."
|
|
40
|
+
python_files = "test_*.py"
|
|
@@ -286,6 +286,27 @@ class SchemeCheck(_BaseCheck):
|
|
|
286
286
|
return response.url.scheme == self.end_scheme
|
|
287
287
|
|
|
288
288
|
|
|
289
|
+
def create_context(url: httpx.URL, client: httpx.Client, response: httpx.Response) -> SiteCheckContext:
|
|
290
|
+
"""Create a SiteCheckContext context object.
|
|
291
|
+
|
|
292
|
+
Args:
|
|
293
|
+
url: The URL to check.
|
|
294
|
+
client: The HTTPX client to use for requests.
|
|
295
|
+
response: The HTTPX response object from the initial request.
|
|
296
|
+
|
|
297
|
+
Returns:
|
|
298
|
+
A SiteCheckContext object containing the provided parameters.
|
|
299
|
+
"""
|
|
300
|
+
return SiteCheckContext(
|
|
301
|
+
url=url,
|
|
302
|
+
client=client,
|
|
303
|
+
headers=response.headers,
|
|
304
|
+
cookies=response.cookies.jar,
|
|
305
|
+
content=response.text,
|
|
306
|
+
response_url=response.url,
|
|
307
|
+
)
|
|
308
|
+
|
|
309
|
+
|
|
289
310
|
class SiteChecker:
|
|
290
311
|
"""Run all the checks for a given site."""
|
|
291
312
|
|
|
@@ -359,14 +380,7 @@ class SiteChecker:
|
|
|
359
380
|
message=error_message,
|
|
360
381
|
)
|
|
361
382
|
|
|
362
|
-
self.context =
|
|
363
|
-
url=self.url,
|
|
364
|
-
client=self.client,
|
|
365
|
-
headers=response.headers,
|
|
366
|
-
cookies=response.cookies.jar,
|
|
367
|
-
content=response.text,
|
|
368
|
-
response_url=response.url,
|
|
369
|
-
)
|
|
383
|
+
self.context = create_context(self.url, self.client, response)
|
|
370
384
|
|
|
371
385
|
return CheckResponse(
|
|
372
386
|
name=check_name,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|