Chef Authentication protocol support for Python-Requests
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file requests-chef-0.1.7.tar.gz
.
File metadata
- Download URL: requests-chef-0.1.7.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9387680a8c99421f711f4f1e434c4ee2e39aec3b63bad85dd9d2c477533973fc |
|
MD5 | 9a7175e83c308d812f373cdb5c802d92 |
|
BLAKE2b-256 | e977103d1baca956bb167b541c2abf7520fafc1582206bd5bbfb9dbd60d9fedf |
File details
Details for the file requests_chef-0.1.7-py2.py3-none-any.whl
.
File metadata
- Download URL: requests_chef-0.1.7-py2.py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 541ddf212539898390fd619100cedd3132e4126261a96a08e80655850c173ce6 |
|
MD5 | edca1c828fce24b2670f5d8e72f7ae25 |
|
BLAKE2b-256 | 06000a8705f28e59adbacd5b53c23ce496122aa2a0c1d37233d7306e2245f32b |