{"id":13415522,"url":"https://github.com/jazzband/django-rest-knox","last_synced_at":"2025-05-13T23:04:02.854Z","repository":{"id":38382993,"uuid":"42185087","full_name":"jazzband/django-rest-knox","owner":"jazzband","description":"Authentication Module for django rest auth","archived":false,"fork":false,"pushed_at":"2025-04-25T08:55:36.000Z","size":3661,"stargazers_count":1207,"open_issues_count":35,"forks_count":216,"subscribers_count":20,"default_branch":"develop","last_synced_at":"2025-05-08T00:02:28.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jazzband.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":["https://jazzband.co/donate"]}},"created_at":"2015-09-09T14:52:23.000Z","updated_at":"2025-05-02T15:10:42.000Z","dependencies_parsed_at":"2023-12-18T19:06:26.383Z","dependency_job_id":"4c84888c-7a26-4a23-824d-ceac1ecf89ed","html_url":"https://github.com/jazzband/django-rest-knox","commit_stats":null,"previous_names":["james1345/django-rest-knox"],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzband%2Fdjango-rest-knox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzband%2Fdjango-rest-knox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzband%2Fdjango-rest-knox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jazzband%2Fdjango-rest-knox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jazzband","download_url":"https://codeload.github.com/jazzband/django-rest-knox/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514647,"owners_count":21920340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T21:00:49.997Z","updated_at":"2025-05-13T23:04:02.838Z","avatar_url":"https://github.com/jazzband.png","language":"Python","funding_links":["https://jazzband.co/donate"],"categories":["Third-Party Packages","Python","Authorization \u0026 Authentication"],"sub_categories":["APIs"],"readme":"django-rest-knox\n================\n\n[![Jazzband](https://jazzband.co/static/img/badge.svg)](https://jazzband.co/)\n[![image](https://github.com/jazzband/django-rest-knox/workflows/Test/badge.svg?branch=develop)](https://github.com/jazzband/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 into 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\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://jazzband.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,\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](https://www.mkdocs.org/user-guide/installation/) 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazzband%2Fdjango-rest-knox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjazzband%2Fdjango-rest-knox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjazzband%2Fdjango-rest-knox/lists"}