Skip to main content

k3awssign

Action-CI Documentation Status Package

A python lib is used for adding aws version 4 signature to request.

k3awssign is a component of pykit3 project: a python3 toolkit set.

This lib is used to sign a request using aws signature version 4. You need to provide a python dict which represent your request(it typically contains verb, uri, args, headers, body), and your access key and your secret key. This lib will add signature to the request.

Install

pip install k3awssign

Synopsis

import httplib

import k3awssign

access_key = "your access key"
secret_key = "your secret key"

signer = k3awssign.Signer(access_key, secret_key)

file_content = "bla bla"
request = {
    "verb": "PUT",
    "uri": "/test-bucket/test-key",
    "args": {
        "foo2": "bar2",
        "foo1": True,
        "foo3": ["bar3", True],
    },
    "headers": {
        "Host": "bscstorage.com",
        "Content-Length": len(file_content),
    },
    "body": file_content,
}

signer.add_auth(request, sign_payload=True)

conn = httplib.HTTPConnection("ss.bscstorage.com")
conn.request(request["verb"], request["uri"], request["body"], request["headers"])
resp = conn.getresponse()

Author

Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Copyright and License

The MIT License (MIT)

Copyright (c) 2015 Zhang Yanpo (张炎泼) drdr.xp@gmail.com

Metadata

Release files for k3awssign 0.1.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for k3awssign 0.1.8
File Size Uploaded
k3awssign-0.1.8.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for k3awssign 0.1.8
File Interpreter ABI Platform
k3awssign-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 25.9 kB

Release files / k3awssign-0.1.8.tar.gz

Download URL k3awssign-0.1.8.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ad6e37b2392f040ec3756326f9311d8b9b502cb2a91738e52ad8d9001ac9c39c
BLAKE2b-256 checksum
How to use checksums
cab44f28d43729053fe3b1057c07880acaae52bd63e820f9f5464c62a9aca7f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / k3awssign-0.1.8-py3-none-any.whl

Download URL k3awssign-0.1.8-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bede79b19149bf3a3779335991cf68bcb791a3ae33497caed85ad925213ca93c
BLAKE2b-256 checksum
How to use checksums
cc0d498889f11599d8400941fd094b807cfc3ede2c94a00d63a1da8ac92b65de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release history Release notifications | RSS feed

0.1.9

2 release files

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page