Skip to content

Commit f78ba9b

Browse files
authored
Merge branch 'master' into honor-database-assigment-from-router
2 parents ceaebc9 + 3b429c9 commit f78ba9b

File tree

12 files changed

+95
-51
lines changed

12 files changed

+95
-51
lines changed

.github/workflows/lint.yaml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.6.0
3+
rev: v0.6.2
44
hooks:
55
- id: ruff
66
args: [ --fix ]

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2525
* #1446 use generic models pk instead of id.
2626
* Transactions wrapping writes of the Tokens now rely on Django's database routers to determine the correct
2727
database to use instead of assuming that 'default' is the correct one.
28+
* Bump oauthlib version to 3.2.0 and above
2829

2930
### Deprecated
3031
### Removed
@@ -33,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3334

3435
### Fixed
3536
* #1443 Query strings with invalid hex values now raise a SuspiciousOperation exception (in DRF extension) instead of raising a 500 ValueError: Invalid hex encoding in query string.
37+
* #1468 `ui_locales` request parameter triggers `AttributeError` under certain circumstances
3638
### Security
3739

3840
## [2.4.0] - 2024-05-13

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Requirements
4545

4646
* Python 3.8+
4747
* Django 4.2, 5.0 or 5.1
48-
* oauthlib 3.1+
48+
* oauthlib 3.2+
4949

5050
Installation
5151
------------

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Requirements
2323

2424
* Python 3.8+
2525
* Django 4.2, 5.0 or 5.1
26-
* oauthlib 3.1+
26+
* oauthlib 3.2+
2727

2828
Index
2929
=====

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Django
2-
oauthlib>=3.1.0
2+
oauthlib>=3.2.0
33
m2r>=0.2.1
44
mistune<2
55
sphinx==7.2.6

oauth2_provider/views/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ def get(self, request, *args, **kwargs):
186186
# a successful response depending on "approval_prompt" url parameter
187187
require_approval = request.GET.get("approval_prompt", oauth2_settings.REQUEST_APPROVAL_PROMPT)
188188

189+
if "ui_locales" in credentials and isinstance(credentials["ui_locales"], list):
190+
# Make sure ui_locales a space separated string for oauthlib to handle it correctly.
191+
credentials["ui_locales"] = " ".join(credentials["ui_locales"])
192+
189193
try:
190194
# If skip_authorization field is True, skip the authorization screen even
191195
# if this is the first use of the application and there was no previous authorization.

pyproject.toml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ classifiers = [
3636
dependencies = [
3737
"django >= 4.2",
3838
"requests >= 2.13.0",
39-
"oauthlib >= 3.1.0",
39+
"oauthlib >= 3.2.0",
4040
"jwcrypto >= 0.8.0",
4141
]
4242

@@ -54,6 +54,26 @@ check-hidden = true
5454
ignore-regex = '.*pragma: codespell-ignore.*'
5555
ignore-words-list = 'assertIn'
5656

57+
[tool.coverage.run]
58+
source = ["oauth2_provider"]
59+
omit = ["*/migrations/*"]
60+
61+
[tool.coverage.report]
62+
show_missing = true
63+
64+
[tool.pytest.ini_options]
65+
django_find_project = false
66+
addopts = [
67+
"--cov=oauth2_provider",
68+
"--cov-report=",
69+
"--cov-append",
70+
"-s"
71+
]
72+
markers = [
73+
"oauth2_settings: Custom OAuth2 settings to use - use with oauth2_settings fixture",
74+
"nologinrequiredmiddleware",
75+
]
76+
5777
[tool.ruff]
5878
line-length = 110
5979
exclude = [".tox", "build/", "dist/", "docs/", "oauth2_provider/migrations/", "tests/migrations/", "manage.py"]

tests/app/rp/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/app/rp/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@sveltejs/kit": "^2.5.10",
1818
"prettier": "^3.3.2",
1919
"prettier-plugin-svelte": "^3.2.4",
20-
"svelte": "^4.0.0",
20+
"svelte": "^4.2.19",
2121
"svelte-check": "^3.8.0",
2222
"tslib": "^2.4.1",
2323
"typescript": "^5.0.0",

0 commit comments

Comments
 (0)