dbca-utils 2.1.2__tar.gz → 2.1.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.
@@ -1,11 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dbca-utils
3
- Version: 2.1.2
3
+ Version: 2.1.4
4
4
  Summary: Utilities for DBCA Django apps
5
5
  Author-Email: Rocky Chen <rocky.chen@dbca.wa.gov.au>, Ashley Felton <ashley.felton@dbca.wa.gov.au>
6
6
  License-Expression: Apache-2.0
7
7
  Classifier: Framework :: Django
8
- Classifier: Framework :: Django :: 4.0
9
8
  Classifier: Framework :: Django :: 4.2
10
9
  Classifier: Framework :: Django :: 5.0
11
10
  Classifier: Framework :: Django :: 5.2
@@ -25,26 +24,24 @@ Project-URL: Repository, https://github.com/dbca-wa/dbca-utils.git
25
24
  Project-URL: Changelog, https://github.com/dbca-wa/dbca-utils/blob/master/CHANGELOG.md
26
25
  Project-URL: GitHub, https://github.com/dbca-wa/dbca-utils
27
26
  Requires-Python: <4.0,>=3.10
28
- Requires-Dist: django<6,>=4
29
- Requires-Dist: markupsafe==3.0.2
27
+ Requires-Dist: django<6,>=4.2
28
+ Requires-Dist: markupsafe==3.0.3
30
29
  Description-Content-Type: text/markdown
31
30
 
32
31
  # Overview
33
32
 
34
33
  DBCA Django utility classes and functions.
35
34
 
36
- ## Development
35
+ ## Requirements
37
36
 
38
- The recommended way to set up this project for development is using
39
- [uv](https://docs.astral.sh/uv/)
40
- to install and manage a Python virtual environment.
41
- With uv installed, install the required Python version (see `pyproject.toml`). Example:
37
+ - Python 3.10 or later
38
+ - Django 4.2 or later
42
39
 
43
- uv python install 3.12
40
+ ## Development
44
41
 
45
- Change into the project directory and run:
42
+ Dependencies for this project are managed using [uv](https://docs.astral.sh/uv/).
43
+ With uv installed, change into the project directory and run:
46
44
 
47
- uv python pin 3.12
48
45
  uv sync
49
46
 
50
47
  Activate the virtualenv like so:
@@ -71,7 +68,7 @@ using the same tool if you require:
71
68
 
72
69
  ## Installation
73
70
 
74
- 1. Install via pip/etc.: `pip install dbca-utils`
71
+ 1. Install via uv/pip/etc.: `pip install dbca-utils`
75
72
 
76
73
  ## SSO Login Middleware
77
74
 
@@ -2,18 +2,16 @@
2
2
 
3
3
  DBCA Django utility classes and functions.
4
4
 
5
- ## Development
5
+ ## Requirements
6
6
 
7
- The recommended way to set up this project for development is using
8
- [uv](https://docs.astral.sh/uv/)
9
- to install and manage a Python virtual environment.
10
- With uv installed, install the required Python version (see `pyproject.toml`). Example:
7
+ - Python 3.10 or later
8
+ - Django 4.2 or later
11
9
 
12
- uv python install 3.12
10
+ ## Development
13
11
 
14
- Change into the project directory and run:
12
+ Dependencies for this project are managed using [uv](https://docs.astral.sh/uv/).
13
+ With uv installed, change into the project directory and run:
15
14
 
16
- uv python pin 3.12
17
15
  uv sync
18
16
 
19
17
  Activate the virtualenv like so:
@@ -40,7 +38,7 @@ using the same tool if you require:
40
38
 
41
39
  ## Installation
42
40
 
43
- 1. Install via pip/etc.: `pip install dbca-utils`
41
+ 1. Install via uv/pip/etc.: `pip install dbca-utils`
44
42
 
45
43
  ## SSO Login Middleware
46
44
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dbca-utils"
3
- version = "2.1.2"
3
+ version = "2.1.4"
4
4
  description = "Utilities for DBCA Django apps"
5
5
  authors = [
6
6
  { name = "Rocky Chen", email = "rocky.chen@dbca.wa.gov.au" },
@@ -10,7 +10,6 @@ readme = "README.md"
10
10
  license = "Apache-2.0"
11
11
  classifiers = [
12
12
  "Framework :: Django",
13
- "Framework :: Django :: 4.0",
14
13
  "Framework :: Django :: 4.2",
15
14
  "Framework :: Django :: 5.0",
16
15
  "Framework :: Django :: 5.2",
@@ -28,8 +27,8 @@ classifiers = [
28
27
  ]
29
28
  requires-python = ">=3.10,<4.0"
30
29
  dependencies = [
31
- "django>=4,<6",
32
- "markupsafe==3.0.2",
30
+ "django>=4.2,<6",
31
+ "markupsafe==3.0.3",
33
32
  ]
34
33
 
35
34
  [project.urls]
@@ -40,10 +39,10 @@ GitHub = "https://github.com/dbca-wa/dbca-utils"
40
39
 
41
40
  [dependency-groups]
42
41
  dev = [
43
- "pytest-django>=4.11.0",
44
- "pytest-sugar>=1.0.0",
45
- "tox>=4.25.0",
46
- "tox-uv>=1.25.0",
42
+ "pytest-django>=4.11.1",
43
+ "pytest-sugar>=1.1.1",
44
+ "tox>=4.31.0",
45
+ "tox-uv>=1.29.0",
47
46
  ]
48
47
 
49
48
  [build-system]
@@ -5,6 +5,7 @@ from django.contrib.auth.middleware import AuthenticationMiddleware, get_user
5
5
  from django.utils import timezone
6
6
  from django.utils.deprecation import MiddlewareMixin
7
7
  from django.utils.functional import SimpleLazyObject
8
+ from django.utils.html import strip_tags
8
9
  from markupsafe import escape
9
10
 
10
11
  from dbca_utils.utils import env
@@ -135,8 +136,10 @@ class SSOLoginMiddleware(MiddlewareMixin):
135
136
  # Sanitise first_name and last_name values, because end-users have control over these
136
137
  # values and could conceivably inject malicious values into them (e.g. a XSS attack).
137
138
  if "first_name" in attributemap:
139
+ attributemap["first_name"] = strip_tags(attributemap["first_name"])
138
140
  attributemap["first_name"] = str(escape(attributemap["first_name"]))
139
141
  if "last_name" in attributemap:
142
+ attributemap["last_name"] = strip_tags(attributemap["first_name"])
140
143
  attributemap["last_name"] = str(escape(attributemap["last_name"]))
141
144
 
142
145
  # Optional setting: projects may define accepted user email domains either as
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes