Chef Authentication protocol support for Python-Requests
Project description
Chef auth support for Python-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 <https://github.com/samstav/okchef>`__ uses `requests-chef <https://github.com/samstav/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
File details
Details for the file requests-chef-0.1.2.tar.gz
.
File metadata
- Download URL: requests-chef-0.1.2.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aee7068cbdf50400c3921d92ff996da49af3784a4fa4282c7d4595bc159f8784 |
|
MD5 | c07fa856ad615379d99b46e1cd9f3dff |
|
BLAKE2b-256 | 2145d0f05e6d12cb430082399e72800d072ca52f2dbcf1648ca8c52b9b7ea25f |