A Twisted Agent implementation which authenticates to Keystone and uses the Keystone auth credentials to authenticate against requested urls.
Project description
# Twisted Python Keystone Agent
[![Build Status](https://secure.travis-ci.org/racker/python-twisted-keystone-agent.png)](http://travis-ci.org/racker/python-twisted-keystone-agent)
## Example Usage
```python
from twisted.internet import reactor
from twisted.web.client import Agent
from txKeystone import KeystoneAgent
agent = Agent(reactor)
RACKSPACE_USERNAME = '' # your username here
RACKSPACE_APIKEY = '' # your API key here
AUTH_URL = 'https://identity.api.rackspacecloud.com/v2.0/tokens'
keystone_agent = KeystoneAgent(agent,
AUTH_URL,
(RACKSPACE_USERNAME, RACKSPACE_APIKEY))
```
`keystone_agent` can now be used like a [twisted.web.client.Agent](http://twistedmatrix.com/documents/current/web/howto/client.html)
(see "[Receiving Responses](http://twistedmatrix.com/documents/current/web/howto/client.html#auto4)")
to make requests to Rackspace APIs, and the `X-Tenant-Id` and `X-Auth-Token` headers will be set automatically.
[![Build Status](https://secure.travis-ci.org/racker/python-twisted-keystone-agent.png)](http://travis-ci.org/racker/python-twisted-keystone-agent)
## Example Usage
```python
from twisted.internet import reactor
from twisted.web.client import Agent
from txKeystone import KeystoneAgent
agent = Agent(reactor)
RACKSPACE_USERNAME = '' # your username here
RACKSPACE_APIKEY = '' # your API key here
AUTH_URL = 'https://identity.api.rackspacecloud.com/v2.0/tokens'
keystone_agent = KeystoneAgent(agent,
AUTH_URL,
(RACKSPACE_USERNAME, RACKSPACE_APIKEY))
```
`keystone_agent` can now be used like a [twisted.web.client.Agent](http://twistedmatrix.com/documents/current/web/howto/client.html)
(see "[Receiving Responses](http://twistedmatrix.com/documents/current/web/howto/client.html#auto4)")
to make requests to Rackspace APIs, and the `X-Tenant-Id` and `X-Auth-Token` headers will be set automatically.
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
txKeystone-0.1.2.tar.gz
(11.4 kB
view details)
File details
Details for the file txKeystone-0.1.2.tar.gz
.
File metadata
- Download URL: txKeystone-0.1.2.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f5d1c5d0f5aaf778e6667e3d3ce9fd32a53f74a3528eec1929e1d495aacd4b3 |
|
MD5 | 0743245e13822f52880269284ba321f6 |
|
BLAKE2b-256 | c50f8c1ae07bf3d7d652ca32bd5d09d2c7dbf7ea9b0899bb2427cfa4b2bb8912 |