Git Product home page Git Product logo

django-otp-with-test's Introduction

django-otp

PyPI

Documentation

Source

This project makes it easy to add support for one-time passwords (OTPs) to Django. It can be integrated at various levels, depending on how much customization is required. It integrates with django.contrib.auth, although it is not a Django authentication backend. The primary target is developers wishing to incorporate OTPs into their Django projects as a form of two-factor authentication.

Several simple OTP plugins are included and more are available separately. This package also includes an implementation of OATH HOTP and TOTP for convenience, as these are standard OTP algorithms used by multiple plugins.

If you're looking for a higher-level or more opinionated solution, you might be interested in django-two-factor-auth.

Status

This project is stable and maintained, but is no longer actively used by the author and is not seeing much ongoing investment. Anyone interested in taking over aspects of the project should contact me.

Well-formed issues and pull requests are welcome, but please see the Contributing section of the README first.

The Future

Once upon a time, everything was usernames and passwords. Or even in the case of other authentication mechanisms, a user was either authenticated or not (anonymous in Django's terminology). Then there was two-factor authentication, which could simply be an implementation detail in a binary authentication state, but could also imply levels or degrees of authentication.

These days, it's increasingly common to see sites with more nuanced authentication state. A site might remember who you are forever—so you're not anonymous—but if you try to do anything private, you have to re-authenticate. You may be able to choose from among all of the authentication mechanisms you have configured, or only from some of them. Specific mechanisms may be required for specific actions, such as using your U2F device to access your U2F settings.

In short, the world seems to be moving beyond the assumptions that originally informed Django's essential authentication design. If I were still investing in Django generally, I would probably start a new multi-factor authentication project that would reflect these changes. It would incorporate the idea that a user may be authenticated by various combinations of mechanisms at any time and that different combinations may be required to satisfy diverse authorization requirements across the site. It would most likely try to disentangle authentication persistence from sessions, at least to some extent. Many sites would not require all of this flexibility, but it would open up possibilities for better experiences by not asking users for more than we require at any point.

If anyone has a mind to take on a project like this, I'd be happy to offer whatever advice or lessons learned that I can.

Development

Development dependencies are defined in the Pipfile; use pipenv to set up a suitable shell.

The tests in tox.ini cover a representative sample of supported Python and Django versions, as well as running flake8 and isort for linting and style consistency. Please run tox before checking in and sending a pull request.

Contributing

As mentioned above, this project is stable and mature. Issues and pull requests are welcome for important bugs and improvements. For non-trivial changes, it's often a good idea to start by opening an issue to track the need for a change and then optionally open a pull request with a proposed resolution. Issues and pull requests should also be focused on a single thing. Pull requests that bundle together a bunch of loosely related commits are unlikely to go anywhere.

Another good rule of thumb—for any project, but especially a mature one—is to keep changes as simple as possible. In particular, there should be a high bar for adding new dependencies. Although it can't be ruled out, it seems highly unlikely that a new runtime dependency will ever be added. New testing dependencies are more likely, but only if there's no other way to address an important need.

If there's a development tool that you'd like to use with this project, the first step is to try to update config files (setup.cfg or similar) to integrate the tool with the existing code. A bit of configuration glue for popular tools should always be safe. If that's not possible, we can consider modifying the code to be compatible with a broader range of tools (without breaking any existing compatibilities). Only as a last resort would a new testing or development tool be incorporated into the project as a dependency.

It's also good to remember that writing the code is typically the least part of the work. This is true for software development in general, but especially a small stable project like this. The bulk of the work is in understanding the problem, determining the desired attributes of a solution, researching and evaluating alternatives, writing documentation, designing a testing strategy, etc. Writing the code itself tends to be a minor matter that emerges from that process.

django-otp-with-test's People

Contributors

psagers avatar claudep avatar cabarnes avatar robi-richter avatar unchris avatar hylje avatar ajmath62 avatar alankokoiev avatar acatton avatar bparmentier avatar davidbrai avatar filiplajszczak avatar grutt avatar gmorell avatar gingrassia avatar illia-v avatar jaap3 avatar dekkers avatar jhillacre avatar kittywaresz avatar lesprimus avatar spookylukey avatar felixxm avatar mbertheau avatar duverse avatar clokep avatar pzrq avatar bluetech avatar arjan-s avatar robintema avatar

Stargazers

Mohammad Goli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.