qube-money-knox


Nameqube-money-knox JSON
Version 4.2.7 PyPI version JSON
download
home_pagehttps://github.com/qubemoney/django-rest-knox
SummaryCustom Fork of django-rest-knox
upload_time2023-12-22 16:42:15
maintainer
docs_urlNone
authorQube Money
requires_python>=3.6
licenseMIT
keywords django rest authentication login
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            django-rest-knox
================

[![image](https://github.com/James1345/django-rest-knox/workflows/Test/badge.svg?branch=develop)](https://github.com/James1345/django-rest-knox/actions)

Authentication Module for django rest auth

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

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

-   DRF tokens are limited to one per user. This does not facilitate
    securely signing in from multiple devices, as the token is shared.
    It also requires *all* devices to be logged out if a server-side
    logout is required (i.e. the token is deleted).

    Knox provides one token per call to the login view - allowing each
    client to have its own token which is deleted on the server side
    when the client logs out.

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

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

    Knox tokens are only stored in a secure hash form (like a password). Even if the
    database were somehow stolen, an attacker would not be able to log
    in with the stolen credentials.

-   DRF tokens track their creation time, but have no inbuilt mechanism
    for tokens expiring. Knox tokens can have an expiry configured in
    the app settings (default is 10 hours.)

More information can be found in the
[Documentation](https://james1345.github.io/django-rest-knox/)

# Run the tests locally

If you need to debug a test locally and if you have [docker](https://www.docker.com/) installed:

simply run the ``./docker-run-tests.sh`` script and it will run the test suite in every Python /
Django versions.

You could also simply run regular ``tox`` in the root folder as well, but that would make testing the matrix of
Python / Django versions a bit more tricky.

# Work on the documentation

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

You can refer to their documentation on how to install it locally.

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

Running the script without any params triggers the `serve` command.
The server is exposed on localhost on port 8000.

To configure the port the `serve` command will be exposing the server to, you
can use the following env var:

```
MKDOCS_DEV_PORT="8080"
```

You can also pass any `mkdocs` command like this:

```
./mkdocs build
./mkdocs --help
```

Check the [Mkdocs documentation](https://www.mkdocs.org/) for more.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/qubemoney/django-rest-knox",
    "name": "qube-money-knox",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "django rest authentication login",
    "author": "Qube Money",
    "author_email": "admin@qubemoney.com",
    "download_url": "https://files.pythonhosted.org/packages/96/20/1b41d51e95f750472b16fd1d5eca5241bcf1a52179e7ecfab8f8146ed26b/qube-money-knox-4.2.7.tar.gz",
    "platform": null,
    "description": "django-rest-knox\n================\n\n[![image](https://github.com/James1345/django-rest-knox/workflows/Test/badge.svg?branch=develop)](https://github.com/James1345/django-rest-knox/actions)\n\nAuthentication Module for django rest auth\n\nKnox provides easy to use authentication for [Django REST\nFramework](https://www.django-rest-framework.org/) The aim is to allow\nfor common patterns in applications that are REST based, with little\nextra effort; and to ensure that connections remain secure.\n\nKnox authentication is token based, similar to the `TokenAuthentication`\nbuilt in to DRF. However, it overcomes some problems present in the\ndefault implementation:\n\n-   DRF tokens are limited to one per user. This does not facilitate\n    securely signing in from multiple devices, as the token is shared.\n    It also requires *all* devices to be logged out if a server-side\n    logout is required (i.e. the token is deleted).\n\n    Knox provides one token per call to the login view - allowing each\n    client to have its own token which is deleted on the server side\n    when the client logs out.\n\n    Knox also provides an option for a logged in client to remove *all*\n    tokens that the server has - forcing all clients to re-authenticate.\n\n-   DRF tokens are stored unencrypted in the database. This would allow\n    an attacker unrestricted access to an account with a token if the\n    database were compromised.\n\n    Knox tokens are only stored in a secure hash form (like a password). Even if the\n    database were somehow stolen, an attacker would not be able to log\n    in with the stolen credentials.\n\n-   DRF tokens track their creation time, but have no inbuilt mechanism\n    for tokens expiring. Knox tokens can have an expiry configured in\n    the app settings (default is 10 hours.)\n\nMore information can be found in the\n[Documentation](https://james1345.github.io/django-rest-knox/)\n\n# Run the tests locally\n\nIf you need to debug a test locally and if you have [docker](https://www.docker.com/) installed:\n\nsimply run the ``./docker-run-tests.sh`` script and it will run the test suite in every Python /\nDjango versions.\n\nYou could also simply run regular ``tox`` in the root folder as well, but that would make testing the matrix of\nPython / Django versions a bit more tricky.\n\n# Work on the documentation\n\nOur documentation is generated by [Mkdocs](https://www.mkdocs.org).\n\nYou can refer to their documentation on how to install it locally.\n\nAnother option is to use `mkdocs.sh` in this repository.\nIt will run mkdocs in a [docker](https://www.docker.com/) container.\n\nRunning the script without any params triggers the `serve` command.\nThe server is exposed on localhost on port 8000.\n\nTo configure the port the `serve` command will be exposing the server to, you\ncan use the following env var:\n\n```\nMKDOCS_DEV_PORT=\"8080\"\n```\n\nYou can also pass any `mkdocs` command like this:\n\n```\n./mkdocs build\n./mkdocs --help\n```\n\nCheck the [Mkdocs documentation](https://www.mkdocs.org/) for more.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Custom Fork of django-rest-knox",
    "version": "4.2.7",
    "project_urls": {
        "Homepage": "https://github.com/qubemoney/django-rest-knox"
    },
    "split_keywords": [
        "django",
        "rest",
        "authentication",
        "login"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "96201b41d51e95f750472b16fd1d5eca5241bcf1a52179e7ecfab8f8146ed26b",
                "md5": "fb7d4845586b2b1037f0cc86e1265dd6",
                "sha256": "0da9632b8bf82c28369d46c757897be8328291e3d82d844d728c670520ca483b"
            },
            "downloads": -1,
            "filename": "qube-money-knox-4.2.7.tar.gz",
            "has_sig": false,
            "md5_digest": "fb7d4845586b2b1037f0cc86e1265dd6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 16962,
            "upload_time": "2023-12-22T16:42:15",
            "upload_time_iso_8601": "2023-12-22T16:42:15.484103Z",
            "url": "https://files.pythonhosted.org/packages/96/20/1b41d51e95f750472b16fd1d5eca5241bcf1a52179e7ecfab8f8146ed26b/qube-money-knox-4.2.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-22 16:42:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "qubemoney",
    "github_project": "django-rest-knox",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "qube-money-knox"
}
        
Elapsed time: 0.15960s