kagi


Namekagi JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/justinmayer/kagi
SummaryDjango app for WebAuthn and TOTP-based multi-factor authentication
upload_time2023-06-08 09:21:05
maintainer
docs_urlNone
authorJustin Mayer
requires_python>=3.7,<4.0
licenseBSD-2-Clause
keywords django webauthn authentication mfa 2fa
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Kagi
====

|coc| |build-status| |coverage| |readthedocs| |pypi|


.. |coc| image:: https://img.shields.io/badge/%E2%9D%A4-code%20of%20conduct-blue.svg
    :target: https://github.com/justinmayer/kagi/blob/master/CODE_OF_CONDUCT.rst
    :alt: Code of Conduct

.. |build-status| image:: https://img.shields.io/github/actions/workflow/status/justinmayer/kagi/main.yml?branch=main
    :target: https://github.com/justinmayer/kagi/actions
    :alt: Build Status

.. |coverage| image:: https://img.shields.io/badge/coverage-100%25-brightgreen
    :target: https://github.com/justinmayer/kagi
    :alt: Code Coverage

.. |readthedocs| image:: https://readthedocs.org/projects/kagi/badge/?version=latest
    :target: https://kagi.readthedocs.io/en/latest/
    :alt: Documentation Status

.. |pypi| image:: https://img.shields.io/pypi/v/kagi.svg
    :target: https://pypi.org/project/kagi/
    :alt: PyPI Version


Kagi provides support for FIDO WebAuthn security keys and TOTP tokens in Django.

Kagi is a relatively young project and has not yet been fully battle-tested.
Its use in a high-impact environment should be accompanied by a thorough
understanding of how it works before relying on it.

Installation
------------

::

    python -m pip install kagi

Add ``kagi`` to ``INSTALLED_APPS`` and include ``kagi.urls`` somewhere in your
URL patterns. Set: ``LOGIN_URL = "kagi:login"``

Make sure that Django’s built-in login view does not have a
``urlpattern``, because it will authenticate users without their second
factor. Kagi provides its own login view to handle that.

Demo
----

To see a demo, use the test project included in this repository and perform the
following steps (creating and activating a virtual environment first is optional).

First, install Poetry_::

    curl -sSL https://install.python-poetry.org/ | python -

Clone the Kagi source code and switch to its directory::

    git clone https://github.com/justinmayer/kagi.git && cd kagi

Install dependencies, run database migrations, create a user, and serve the demo::

    poetry install
    poetry shell
    invoke migrate
    python testproj/manage.py createsuperuser
    invoke serve

You should now be able to see the demo project login page in your browser at:
http://localhost:8000/kagi/login

Supported browsers and versions can be found here: https://caniuse.com/webauthn
For domains other than ``localhost``, WebAuthn requires that the site is served
over a secure (HTTPS) connection.

Since you haven’t added any security keys yet, you will be logged in with just a
username and password. Once logged in and on the multi-factor settings page,
choose “Manage WebAuthn keys” and then “Add another key” and follow the provided
instructions. Once WebAuthn and/or TOTP has been successfully configured, your
account will be protected by multi-factor authentication, and when you log in
the next time, your WebAuthn key or TOTP token will be required.

You can manage the keys attached to your account on the key management page at:
http://localhost:8000/kagi/keys


Using WebAuthn Keys on Linux
============================

Some distros don’t come with udev rules to make USB HID /dev/
nodes accessible to normal users. If your key doesn’t light up
and start flashing when you expect it to, this might be what is
happening. See https://github.com/Yubico/libu2f-host/issues/2 and
https://github.com/Yubico/libu2f-host/blob/master/70-u2f.rules for some
discussion of the rule to make it accessible. If you just want a quick
temporary fix, you can run ``sudo chmod 666 /dev/hidraw*`` every time
after you plug in your key (the files disappear after unplugging).


Gratitude
=========

This project would not exist without the significant contributions made by
`Rémy HUBSCHER <https://github.com/natim>`_.

Thanks to Gavin Wahl for `django-u2f <https://github.com/gavinwahl/django-u2f>`_,
which served as useful initial scaffolding for this project.


