{ "info": { "author": "Errietta Kostala", "author_email": "errietta@errietta.me", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Mandate\n\nAsync fork of [warrant](https://github.com/capless/warrant).\n\nPart of the code was provided by the [warrant](https://github.com/capless/warrant) contributors as part of that software. This code has been duplicated here as allowed by the Apache License 2.0. The warrant code is copyright of the warrant contributors. Any other code is copyright of mandate contributors.\n\n## Initialise\n\n```python\n cog = Cognito(\n 'pool_id', # user pool id\n 'client_id', # client id\n user_pool_region='eu-west-2', # optional\n username='your-user@email.com',\n client_secret='secret', # optional\n loop=loop # optional\n )\n```\n\n## Register\n\n```python\n cog.add_base_attributes(email='your-user@email.com')\n await cog.register('your-user@email.com', 'password')\n```\n\n`admin_create_user` is also available:\n```python\n await cog.admin_create_user('user@email.com')\n```\n\n## Confirm Sign up\n\n```python\n await cog.confirm_sign_up('SIGNUP_CODE', 'your-user@email.com')\n```\n\n`admin_confirm_sign_up` is also available:\n\n```python\n await cog.admin_confirm_sign_up('user@email.com')\n```\n\n## Authenticate\n\nAll the below examples can be called with or without `admin_` variants.\n\nPer [the documentation](https://docs.aws.amazon.com/en_us/cognito/latest/developerguide/amazon-cognito-user-pools-authentication-flow.html#amazon-cognito-user-pools-server-side-authentication-flow), when running a backend server, you can use the `admin_` methods for authentication and user-related activities. For example:\n\n```python\n await cog.admin_authenticate(password)\n```\n\nTechnically, the non-admin workflow can also be used with, however I have not got this to work with app secrets! Help would be appreciated here.\n\n```python\n await cog.authenticate(password)\n```\n\n```\nbotocore.errorfactory.NotAuthorizedException: An error occurred (NotAuthorizedException) when calling the RespondToAuthChallenge operation: Unable to verify secret hash for client \n```\n\nIf you create an app without app secrets, you should also be able to use the non-admin versions without issues.\n\n## Forgot password\n```python\n await cog.initiate_forgot_password()\n # Get the code from the email\n await cog.confirm_forgot_password(code, new_password)\n```\n\n\n## Get user attributes\n```python\n await cog.admin_authenticate('password')\n user = await cog.get_user()\n```\n\n## Change password\n```python\n await cog.admin_authenticate(old_password)\n await cog.change_password(old_password, new_password)\n```\n\n## Update profile\n```python\n await cog.admin_authenticate(password)\n await cog.update_profile(\n {\n 'address': 'foo'\n }\n )\n```\n\nOr as admin\n```python\n await cog.admin_update_profile(\n username='other-user',\n attrs={'gender':'potato'}\n )\n```\n\n## Logout\n```python\n await cog.logout()\n```\n\n## Development\n\nInstall [poetry](https://github.com/sdispater/poetry), then to install the\ndependencies:\n\n```\npoetry install\n```\n\n## Unit tests\npython -m unittest discover tests\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "Apache-2.0", "maintainer": "Errietta Kostala", "maintainer_email": "errietta@errietta.me", "name": "mandate", "package_url": "https://pypi.org/project/mandate/", "platform": "", "project_url": "https://pypi.org/project/mandate/", "project_urls": null, "release_url": "https://pypi.org/project/mandate/1.0.0/", "requires_dist": [ "envs (>=0.3.0)", "aioboto3", "aiohttp", "aiohttp-client-manager", "lru-dict", "attrs", "asynctest", "python-jose" ], "requires_python": ">=3.6,<4.0", "summary": "Async wrapper for AWS cognito. Heavily based on capless/warrant", "version": "1.0.0" }, "last_serial": 5472085, "releases": { "0.2.4": [ { "comment_text": "", "digests": { "md5": "67c5df528035e52a0f5a387d77c6385f", "sha256": "e8123add7c707fd17f911ea7b11a3d1ae04c3f55485db62d33fb53cc40ae9e21" }, "downloads": -1, "filename": "mandate-0.2.4-py3-none-any.whl", "has_sig": false, "md5_digest": "67c5df528035e52a0f5a387d77c6385f", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 53291, "upload_time": "2019-02-03T19:54:13", "url": "https://files.pythonhosted.org/packages/be/fd/4c8de24b3f4d49d15a7dc7930c33db2b8a77af2dd1c37584a7e7c3627815/mandate-0.2.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b4e4605d2385257a30314fb437a043d9", "sha256": "b90a4f54034201af3fdedba3ceda74676b435671c2a84c90fad20d6d0ff4cac4" }, "downloads": -1, "filename": "mandate-0.2.4.tar.gz", "has_sig": false, "md5_digest": "b4e4605d2385257a30314fb437a043d9", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 15825, "upload_time": "2019-02-03T19:54:15", "url": "https://files.pythonhosted.org/packages/6a/c4/a7dab2ad20bb8440aacff78585559f6f7b84503638ff25983b559c7bd5ec/mandate-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "8c1c2700cbfe96697b22a7119ee87cf4", "sha256": "d4ebb99d8e3d5dfe5f001010e672d8441b1e3b44d0f9c7272c1479c71e0e6b5c" }, "downloads": -1, "filename": "mandate-0.2.5-py3-none-any.whl", "has_sig": false, "md5_digest": "8c1c2700cbfe96697b22a7119ee87cf4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 16810, "upload_time": "2019-05-24T17:56:36", "url": "https://files.pythonhosted.org/packages/19/54/74341f0627751ec4ffa9cb2269a902e089ba1065ae323bad0c674737bd4b/mandate-0.2.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bc01cfe23e1658a2c8729d3d57655d9f", "sha256": "7ceeff9ad6996e868a86affeeb6176b20a8ac234cfa0b4fc4fcd77fdb57a57b7" }, "downloads": -1, "filename": "mandate-0.2.5.tar.gz", "has_sig": false, "md5_digest": "bc01cfe23e1658a2c8729d3d57655d9f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 16203, "upload_time": "2019-05-24T17:56:38", "url": "https://files.pythonhosted.org/packages/04/91/284b2717aa17e91af2ca03adc5ee6cec4f892b046f65e9bca130fcb9cec2/mandate-0.2.5.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "d3cb7eb70c8816c613be21b1d572160b", "sha256": "f2bb6ac2adfcc3f4b066fcf20acc1ff3b035fd0b5babc404be82609e4f1d35e7" }, "downloads": -1, "filename": "mandate-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d3cb7eb70c8816c613be21b1d572160b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 16865, "upload_time": "2019-05-26T13:36:29", "url": "https://files.pythonhosted.org/packages/fe/be/33beceefa44bb839a3664fa0096ec4c0dcbb29094355b612c508b8489704/mandate-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "487a0dfd6178db4bc4e1cdf161151338", "sha256": "900a39749fdcff608c40b917be56cde9c4bc213a1098b412c14bd02334697f3e" }, "downloads": -1, "filename": "mandate-0.3.0.tar.gz", "has_sig": false, "md5_digest": "487a0dfd6178db4bc4e1cdf161151338", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 16330, "upload_time": "2019-05-26T13:36:30", "url": "https://files.pythonhosted.org/packages/81/ae/2ab4f3931df5a69c1ad8f969620a545d5e9bd5d4635fd3953f3e396a85e5/mandate-0.3.0.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "4d1cfb136bdd156b04533dcff39691ab", "sha256": "7946b35f20d3c2c028e9de8bf827ef4109c99bb19be121db3747b8920ba46c36" }, "downloads": -1, "filename": "mandate-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4d1cfb136bdd156b04533dcff39691ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 17070, "upload_time": "2019-07-01T17:11:53", "url": "https://files.pythonhosted.org/packages/1a/d3/f8c68fda00eb59a73a38b2469bb76209a1859ddf0d7f465de4b8a69adb3d/mandate-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac4e7d36912dd416201f15e2b7f2be0f", "sha256": "740cffb08b7410238720c109d4859db2eadeba8c18b07c470531b4e3d4351012" }, "downloads": -1, "filename": "mandate-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ac4e7d36912dd416201f15e2b7f2be0f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 16429, "upload_time": "2019-07-01T17:11:55", "url": "https://files.pythonhosted.org/packages/b5/71/b6953147f02c1414f93dd4223fb562399516184ce823db2a29f8e4e0f78c/mandate-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4d1cfb136bdd156b04533dcff39691ab", "sha256": "7946b35f20d3c2c028e9de8bf827ef4109c99bb19be121db3747b8920ba46c36" }, "downloads": -1, "filename": "mandate-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4d1cfb136bdd156b04533dcff39691ab", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6,<4.0", "size": 17070, "upload_time": "2019-07-01T17:11:53", "url": "https://files.pythonhosted.org/packages/1a/d3/f8c68fda00eb59a73a38b2469bb76209a1859ddf0d7f465de4b8a69adb3d/mandate-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ac4e7d36912dd416201f15e2b7f2be0f", "sha256": "740cffb08b7410238720c109d4859db2eadeba8c18b07c470531b4e3d4351012" }, "downloads": -1, "filename": "mandate-1.0.0.tar.gz", "has_sig": false, "md5_digest": "ac4e7d36912dd416201f15e2b7f2be0f", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6,<4.0", "size": 16429, "upload_time": "2019-07-01T17:11:55", "url": "https://files.pythonhosted.org/packages/b5/71/b6953147f02c1414f93dd4223fb562399516184ce823db2a29f8e4e0f78c/mandate-1.0.0.tar.gz" } ] }