Skip to main content

AWS Signature Version 4 signing for lowhaio, but with UNSIGNED-PAYLOAD

Project description

lowhaio-aws-sigv4-unsigned-payload CircleCI

AWS Signature Version 4 signing for lowhaio, but with UNSIGNED-PAYLOAD. This avoids having to buffer entire objects to memory before upload to S3. However, the length of the object must be known before upload begins.

Installation

pip install lowhaio lowhaio_aws_sigv4_unsigned_payload

Usage

The request function returned from lowhaio.Pool must be wrapped with lowhaio_aws_sigv4_unsigned_payload.signed, as in the below example.

import os
from lowhaio import Pool
from lowhaio_aws_sigv4_unsigned_payload import signed

request, _ = Pool()


chunk = 'abcdefghijklmnopqrstuvqxyz'
content_length = str(len(chunk) * 1000).encode()
async def body():
    for _ in range(0, 1000)
    	yield chunk

# A coroutine that returns a tuple a tuple of access key id, secret access
# key, any other headers, such as x-amz-security-token
async def credentials():
    return os.environ['AWS_ACCESS_KEY_ID'], os.environ['AWS_SECRET_ACCESS_KEY'], ()

signed_request = request(
    request, credentials=credentials, service='s3', region='eu-west-1',
)

code, headers, body = await signed_request(
	b'PUT', 'https://my-bucket.s3-eu-west-1.amazonaws.com/my-key', body=body
	headers=((b'content-length': content_length),))
await buffered(body)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lowhaio_aws_sigv4_unsigned_payload-0.0.4.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file lowhaio_aws_sigv4_unsigned_payload-0.0.4.tar.gz.

File metadata

  • Download URL: lowhaio_aws_sigv4_unsigned_payload-0.0.4.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for lowhaio_aws_sigv4_unsigned_payload-0.0.4.tar.gz
Algorithm Hash digest
SHA256 1f4f3dd535395bbab723068d6572ef2790cee6012fd0ce234ef1ca209b95b231
MD5 e53017ecc6b959836309204133c2c709
BLAKE2b-256 8f02184d55be8325344b91cda8985268e89b7a773a54167e4d64147e94ee7c96

See more details on using hashes here.

File details

Details for the file lowhaio_aws_sigv4_unsigned_payload-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: lowhaio_aws_sigv4_unsigned_payload-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.22.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for lowhaio_aws_sigv4_unsigned_payload-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 93b8f92166bbc626402d376f3455a25ebdbf78ba3534dbf55a17cb98342a6e54
MD5 8b3b918b82edfa6a4c5c71e748010df1
BLAKE2b-256 7904683f65f17c43a96efec6154356633048db5a41268e9f39d5b00e9d3a2c75

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page