.. _Poetry: https://python-poetry.org/docs/#installation


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/justinmayer/kagi",
    "name": "kagi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "Django,WebAuthn,authentication,MFA,2FA",
    "author": "Justin Mayer",
    "author_email": "entroP@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/43/94/2391f343d905522d5317c2ed4d23e38a79b26f9dcacdde86349455bdd6d7/kagi-0.4.0.tar.gz",
    "platform": null,
    "description": "Kagi\n====\n\n|coc| |build-status| |coverage| |readthedocs| |pypi|\n\n\n.. |coc| image:: https://img.shields.io/badge/%E2%9D%A4-code%20of%20conduct-blue.svg\n    :target: https://github.com/justinmayer/kagi/blob/master/CODE_OF_CONDUCT.rst\n    :alt: Code of Conduct\n\n.. |build-status| image:: https://img.shields.io/github/actions/workflow/status/justinmayer/kagi/main.yml?branch=main\n    :target: https://github.com/justinmayer/kagi/actions\n    :alt: Build Status\n\n.. |coverage| image:: https://img.shields.io/badge/coverage-100%25-brightgreen\n    :target: https://github.com/justinmayer/kagi\n    :alt: Code Coverage\n\n.. |readthedocs| image:: https://readthedocs.org/projects/kagi/badge/?version=latest\n    :target: https://kagi.readthedocs.io/en/latest/\n    :alt: Documentation Status\n\n.. |pypi| image:: https://img.shields.io/pypi/v/kagi.svg\n    :target: https://pypi.org/project/kagi/\n    :alt: PyPI Version\n\n\nKagi provides support for FIDO WebAuthn security keys and TOTP tokens in Django.\n\nKagi is a relatively young project and has not yet been fully battle-tested.\nIts use in a high-impact environment should be accompanied by a thorough\nunderstanding of how it works before relying on it.\n\nInstallation\n------------\n\n::\n\n    python -m pip install kagi\n\nAdd ``kagi`` to ``INSTALLED_APPS`` and include ``kagi.urls`` somewhere in your\nURL patterns. Set: ``LOGIN_URL = \"kagi:login\"``\n\nMake sure that Django\u2019s built-in login view does not have a\n``urlpattern``, because it will authenticate users without their second\nfactor. Kagi provides its own login view to handle that.\n\nDemo\n----\n\nTo see a demo, use the test project included in this repository and perform the\nfollowing steps (creating and activating a virtual environment first is optional).\n\nFirst, install Poetry_::\n\n    curl -sSL https://install.python-poetry.org/ | python -\n\nClone the Kagi source code and switch to its directory::\n\n    git clone https://github.com/justinmayer/kagi.git && cd kagi\n\nInstall dependencies, run database migrations, create a user, and serve the demo::\n\n    poetry install\n    poetry shell\n    invoke migrate\n    python testproj/manage.py createsuperuser\n    invoke serve\n\nYou should now be able to see the demo project login page in your browser at:\nhttp://localhost:8000/kagi/login\n\nSupported browsers and versions can be found here: https://caniuse.com/webauthn\nFor domains other than ``localhost``, WebAuthn requires that the site is served\nover a secure (HTTPS) connection.\n\nSince you haven\u2019t added any security keys yet, you will be logged in with just a\nusername and password. Once logged in and on the multi-factor settings page,\nchoose \u201cManage WebAuthn keys\u201d and then \u201cAdd another key\u201d and follow the provided\ninstructions. Once WebAuthn and/or TOTP has been successfully configured, your\naccount will be protected by multi-factor authentication, and when you log in\nthe next time, your WebAuthn key or TOTP token will be required.\n\nYou can manage the keys attached to your account on the key management page at:\nhttp://localhost:8000/kagi/keys\n\n\nUsing WebAuthn Keys on Linux\n============================\n\nSome distros don\u2019t come with udev rules to make USB HID /dev/\nnodes accessible to normal users. If your key doesn\u2019t light up\nand start flashing when you expect it to, this might be what is\nhappening. See https://github.com/Yubico/libu2f-host/issues/2 and\nhttps://github.com/Yubico/libu2f-host/blob/master/70-u2f.rules for some\ndiscussion of the rule to make it accessible. If you just want a quick\ntemporary fix, you can run ``sudo chmod 666 /dev/hidraw*`` every time\nafter you plug in your key (the files disappear after unplugging).\n\n\nGratitude\n=========\n\nThis project would not exist without the significant contributions made by\n`R\u00e9my HUBSCHER <https://github.com/natim>`_.\n\nThanks to Gavin Wahl for `django-u2f <https://github.com/gavinwahl/django-u2f>`_,\nwhich served as useful initial scaffolding for this project.\n\n\n.. _Poetry: https://python-poetry.org/docs/#installation\n\n",
    "bugtrack_url": null,
    "license": "BSD-2-Clause",
    "summary": "Django app for WebAuthn and TOTP-based multi-factor authentication",
    "version": "0.4.0",
    "project_urls": {
        "Documentation": "https://kagi.readthedocs.io",
        "Homepage": "https://github.com/justinmayer/kagi",
        "Issue Tracker": "https://github.com/justinmayer/kagi/issues",
        "Repository": "https://github.com/justinmayer/kagi"
    },
    "split_keywords": [
        "django",
        "webauthn",
        "authentication",
        "mfa",
        "2fa"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b18c0ad8b13921ad5597a22f9abc589e85ee37705587d58bd3a86abb3411ce5d",
                "md5": "d38379e2a212736206a471e837abac05",
                "sha256": "3b184d871246b754e168cd08a9ab9cfb4dc45bbfb039e05c6691e092b94e4e2e"
            },
            "downloads": -1,
            "filename": "kagi-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d38379e2a212736206a471e837abac05",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 35928,
            "upload_time": "2023-06-08T09:21:03",
            "upload_time_iso_8601": "2023-06-08T09:21:03.935940Z",
            "url": "https://files.pythonhosted.org/packages/b1/8c/0ad8b13921ad5597a22f9abc589e85ee37705587d58bd3a86abb3411ce5d/kagi-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "43942391f343d905522d5317c2ed4d23e38a79b26f9dcacdde86349455bdd6d7",
                "md5": "7037fda2f51ecc91dc5becdaeba18324",
                "sha256": "1530e7de0b9b3522d77ea41e1069b6497f04c19063061a57d26a2f9ce2561061"
            },
            "downloads": -1,
            "filename": "kagi-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7037fda2f51ecc91dc5becdaeba18324",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 26381,
            "upload_time": "2023-06-08T09:21:05",
            "upload_time_iso_8601": "2023-06-08T09:21:05.540069Z",
            "url": "https://files.pythonhosted.org/packages/43/94/2391f343d905522d5317c2ed4d23e38a79b26f9dcacdde86349455bdd6d7/kagi-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-08 09:21:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "justinmayer",
    "github_project": "kagi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "kagi"
}
        
Elapsed time: 0.70408s