{"id":17945194,"url":"https://github.com/eshaan7/django-rest-durin","last_synced_at":"2025-09-10T04:33:53.884Z","repository":{"id":43264429,"uuid":"305192156","full_name":"eshaan7/django-rest-durin","owner":"eshaan7","description":"Token Authentication module for Django Rest Framework with different token configuration for API client.","archived":false,"fork":false,"pushed_at":"2023-05-03T20:04:10.000Z","size":191,"stargazers_count":48,"open_issues_count":8,"forks_count":16,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-08T06:48:06.298Z","etag":null,"topics":["api-client","django","django-rest-framework","drf","drf-tokens","hacktoberfest","python","tokenauthentication"],"latest_commit_sha":null,"homepage":"https://django-rest-durin.rtfd.io","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/eshaan7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"custom":["https://xscode.com/eshaan7/django-rest-durin"]}},"created_at":"2020-10-18T20:39:22.000Z","updated_at":"2025-07-23T03:55:26.000Z","dependencies_parsed_at":"2024-06-19T05:28:54.271Z","dependency_job_id":"4ce65c52-760c-4d50-949a-71a69cfcaa53","html_url":"https://github.com/eshaan7/django-rest-durin","commit_stats":{"total_commits":51,"total_committers":5,"mean_commits":10.2,"dds":"0.13725490196078427","last_synced_commit":"3abcf27ac424e94f32475ee25d44a55b892ad125"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/eshaan7/django-rest-durin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaan7%2Fdjango-rest-durin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaan7%2Fdjango-rest-durin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaan7%2Fdjango-rest-durin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaan7%2Fdjango-rest-durin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eshaan7","download_url":"https://codeload.github.com/eshaan7/django-rest-durin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eshaan7%2Fdjango-rest-durin/sbom","scorecard":{"id":382485,"data":{"date":"2025-08-11","repo":{"name":"github.com/eshaan7/django-rest-durin","commit":"648b3086cd073b33324273c422620b6eb166b0f4"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 2/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:16","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:17","Warn: no topLevel permission defined: .github/workflows/codeql.yml:1","Warn: no topLevel permission defined: .github/workflows/pythonpublish.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/eshaan7/django-rest-durin/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/eshaan7/django-rest-durin/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/eshaan7/django-rest-durin/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/eshaan7/django-rest-durin/codeql.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpublish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/eshaan7/django-rest-durin/pythonpublish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pythonpublish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/eshaan7/django-rest-durin/pythonpublish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/eshaan7/django-rest-durin/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/eshaan7/django-rest-durin/test.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/pythonpublish.yml:18","Warn: pipCommand not pinned by hash: .github/workflows/pythonpublish.yml:19","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:38","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:39","Warn: downloadThenRun not pinned by hash: .github/workflows/test.yml:50","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"36 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2022-238 / GHSA-h3qr-fjhm-jphw","Warn: Project is vulnerable to: PYSEC-2022-190 / GHSA-2gwj-7jmv-h26r","Warn: Project is vulnerable to: PYSEC-2020-32 / GHSA-2m34-jcjv-45xf","Warn: Project is vulnerable to: PYSEC-2020-36 / GHSA-3gh2-xw74-jmcw","Warn: Project is vulnerable to: PYSEC-2022-1 / GHSA-53qw-q765-4fww","Warn: Project is vulnerable to: PYSEC-2021-98 / GHSA-68w8-qjq3-2gfm","Warn: Project is vulnerable to: GHSA-6c3j-c64m-qhgq","Warn: Project is vulnerable to: PYSEC-2019-10 / GHSA-6c7v-2f49-8h26","Warn: Project is vulnerable to: PYSEC-2022-20 / GHSA-6cw3-g6wv-c2xv","Warn: Project is vulnerable to: PYSEC-2019-13 / GHSA-6r97-cj55-9hrq","Warn: Project is vulnerable to: PYSEC-2019-79 / GHSA-7rp2-fm2h-wchj","Warn: Project is vulnerable to: GHSA-7xr5-9hcq-chf9","Warn: Project is vulnerable to: PYSEC-2022-2 / GHSA-8c5j-9r9f-c6w8","Warn: Project is vulnerable to: GHSA-8x94-hmjh-97hq","Warn: Project is vulnerable to: PYSEC-2022-19 / GHSA-95rw-fx8r-36v6","Warn: Project is vulnerable to: PYSEC-2019-11 / GHSA-c4qh-4vgv-qc6g","Warn: Project is vulnerable to: PYSEC-2020-34 / GHSA-fr28-569j-53c4","Warn: Project is vulnerable to: PYSEC-2021-9 / GHSA-fvgf-6h6h-3322","Warn: Project is vulnerable to: PYSEC-2019-12 / GHSA-h5jv-4p7w-64jg","Warn: Project is vulnerable to: PYSEC-2020-35 / GHSA-hmr4-m2h5-33qx","Warn: Project is vulnerable to: PYSEC-2019-15 / GHSA-hvmf-r92r-27hr","Warn: Project is vulnerable to: PYSEC-2022-3 / GHSA-jrh2-hc4r-7jwx","Warn: Project is vulnerable to: PYSEC-2020-33 / GHSA-m6gj-h9gm-gw44","Warn: Project is vulnerable to: PYSEC-2021-99 / GHSA-p99v-5w3c-jqq9","Warn: Project is vulnerable to: PYSEC-2021-8 / GHSA-qm57-vhq3-3fwf","Warn: Project is vulnerable to: GHSA-rrqc-c2jx-6jgv","Warn: Project is vulnerable to: PYSEC-2021-7 / GHSA-rxjp-mfm9-w4wr","Warn: Project is vulnerable to: PYSEC-2021-439 / GHSA-v6rh-hp5x-86rv","Warn: Project is vulnerable to: PYSEC-2019-14 / GHSA-v9qg-3j8p-r63v","Warn: Project is vulnerable to: PYSEC-2019-16 / GHSA-vfq6-hq5r-27r6","Warn: Project is vulnerable to: PYSEC-2022-191 / GHSA-w24h-v9qh-8gxj","Warn: Project is vulnerable to: PYSEC-2020-31 / GHSA-wpjr-j57x-wxfw","Warn: Project is vulnerable to: PYSEC-2021-6 / GHSA-xgxc-v2qg-chmh","Warn: Project is vulnerable to: PYSEC-2020-263 / GHSA-fx83-3ph3-9j2q","Warn: Project is vulnerable to: GHSA-gw84-84pc-xp82"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T15:47:59.162Z","repository_id":43264429,"created_at":"2025-08-18T15:47:59.162Z","updated_at":"2025-08-18T15:47:59.162Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274166988,"owners_count":25233962,"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","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api-client","django","django-rest-framework","drf","drf-tokens","hacktoberfest","python","tokenauthentication"],"created_at":"2024-10-29T06:24:32.114Z","updated_at":"2025-09-10T04:33:53.857Z","avatar_url":"https://github.com/eshaan7.png","language":"Python","funding_links":["https://xscode.com/eshaan7/django-rest-durin"],"categories":[],"sub_categories":[],"readme":"# Django-Rest-Durin\n\n[![django-rest-durin on pypi](https://img.shields.io/pypi/v/django-rest-durin)](https://pypi.org/project/django-rest-durin/)\n[![Build Status](https://github.com/Eshaan7/django-rest-durin/workflows/Linter%20\u0026%20Tests/badge.svg)](https://github.com/Eshaan7/django-rest-durin/actions?query=workflow%3A%22Linter+%26+Tests%22)\n[![codecov](https://codecov.io/gh/Eshaan7/django-rest-durin/branch/main/graph/badge.svg?token=S9KEI0PU05)](https://codecov.io/gh/Eshaan7/django-rest-durin/)\n[![CodeFactor](https://www.codefactor.io/repository/github/eshaan7/django-rest-durin/badge)](https://www.codefactor.io/repository/github/eshaan7/django-rest-durin)\n\u003ca href=\"https://lgtm.com/projects/g/Eshaan7/django-rest-durin/context:python\"\u003e\n\u003cimg alt=\"Language grade: Python\" src=\"https://img.shields.io/lgtm/grade/python/g/Eshaan7/django-rest-durin.svg?logo=lgtm\u0026logoWidth=18\"/\u003e\n\u003c/a\u003e\n\nPer API client token authentication Module for [Django REST Framework](http://www.django-rest-framework.org/).\n\nThe idea is to provide one library that does token auth for multiple Web/CLI/Mobile API clients (i.e. devices/user-agents) via one interface but allows different token configuration for each client.\n\nDurin authentication is token based, similar to the `TokenAuthentication`\nbuilt in to DRF. However, it adds some extra sauce:\n\n- Durin allows **multiple tokens per user**. But only one token each user per API client.\n- Each user token is associated with an API Client.\n  - These API Clients are configurable via Django's Admin Interface.\n  - Includes [permission enforcing](https://django-rest-durin.readthedocs.io/en/latest/permissions.html) to allow only specific clients to make authenticated requests to certain `APIViews` or vice-a-versa.\n  - Configure [Rate-Throttling](https://django-rest-durin.readthedocs.io/en/latest/throttling.html) per User \u003c-\u003e Client pair.\n- Durin provides an option for a logged in user to **remove all tokens** that the server has - forcing them to re-authenticate for all API clients.\n- Durin **tokens can be renewed** to get a fresh expiry.\n- Durin provides a `CachedTokenAuthentication` backend as well which uses memoization for faster look ups.\n- Durin provides **Session Management** features. Refer to [Session Management Views](https://django-rest-durin.readthedocs.io/en/latest/views.html#session-management-views) i.e.,\n  - REST view for an authenticated user to get list of sessions (in context of django-rest-durin, this means `AuthToken` instances) and revoke a session. Useful for pages like \"View active browser sessions\".\n  - REST view for an authenticated user to get/create/delete token against a pre-defined client. Useful for pages like \"Get API key\" where a user can get an API key to be able to interact directly with your project's RESTful API using cURL or a custom client.\n\nMore information can be found in the [Documentation](https://django-rest-durin.readthedocs.io/en/latest/installation.html). I'd also recommend going through the `example_project/` included in this repository.\n\n## Django Compatibility Matrix\n\n![PyPi versions - Python](https://img.shields.io/pypi/pyversions/django-rest-durin)\n\nIf your project uses an older verison of Django or Django Rest Framework, you can choose an older version of this project.\n\n| This Project | Python Version | Django Version          | Django Rest Framework |\n| ------------ | -------------- | ----------------------- | --------------------- |\n| 0.1+         | 3.5 - 3.10     | 2.2, 3.0, 3.1, 3.2, 4.0 | 3.7\u003e=                 |\n\nMake sure to use at least `DRF 3.10` when using `Django 3.0` or newer.\n\n## Changelog / Releases\n\nAll releases should be listed in the [releases tab on GitHub](https://github.com/Eshaan7/django-rest-durin/releases).\n\nSee [CHANGELOG](https://django-rest-durin.readthedocs.io/en/latest/changelog.html) for a more detailed listing.\n\n## License\n\nThis project is published with the [MIT License](LICENSE). See [https://choosealicense.com/licenses/mit/](https://choosealicense.com/licenses/mit/) for more information about what this means.\n\n## Credits\n\nDurin is inpired by the [django-rest-knox](https://github.com/James1345/django-rest-knox) and [django-rest-multitokenauth](https://github.com/anexia-it/django-rest-multitokenauth) libraries and adopts some learnings and code from both.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feshaan7%2Fdjango-rest-durin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feshaan7%2Fdjango-rest-durin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feshaan7%2Fdjango-rest-durin/lists"}