Skip to main content

Shared-Secret Requests: A simple HTTP authentication library using shared secrets.

Project description

Shared-Secret Requests (SSR)

CircleCI

codecov

A simple HTTP authentication library using shared secrets.

Overview

The ssr library exposes a simple set of interfaces that facilitate server-server authentication using a shared secret. This shared secret or secret_key is used to generate a public key, using a client id and timestamp. The combination of the client id, timestamp and public key form a signature that a host server can use to verify the identity of the client server. ssr provides 3 intefaces to support that authentication workflow:

  1. ssr.Client - to help generate a public key from a shared secret key.
  2. ssr.Session - exends the requests library Session class to expose an ssr.Client and patch requests with the appropriate headers to correcly interface with ssr.BaseAuthentication
  3. ssr.BaseAuthentication - to help hosts validate requests from clients that have the same shared secret.

Scope

The scope of this project is limited to server-server authentication e.g. to support RESTful data transfer between micro-services. Logistics around managing secrets is not included in the scope of this project. For tools to manage secrets you can look into:

Installation

pip install ssr

Usage

SSR Client

TBD

Requests Session

import ssr

session = ssr.Session(
    secret_key=os.environ.get('APP_SECRET_KEY')
)

response = session.get(
    'https://myblog.com/api/post_reports/',
    params={'q': 'auth'}
)

Base Authentication

TBD

TODO

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

ssr-0.1.1.tar.gz (10.7 kB view details)

Uploaded Source

File details

Details for the file ssr-0.1.1.tar.gz.

File metadata

  • Download URL: ssr-0.1.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ssr-0.1.1.tar.gz
Algorithm Hash digest
SHA256 51b049c7af330912ecea6d4ac91aea10c3793e9a032a29e2fb238823ecf6ca23
MD5 940b3eed2f1373569b0e8bc987a53292
BLAKE2b-256 7e06722e3990183ca0c3af78b94bbcff2d9f44ecd1b07e4efa5399ce5ff25b89

See more details on using hashes here.

Supported by

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