Skip to content

Commit c7e1884

Browse files
Merge branch 'jazzband:develop' into develop
2 parents 967d664 + 01c1de4 commit c7e1884

File tree

6 files changed

+49
-32
lines changed

6 files changed

+49
-32
lines changed

.github/workflows/gh-pages.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish Docs to GitHub Pages
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
branches:
9+
- develop
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.x
23+
24+
- name: Install dependencies
25+
run: pip install mkdocs-material
26+
27+
- name: Build docs
28+
run: mkdocs build
29+
30+
- name: Deploy to GitHub Pages
31+
uses: peaceiris/actions-gh-pages@v3
32+
with:
33+
personal_token: ${{ secrets.GITHUB_TOKEN }}
34+
publish_dir: ./site

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ django-rest-knox
44
[![Jazzband](https://jazzband.co/static/img/badge.svg)](https://jazzband.co/)
55
[![image](https://github.com/jazzband/django-rest-knox/workflows/Test/badge.svg?branch=develop)](https://github.com/jazzband/django-rest-knox/actions)
66

7-
Authentication Module for django rest auth
7+
Authentication module for Django rest auth.
88

9-
Knox provides easy to use authentication for [Django REST
9+
Knox provides easy-to-use authentication for [Django REST
1010
Framework](https://www.django-rest-framework.org/) The aim is to allow
11-
for common patterns in applications that are REST based, with little
11+
for common patterns in applications that are REST-based, with little
1212
extra effort; and to ensure that connections remain secure.
1313

14-
Knox authentication is token based, similar to the `TokenAuthentication`
15-
built in to DRF. However, it overcomes some problems present in the
14+
Knox authentication is token-based, similar to the `TokenAuthentication`
15+
built into DRF. However, it overcomes some problems present in the
1616
default implementation:
1717

1818
- DRF tokens are limited to one per user. This does not facilitate
@@ -24,13 +24,14 @@ default implementation:
2424
client to have its own token which is deleted on the server side
2525
when the client logs out.
2626

27-
Knox also provides an option for a logged in client to remove *all*
27+
Knox also provides an option for a logged-in client to remove *all*
2828
tokens that the server has - forcing all clients to re-authenticate.
2929

3030
- DRF tokens are stored unencrypted in the database. This would allow
31-
an attacker unrestricted access to an account with a token if the
31+
an attacker unrestricted access to an account with a token if the
3232
database were compromised.
3333

34+
3435
Knox tokens are only stored in a secure hash form (like a password). Even if the
3536
database were somehow stolen, an attacker would not be able to log
3637
in with the stolen credentials.
@@ -44,8 +45,7 @@ More information can be found in the
4445

4546
# Run the tests locally
4647

47-
If you need to debug a test locally and if you have [docker](https://www.docker.com/) installed:
48-
48+
If you need to debug a test locally and if you have [docker](https://www.docker.com/) installed,
4949
simply run the ``./docker-run-tests.sh`` script and it will run the test suite in every Python /
5050
Django versions.
5151

@@ -56,7 +56,7 @@ Python / Django versions a bit more tricky.
5656

5757
Our documentation is generated by [Mkdocs](https://www.mkdocs.org).
5858

59-
You can refer to their documentation on how to install it locally.
59+
You can refer to their [documentation](https://www.mkdocs.org/user-guide/installation/) on how to install it locally.
6060

6161
Another option is to use `mkdocs.sh` in this repository.
6262
It will run mkdocs in a [docker](https://www.docker.com/) container.

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Django-Rest-Knox
2-
Knox provides easy to use authentication for [Django REST Framework](https://www.django-rest-framework.org/)
2+
Knox provides easy-to-use authentication for [Django REST Framework](https://www.django-rest-framework.org/)
33
The aim is to allow for common patterns in applications that are REST based,
44
with little extra effort; and to ensure that connections remain secure.
55

66
Knox authentication is token based, similar to the `TokenAuthentication` built
7-
in to DRF. However, it overcomes some problems present in the default implementation:
7+
into DRF. However, it overcomes some problems present in the default implementation:
88

99
- DRF tokens are limited to one per user. This does not facilitate securely
1010
signing in from multiple devices, as the token is shared. It also requires

knox/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from datetime import timedelta
22

33
from django.conf import settings
4-
from django.test.signals import setting_changed
4+
from django.core.signals import setting_changed
55
from rest_framework.settings import APISettings, api_settings
66

77
USER_SETTINGS = getattr(settings, 'REST_KNOX', None)

mkdocs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ docker run --rm -it \
99
-w $MOUNT_FOLDER \
1010
-p $MKDOCS_DEV_PORT:$MKDOCS_DEV_PORT \
1111
-e MKDOCS_DEV_ADDR="$MKDOCS_DEV_ADDR:$MKDOCS_DEV_PORT" \
12-
squidfunk/mkdocs-material:3.2.0 $*
12+
squidfunk/mkdocs-material:latest $*

tox.ini

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
11
[tox]
22
envlist =
3-
isort,
4-
flake8,
53
py{36,37,38,39,310}-django32,
64
py{38,39,310,311,312}-django42,
75
py{310,311,312}-django50,
86

9-
[testenv:flake8]
10-
deps = flake8
11-
changedir = {toxinidir}
12-
commands = flake8 knox
13-
14-
[testenv:isort]
15-
deps = isort
16-
changedir = {toxinidir}
17-
commands = isort --check-only --diff \
18-
knox \
19-
knox_project/views.py \
20-
setup.py \
21-
tests
22-
237
[testenv]
248
commands =
259
python manage.py migrate
@@ -33,7 +17,6 @@ deps =
3317
django42: Django>=4.2,<4.3
3418
django50: Django>=5.0,<5.1
3519
markdown>=3.0
36-
isort>=5.0
3720
djangorestframework
3821
freezegun
3922
mkdocs
@@ -50,5 +33,5 @@ python =
5033
3.8: py38
5134
3.9: py39
5235
3.10: py310
53-
3.11: py311, isort, flake8
36+
3.11: py311
5437
3.12: py312

0 commit comments

Comments
 (0)