Skip to content

Commit b1a2bb3

Browse files
yarikopticn2ygk
andauthored
Add codespell support: config + workflow to catch new typos, let it fix some (#1392)
* Add rudimentary codespell config * Add pre-commit definition for codespell Includes also squashed - [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci - Unfortunately due to bug in codespell we need to duplicate some skipped paths for pre-commit config * Add pragma handling to ignore for codespell and ignore a line with a key * [DATALAD RUNCMD] run codespell throughout fixing typos automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ * Added author --------- Co-authored-by: Alan Crosswell <[email protected]>
1 parent 30efd79 commit b1a2bb3

File tree

14 files changed

+35
-19
lines changed

14 files changed

+35
-19
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ repos:
2929
rev: v0.9.1
3030
hooks:
3131
- id: sphinx-lint
32+
# Configuration for codespell is in pyproject.toml
33+
- repo: https://github.com/codespell-project/codespell
34+
rev: v2.2.6
35+
hooks:
36+
- id: codespell
37+
exclude: (package-lock.json|/locale/)
38+
additional_dependencies:
39+
- tomli

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,5 @@ Will Beaufoy
110110
pySilver
111111
Łukasz Skarżyński
112112
Wouter Klein Heerenbrink
113+
Yaroslav Halchenko
113114
Yuri Savin

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3131
* #1311 Add option to disable client_secret hashing to allow verifying JWTs' signatures.
3232
* #1337 Gracefully handle expired or deleted refresh tokens, in `validate_user`.
3333
* #1350 Support Python 3.12 and Django 5.0
34-
* #1249 Add code_challenge_methods_supported property to auto discovery informations, per [RFC 8414 section 2](https://www.rfc-editor.org/rfc/rfc8414.html#page-7)
34+
* #1249 Add code_challenge_methods_supported property to auto discovery information, per [RFC 8414 section 2](https://www.rfc-editor.org/rfc/rfc8414.html#page-7)
3535

3636

3737
### Fixed
@@ -144,7 +144,7 @@ This is a major release with **BREAKING** changes. Please make sure to review th
144144

145145
### Added
146146
* #969 Add batching of expired token deletions in `cleartokens` management command and `models.clear_expired()`
147-
to improve performance for removal of large numers of expired tokens. Configure with
147+
to improve performance for removal of large numbers of expired tokens. Configure with
148148
[`CLEAR_EXPIRED_TOKENS_BATCH_SIZE`](https://django-oauth-toolkit.readthedocs.io/en/latest/settings.html#clear-expired-tokens-batch-size) and
149149
[`CLEAR_EXPIRED_TOKENS_BATCH_INTERVAL`](https://django-oauth-toolkit.readthedocs.io/en/latest/settings.html#clear-expired-tokens-batch-interval).
150150
* #1070 Add a Celery task for clearing expired tokens, e.g. to be scheduled as a [periodic task](https://docs.celeryproject.org/en/stable/userguide/periodic-tasks.html).
@@ -229,7 +229,7 @@ This is a major release with **BREAKING** changes. Please make sure to review th
229229

230230
### Added
231231
* #917 Documentation improvement for Access Token expiration.
232-
* #916 (for DOT contributors) Added `tox -e livedocs` which launches a local web server on `locahost:8000`
232+
* #916 (for DOT contributors) Added `tox -e livedocs` which launches a local web server on `localhost:8000`
233233
to display Sphinx documentation with live updates as you edit.
234234
* #891 (for DOT contributors) Added [details](https://django-oauth-toolkit.readthedocs.io/en/latest/contributing.html)
235235
on how best to contribute to this project.
@@ -434,7 +434,7 @@ This is a major release with **BREAKING** changes. Please make sure to review th
434434
* #185: fixed vulnerabilities on Basic authentication
435435
* #173: ProtectResourceMixin now allows OPTIONS requests
436436
* Fixed `client_id` and `client_secret` characters set
437-
* #169: hide sensitive informations in error emails
437+
* #169: hide sensitive information in error emails
438438
* #161: extend search to all token types when revoking a token
439439
* #160: return empty response on successful token revocation
440440
* #157: skip authorization form with ``skip_authorization_completely`` class field

docs/getting_started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Configure ``users.User`` to be the model used for the ``auth`` application by ad
111111
112112
AUTH_USER_MODEL = 'users.User'
113113
114-
Create inital migration for ``users`` application ``User`` model::
114+
Create initial migration for ``users`` application ``User`` model::
115115

116116
python manage.py makemigrations
117117

docs/oidc.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ that must be provided. ``django-oauth-toolkit`` supports two different
3434
algorithms for signing JWT tokens, ``RS256``, which uses asymmetric RSA keys (a
3535
public key and a private key), and ``HS256``, which uses a symmetric key.
3636

37-
It is preferrable to use ``RS256``, because this produces a token that can be
37+
It is preferable to use ``RS256``, because this produces a token that can be
3838
verified by anyone using the public key (which is made available and
3939
discoverable by OIDC service auto-discovery, included with
4040
``django-oauth-toolkit``). ``HS256`` on the other hand uses the
@@ -372,7 +372,7 @@ for a POST request.
372372

373373
Again, to modify the content delivered, we need to add a function to our
374374
custom validator. The default implementation adds the claims from the ID
375-
token, so you will probably want to re-use that::
375+
token, so you will probably want to reuse that::
376376

377377
class CustomOAuth2Validator(OAuth2Validator):
378378

docs/tutorial/tutorial_01.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Let's register your application.
8282

8383
You need to be logged in before registration. So, go to http://localhost:8000/admin and log in. After that
8484
point your browser to http://localhost:8000/o/applications/ and add an Application instance.
85-
`Client id` and `Client Secret` are automatically generated; you have to provide the rest of the informations:
85+
`Client id` and `Client Secret` are automatically generated; you have to provide the rest of the information:
8686

8787
* `User`: the owner of the Application (e.g. a developer, or the currently logged in user.)
8888

docs/tutorial/tutorial_04.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ obtained in :doc:`part 1 <tutorial_01>`. If your application type is `Confidenti
3636
token=XXXX&client_id=XXXX&client_secret=XXXX
3737

3838

39-
The server will respond wih a ``200`` status code on successful revocation. You can use ``curl`` to make a revoke request on your server. If you have access to a local installation of your authorization server, you can test revoking a token with a request like that shown below, for a `Confidential` client.
39+
The server will respond with a ``200`` status code on successful revocation. You can use ``curl`` to make a revoke request on your server. If you have access to a local installation of your authorization server, you can test revoking a token with a request like that shown below, for a `Confidential` client.
4040

4141
::
4242

oauth2_provider/contrib/rest_framework/permissions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class IsAuthenticatedOrTokenHasScope(BasePermission):
107107
This only returns True if the user is authenticated, but not using a token
108108
or using a token, and the token has the correct scope.
109109
110-
This is usefull when combined with the DjangoModelPermissions to allow people browse
110+
This is useful when combined with the DjangoModelPermissions to allow people browse
111111
the browsable api's if they log in using the a non token bassed middleware,
112112
and let them access the api's using a rest client with a token
113113
"""

oauth2_provider/oauth2_validators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ def _extract_basic_auth(self, request):
104104
if not auth:
105105
return None
106106

107-
splitted = auth.split(" ", 1)
108-
if len(splitted) != 2:
107+
split = auth.split(" ", 1)
108+
if len(split) != 2:
109109
return None
110-
auth_type, auth_string = splitted
110+
auth_type, auth_string = split
111111

112112
if auth_type != "Basic":
113113
return None
@@ -927,7 +927,7 @@ def _get_client_by_audience(self, audience):
927927
return Application.objects.filter(client_id__in=audience).first()
928928

929929
def validate_user_match(self, id_token_hint, scopes, claims, request):
930-
# TODO: Fix to validate when necessary acording
930+
# TODO: Fix to validate when necessary according
931931
# https://github.com/idan/oauthlib/blob/master/oauthlib/oauth2/rfc6749/request_validator.py#L556
932932
# http://openid.net/specs/openid-connect-core-1_0.html#AuthRequest id_token_hint section
933933
return True

oauth2_provider/views/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ class AuthorizationView(BaseAuthorizationView, FormView):
7777
7878
* then receive a ``POST`` request possibly after user authorized the access
7979
80-
Some informations contained in the ``GET`` request and needed to create a Grant token during
80+
Some information contained in the ``GET`` request and needed to create a Grant token during
8181
the ``POST`` request would be lost between the two steps above, so they are temporarily stored in
8282
hidden fields on the form.
83-
A possible alternative could be keeping such informations in the session.
83+
A possible alternative could be keeping such information in the session.
8484
8585
The endpoint is used in the following flows:
8686
* Authorization code

0 commit comments

Comments
 (0)