{ "info": { "author": "Ingmar Steen", "author_email": "iksteen@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# aws-request-signer\n> A python library to sign AWS requests using AWS Signature V4.\n\nThis small python library serves only purpose: Helping you sign HTTP\nrequests for use with AWS (and compatible) services. The library is\nunopinionated and should work with just about anything that makes HTTP\nrequests (requests, aiohttp).\n\nIt supports generating authorization headers for HTTP requests,\npre-signing URLs so you can easily use them elsewhere and signing S3\nPOST policies for use in HTML forms.\n\nThis library has no requirements, but comes with an authentication\nhelper for the requests package.\n\n## Installation\n\n`aws-request-signer` is available from pypi:\n\n```sh\npip install aws-request-signer\n```\n\n## Usage example\n\nHere's an example of how to use the library to sign a request to upload a file to a\n[minio](https://minio.io/) S3 bucket running on your local machine:\n\n```python\nimport hashlib\n\nimport requests\nfrom aws_request_signer import AwsRequestSigner\n\nAWS_REGION = \"\"\nAWS_ACCESS_KEY_ID = \"minio\"\nAWS_SECRET_ACCESS_KEY = \"minio123\"\n\nURL = \"http://127.0.0.1:9000/demo/hello_world.txt\"\n\n# Demo content for our target file.\ncontent = b\"Hello, World!\\n\"\ncontent_hash = hashlib.sha256(content).hexdigest()\n\n# Create a request signer instance.\nrequest_signer = AwsRequestSigner(\n AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, \"s3\"\n)\n\n# The headers we'll provide and want to sign.\nheaders = {\"Content-Type\": \"text/plain\", \"Content-Length\": str(len(content))}\n\n# Add the authentication headers.\nheaders.update(\n request_signer.sign_with_headers(\"PUT\", URL, headers, content_hash)\n)\n\n# Make the request.\nr = requests.put(URL, headers=headers, data=content)\nr.raise_for_status()\n```\n\n_For more examples and usage, please refer to\n[demo.py](https://github.com/iksteen/aws-request-signer/blob/master/demo.py)._\n\n## Development setup\n\nFor development purposes, you can clone the repository and use\n[poetry](https://poetry.eustace.io/) to install and maintain the\ndependencies. There is no test suite. It comes with a set of pre-commit\nhooks that can format (isort, black) and check your code (mypy, flake8)\nautomatically.\n\n```sh\ngit clone git@github.com:iksteen/aws-request-signer.git\ncd aws-request-signer\npoetry install -E demo\npoetry run pre-commit install\n```\n\n**Note**: At the time of writing, the typeshed library that mypy uses\ncontains an incorrect signature for the `requests.auth.AuthBase.__call__`\nmethod. The repository of aws-request-signer includes updated stubs for\nrequests until the signature is fixed upstream.\n\n## Release History\n\n* 1.0.0\n * Initial Release.\n\n## Meta\n\nIngmar Steen \u2013 [@iksteen](https://twitter.com/iksteen)\n\nDistributed under the MIT license. See ``LICENSE`` for more information.\n\n[https://github.com/iksteen/](https://github.com/iksteen/)\n\n## Contributing\n\n1. Fork it ()\n2. Create your feature branch (`git checkout -b feature/fooBar`)\n3. Commit your changes (`git commit -am 'Add some fooBar'`)\n4. Push to the branch (`git push origin feature/fooBar`)\n5. Create a new Pull Request\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.github.com/iksteen/aws-request-signer", "keywords": "", "license": "MIT", "maintainer": "Ingmar Steen", "maintainer_email": "iksteen@gmail.com", "name": "aws-request-signer", "package_url": "https://pypi.org/project/aws-request-signer/", "platform": "", "project_url": "https://pypi.org/project/aws-request-signer/", "project_urls": { "Homepage": "https://www.github.com/iksteen/aws-request-signer", "Repository": "https://www.github.com/iksteen/aws-request-signer.git" }, "release_url": "https://pypi.org/project/aws-request-signer/1.0.0/", "requires_dist": [ "requests (>=2.21,<3.0); extra == \"requests\" or extra == \"demo\"", "requests_toolbelt (>=0.8.0,<0.9.0); extra == \"demo\"" ], "requires_python": ">=3.5,<4.0", "summary": "A python library to sign AWS requests using AWS Signature V4.", "version": "1.0.0" }, "last_serial": 4735969, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "b4abf7d7bcc4c093ed29154491f7cc9e", "sha256": "e82d208aba68da5a43645d17432af25ea86922e062bed9346c1b143544488d14" }, "downloads": -1, "filename": "aws_request_signer-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b4abf7d7bcc4c093ed29154491f7cc9e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 17291, "upload_time": "2019-01-24T14:43:50", "url": "https://files.pythonhosted.org/packages/72/f9/0d20caae27db789c533d8a375288923d42bd966eeb0d4ebeba150d623253/aws_request_signer-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5eb6be6d47f396ecaba5a67794193867", "sha256": "fd7ffc128ab59b4c69cc8bb2e86f2d7bde0d3673ac2f295c8b5991394f3ed3fe" }, "downloads": -1, "filename": "aws-request-signer-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5eb6be6d47f396ecaba5a67794193867", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 6738, "upload_time": "2019-01-24T14:43:47", "url": "https://files.pythonhosted.org/packages/fd/36/4df8579813eb08e015859b3e6634c684fdebcf6501cb173de8e7b617db0b/aws-request-signer-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b4abf7d7bcc4c093ed29154491f7cc9e", "sha256": "e82d208aba68da5a43645d17432af25ea86922e062bed9346c1b143544488d14" }, "downloads": -1, "filename": "aws_request_signer-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "b4abf7d7bcc4c093ed29154491f7cc9e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5,<4.0", "size": 17291, "upload_time": "2019-01-24T14:43:50", "url": "https://files.pythonhosted.org/packages/72/f9/0d20caae27db789c533d8a375288923d42bd966eeb0d4ebeba150d623253/aws_request_signer-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5eb6be6d47f396ecaba5a67794193867", "sha256": "fd7ffc128ab59b4c69cc8bb2e86f2d7bde0d3673ac2f295c8b5991394f3ed3fe" }, "downloads": -1, "filename": "aws-request-signer-1.0.0.tar.gz", "has_sig": false, "md5_digest": "5eb6be6d47f396ecaba5a67794193867", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5,<4.0", "size": 6738, "upload_time": "2019-01-24T14:43:47", "url": "https://files.pythonhosted.org/packages/fd/36/4df8579813eb08e015859b3e6634c684fdebcf6501cb173de8e7b617db0b/aws-request-signer-1.0.0.tar.gz" } ] }