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.9

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.9
File Size Uploaded
k3awssign-0.1.9.tar.gz 16.8 kB Details

Built distribution (wheel)

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

Total release size: 26.4 kB

Release files / k3awssign-0.1.9.tar.gz

Download URL k3awssign-0.1.9.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b3a8878a29d4c928a98872cd68051687eee3d56dcfe36f29534f051916f0a404
BLAKE2b-256 checksum
How to use checksums
dc5e08d28b62b570d9baf35734d6685707257f052e7e5e00256dbb361d2e8638
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.9-py3-none-any.whl

Download URL k3awssign-0.1.9-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9ff2355a884e0669c722761ecc6e31007649d92a66f2d27cf330865712e1eb3
BLAKE2b-256 checksum
How to use checksums
70067f81eae8b5a7a3fd159fe0a5f3a4bcafd106300cfc4639ff6578fd7bc657
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

This release

0.1.9 This release

2 release files

0.1.8

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