{ "info": { "author": "Andrey Kislyuk", "author_email": "kislyuk@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS :: MacOS X", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "PyWARP: Python Web Authentication Relying Party library\n=======================================================\n\n**PyWARP** is an implementation of the W3C `WebAuthn `_ standard's Relying Party\ncomponent in Python. The WebAuthn standard is used to provide advanced authentication security for two-factor,\nmultifactor and passwordless authentication models through the use of dedicated hardware security keys and biometric\ndevices such as `Yubico YubiKey `_,\n`Google Titan `_,\n`TPM `_, and\n`Touch ID `_.\n\nCompared to more basic two-factor standards like HOTP (`RFC 4226 `_) and TOTP\n(`RFC 6238 `_), the\n`FIDO U2F `_ profile of WebAuthn uses asymmetric cryptography to\navoid using a shared secret design, which strengthens your authentication solution against server-side attacks. Hardware\nU2F also sequesters the client secret in a dedicated single-purpose device, which strengthens your clients against\nclient-side attacks. And by automating scoping of credentials to relying party IDs (application origin/domain names),\nU2F adds protection against phishing attacks.\n\nPyWARP implements the *Relying Party* component of WebAuthn. A Relying Party is a server-side application that instructs\nthe browser (user agent) to use WebAuthn APIs to authenticate its users.\n\nTo see an example of PyWARP in action, check the ``examples`` directory. Two demos are included: an\n`AWS Chalice `_ app and a `Flask `_ app.\n\nIn addition to reading the `WebAuthn standard `_, we recommend that implementers read\nthe `OWASP Authentication Cheat Sheet `_ and\n`NIST SP 800-63-3: Digital Authentication Guideline `_ for a high level overview of\nauthentication best practices.\n\nInstallation\n------------\n::\n\n pip install pywarp\n\nPyWARP depends on `cryptography `_, which in turn requires OpenSSL and CFFI.\n\nSynopsis\n--------\n\n.. code-block:: python\n\n from pywarp import RelyingPartyManager, Credential\n from pywarp.backends import DynamoBackend # This is an example. See \"storage backends\" below for other databases.\n\n rp_id = \"myapp.example.com\" # This must match the origin domain of your app, as seen by the browser.\n rp = RelyingPartyManager(\"PyWARP demo\", rp_id=rp_id, credential_storage_backend=DynamoBackend())\n\n # Get options for navigator.credentials.create() - pass these to your frontend when registering a user\n rp.get_registration_options(email=str)\n\n # Run the protocol in https://www.w3.org/TR/webauthn/#registering-a-new-credential,\n # then call the credential storage backend to store the credential public key.\n rp.register(attestation_object=bytes, client_data_json=bytes, email=bytes)\n\n # Get options for navigator.credentials.get() - pass these to your frontend when logging in a user\n rp.get_authentication_options(email=str)\n\n # Run the protocol in https://www.w3.org/TR/webauthn/#verifying-assertion,\n # calling the credential storage backend to retrieve the credential public key.\n # If no exception is raised, proceed with user login.\n rp.verify(authenticator_data=bytes, client_data_json=bytes, signature=bytes, user_handle=bytes, raw_id=bytes,\n email=bytes)\n\nSee `examples/chalice/app.py `_ and\n`examples/chalice/chalicelib/index.html `_ (frontend) for a complete example.\n\nStorage backends\n----------------\n\nYour application is presumably using an application server like uWSGI, a database backend like MySQL, PostgreSQL or\nMongoDB, and maybe a framework like Flask or Django to tie them together. PyWARP makes no assumptions about your\ndatabase, schema, or model. Instead, it provides an abstract class (``pywarp.backends.CredentialStorageBackend``)\nrepresenting an interface for storing and retrieving WebAuthn credential data for your users.\n\nTo deploy PyWARP, declare a subclass of ``CredentialStorageBackend``. In your subclass, implement bindings to your\ndatabase, then pass an instance of your subclass to ``pywarp.RelyingPartyManager(credential_storage_backend=...)``:\n\n.. code-block:: python\n\n class CredentialStorageBackend:\n def __init__(self):\n self.database_client = ...\n\n def get_credential_by_email(self, email):\n user_record = self.database_client.get(email)\n return Credential(credential_id=user_record[\"cred_id\"],\n credential_public_key=user_record[\"cred_pub_key\"])\n\n def save_credential_for_user(self, email, credential):\n self.database_client.update(email, {\"cred_id\": credential.credential_id,\n \"cred_pub_key\": bytes(credential.public_key)})\n\n def save_challenge_for_user(self, email, challenge, type):\n self.database_client.update(email, {type + \"challenge\": challenge})\n\n def get_challenge_for_user(self, email, type):\n user_record = self.database_client.get(email)\n return user_record[type + \"challenge\"]\n\nExample: Chalice app\n--------------------\n\nThe Chalice app example (in the ``examples/chalice`` directory) can be deployed as an `AWS Lambda `_ application\nwhen used with conventional AWS account credentials (configured via ``aws configure`` in the `AWS CLI `_. This\nexample uses `DynamoDB `_ as a storage backend.\n\nSee the `API documentation `_ for more.\n\nAuthors\n-------\n* Andrey Kislyuk\n\nLinks\n-----\n* `Project home page (GitHub) `_\n* `Documentation (Read the Docs) `_\n* `Package distribution (PyPI) `_\n* `Change log `_\n\nBugs\n----\nPlease report bugs, issues, feature requests, etc. on `GitHub `_.\n\nLicense\n-------\nLicensed under the terms of the `Apache License, Version 2.0 `_.\n\n.. image:: https://img.shields.io/travis/pyauth/pywarp.svg\n :target: https://travis-ci.org/pyauth/pywarp\n.. image:: https://codecov.io/github/pyauth/pywarp/coverage.svg?branch=master\n :target: https://codecov.io/github/pyauth/pywarp?branch=master\n.. image:: https://img.shields.io/pypi/v/pywarp.svg\n :target: https://pypi.python.org/pypi/pywarp\n.. image:: https://img.shields.io/pypi/l/pywarp.svg\n :target: https://pypi.python.org/pypi/pywarp\n.. image:: https://readthedocs.org/projects/pywarp/badge/?version=latest\n :target: https://pywarp.readthedocs.io/\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/pyauth/pywarp", "keywords": "", "license": "Apache Software License", "maintainer": "", "maintainer_email": "", "name": "pywarp", "package_url": "https://pypi.org/project/pywarp/", "platform": "", "project_url": "https://pypi.org/project/pywarp/", "project_urls": { "Homepage": "https://github.com/pyauth/pywarp" }, "release_url": "https://pypi.org/project/pywarp/0.0.4/", "requires_dist": null, "requires_python": "", "summary": "Python WebAuthn Relying Party library", "version": "0.0.4" }, "last_serial": 4654374, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "e7b8b9c8a4b098059db661b19c364008", "sha256": "ef852601de2828f7823ef6645de44274b8cefabb8ea8e9e974bb8c7d4be62545" }, "downloads": -1, "filename": "pywarp-0.0.1.tar.gz", "has_sig": false, "md5_digest": "e7b8b9c8a4b098059db661b19c364008", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1239, "upload_time": "2018-11-08T01:10:29", "url": "https://files.pythonhosted.org/packages/d6/76/e5f91cb1089b23c73e04a8ee0791958216d8f2fff435a1739d743b285720/pywarp-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "b802587f79914678aa16b98ac3a3f6e1", "sha256": "901a14451c13bf80b3b731434271b8b08a19d33f54dab2dd0b5b186c9222d2c4" }, "downloads": -1, "filename": "pywarp-0.0.2.tar.gz", "has_sig": false, "md5_digest": "b802587f79914678aa16b98ac3a3f6e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7132, "upload_time": "2019-01-01T08:08:04", "url": "https://files.pythonhosted.org/packages/7b/90/d6259e9c556af44a6791422bc7d0e7cae7a3d0c725080911138828f0d0e1/pywarp-0.0.2.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "5b4e76b3a402ee453bed6ae2725bbec7", "sha256": "da5bc50307e1cd9b055cde1c3a1f67a42ff3e61854b0c1792ddbcfd7d8b11479" }, "downloads": -1, "filename": "pywarp-0.0.4-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "5b4e76b3a402ee453bed6ae2725bbec7", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10551, "upload_time": "2019-01-02T22:30:22", "url": "https://files.pythonhosted.org/packages/08/df/25c2143a0566f0be50c5caf910d8cef52c951eefa7e7f0c86e84d95e3c11/pywarp-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "313a79a620491d0b57e56625c8a1786c", "sha256": "bda9312cdb3fa2d19d10cead6764a716f803ee77eb2cf15fc1f08c8c3902ca05" }, "downloads": -1, "filename": "pywarp-0.0.4.tar.gz", "has_sig": true, "md5_digest": "313a79a620491d0b57e56625c8a1786c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11665, "upload_time": "2019-01-02T22:30:20", "url": "https://files.pythonhosted.org/packages/96/2d/fbb95b3c0c7e26a6df730555736c9f7c08c86d3d069d48ff374bcd155e7f/pywarp-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5b4e76b3a402ee453bed6ae2725bbec7", "sha256": "da5bc50307e1cd9b055cde1c3a1f67a42ff3e61854b0c1792ddbcfd7d8b11479" }, "downloads": -1, "filename": "pywarp-0.0.4-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "5b4e76b3a402ee453bed6ae2725bbec7", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 10551, "upload_time": "2019-01-02T22:30:22", "url": "https://files.pythonhosted.org/packages/08/df/25c2143a0566f0be50c5caf910d8cef52c951eefa7e7f0c86e84d95e3c11/pywarp-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "313a79a620491d0b57e56625c8a1786c", "sha256": "bda9312cdb3fa2d19d10cead6764a716f803ee77eb2cf15fc1f08c8c3902ca05" }, "downloads": -1, "filename": "pywarp-0.0.4.tar.gz", "has_sig": true, "md5_digest": "313a79a620491d0b57e56625c8a1786c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11665, "upload_time": "2019-01-02T22:30:20", "url": "https://files.pythonhosted.org/packages/96/2d/fbb95b3c0c7e26a6df730555736c9f7c08c86d3d069d48ff374bcd155e7f/pywarp-0.0.4.tar.gz" } ] }