Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apysigner

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apysigner

Basic API request signing

  • 4.0.0
  • PyPI
  • Socket score

Maintainers
1

A simple API request signer

A very simple library to help generate signed requests.

INSTALLATION

::

pip install apysigner

USAGE

For a GET request

::

>>> import apysigner
>>> private_key = 'UHJpdmF0ZSBLZXk='
>>> url = 'http://www.example.com/api-endpoint?q=find+my+thing'
>>> apysigner.get_signature(private_key, url)
'zMxf77eY-xuORInBIA0azhxHPg2bzhsjz-huP-OuYKk='

For a POST request

::

>>> import apysigner
>>> private_key = 'UHJpdmF0ZSBLZXk='
>>> payload = {'do': 'something', 'name': 'Johnny'}
>>> url = 'http://www.example.com/api-endpoint'
>>> apysigner.get_signature(private_key, url, payload)
'CFNmvPrjW_Z1x5XO-tQzJzhs6GjeJH0k0SxOuuhJ3YA='

Just the basics to create the HMAC signature. You'll need combine this with other things like actually adding the signature on the URL and making the request, but those responsibilities intentionally live elsewhere.

See the django-request-signer project for examples if you need the rest.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc