OpenStack Identity (Keystone) Client
Go to file
Tobias Diaz a0c67b860b Only log application/json content type
This is a combination of 2 commits. The first commit's
message is:

Prevent MemoryError when logging response bodies

Response bodies are loaded into memory prior to
being logged.

Loading huge response bodies may result in a
MemoryError.

This patch proposes that only JSON and TEXT
responses be logged, i.e when the Content-Type
header is application/json or application/text.

Responses that do not include or have a different
Content-Type header will have their body omitted.

This is a sort of backport of the fix for
keystoneauth sessions, see
I93b6fff73368c4f58bdebf8566c4948b50980cee

Co-Authored-By: Samuel de Medeiros Queiroz <samueldmq@gmail.com>

Closes-bug: 1616105

Change-Id: I8f43eee3a0b35041c6cf672e476f8151cf2f8d14
(cherry-picked from: 3e56e0d7e5)

Only log application/json in session to start

When whitelisting content types to debug print from session we chose
application/json and application/text. application/text is not a real
mime type, text is typically text/plain.

Rather than guess at mime types only print application/json to start
with, but make it easy for additional types to be added later.

Adapted from keystoneauth: Ica5fee076cdab8b1d5167161d28af7313fad9477
Related-Bug: 1616105

Change-Id: Ieaa8fb3ea8d25e09b89498f23b70b18c0f6153f1
(cherry-picked from: 51d16fa344)
2017-01-11 05:10:06 +00:00
doc Fix for the deprecated library function 2016-01-05 23:00:38 +05:30
examples/pki Remove keystoneclient.middleware 2015-12-11 02:00:30 -05:00
keystoneclient Only log application/json content type 2017-01-11 05:10:06 +00:00
releasenotes Only log application/json content type 2017-01-11 05:10:06 +00:00
tools remove venv bits from tools 2015-12-15 17:40:30 -05:00
.coveragerc Change ignore-errors to ignore_errors 2015-09-21 14:53:26 +00:00
.gitignore Add release notes for keystoneclient 2015-11-29 20:02:58 -05:00
.gitreview Update .gitreview for stable/mitaka 2016-03-09 13:26:13 -05:00
.mailmap Add mailmap entry 2014-05-07 12:12:43 -07:00
.testr.conf Create functional test base 2015-02-13 17:55:34 +11:00
CONTRIBUTING.rst Workflow documentation is now in infra-manual 2015-02-05 17:56:32 +00:00
HACKING.rst Make HACKING.rst DRYer and turn into rst file 2013-11-11 11:05:00 -08:00
LICENSE Initial commit. 2011-10-25 16:50:08 -07:00
README.rst Add shields.io version/downloads links/badges into README.rst 2015-09-25 00:13:51 -04:00
babel.cfg enabling i18n with Babel 2012-09-29 16:03:23 -07:00
bandit.yaml Bandit profile updates 2016-01-27 15:50:54 -06:00
openstack-common.conf remove venv bits from tools 2015-12-15 17:40:30 -05:00
other-requirements.txt List system dependencies for running common tests 2016-06-30 08:45:00 +02:00
requirements.txt Updated from global requirements 2016-02-26 01:53:07 +00:00
setup.cfg Update translation setup 2016-01-28 14:12:39 +00:00
setup.py Updated from global requirements 2015-09-17 12:16:43 +00:00
test-requirements.txt Updated from global requirements 2016-04-18 15:06:35 +00:00
tox.ini List system dependencies for running common tests 2016-06-30 08:45:00 +02:00

README.rst

Python bindings to the OpenStack Identity API (Keystone)

Latest Version

Downloads

This is a client for the OpenStack Identity API, implemented by the Keystone team; it contains a Python API (the keystoneclient module) for OpenStack's Identity Service. For command line interface support, use OpenStackClient.

Contents:

Python API

By way of a quick-start:

# use v2.0 auth with http://example.com:5000/v2.0
>>> from keystoneclient.v2_0 import client
>>> keystone = client.Client(username=USERNAME, password=PASSWORD, tenant_name=TENANT, auth_url=AUTH_URL)
>>> keystone.tenants.list()
>>> tenant = keystone.tenants.create(tenant_name="test", description="My new tenant!", enabled=True)
>>> tenant.delete()