Skip to main content

Chef Authentication protocol support for Python-Requests

Project description

latest Circle CI Coverage Status Requirements Status

Chef auth support for Python-Requests


import requests
import requests_chef

auth = requests_chef.ChefAuth('chef-user', '~/chef-user.pem')
response = requests.get('https://api.chef.io/users/chef-user',
                        headers={'X-Chef-Version': '12.0.2'},
                        auth=auth)
response.json()
...
{'display_name': 'chef-user',
 'email': 'chef-user@example.com',
 'first_name': 'Chef',
 'last_name': 'User',
 'middle_name': '',
 'public_key': '-----BEGIN PUBLIC KEY-----\nMIIBIj...IDAQAB\n-----END PUBLIC KEY-----\n',
 'username': 'chef-user'}

See samstav/okchef first, since thats generally more useful. okchef uses requests-chef to sign and authenticate requests.

Install

This project currently requires a fork of pyca/cryptography due to the following related issues:

Instructions

First, install this fork of cryptography directly from github.

$ pip install git+https://github.com/samstav/cryptography.git@rsa-bypass-hash-on-signer

If you don’t do this first, you’d have to use the (deprecated, scheduled for removal) --process-dependency-links option through pip, since pip no longer respects dependency links by default (as of pip 1.5).

$ pip install --process-dependency-links requests-chef

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

requests-chef-0.1.6.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

requests_chef-0.1.6-py2.py3-none-any.whl (8.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file requests-chef-0.1.6.tar.gz.

File metadata

File hashes

Hashes for requests-chef-0.1.6.tar.gz
Algorithm Hash digest
SHA256 8c41131a4faf91cf6d398438e1df72a3dedf1a8257fac2aa1fd0da981e18b205
MD5 d6883ca50ad8388697ba2cc5286a4afc
BLAKE2b-256 a83c97ae6972f6fbed92f40e7b041632373b92917978eb1e3c59872ecafe4ad2

See more details on using hashes here.

File details

Details for the file requests_chef-0.1.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for requests_chef-0.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 22efb1e732c0d16ac0db8aa79153a2e0e271358864b1b7cadeff562f1a259ed8
MD5 a666bd5c4c68560d7133bca9b81c1504
BLAKE2b-256 669a68f9c562082dbd7fd1c8503c80bd9bfe2f0ab314cc72652834bec97fc5af

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