OpenStack Identity Authentication Library
Go to file
Eric Fried df57e0ec3b Add a per-request global_request_id
Adapter.__init__ takes a global_request_id which causes the
X-Openstack-Request-Id header to be set on each request. This is fine if
the Adapter is used for only one "request" (in the sense of e.g. "a
server create" -- see [1]), but is too broad if the Adapter is reused
for multiple requests. For example, Nova's SchedulerReportClient (used
to communicate with Placement) creates a single instance of Adapter for
the life of the process [2][3][4]. Openstack SDK's Proxy objects [5]
endure for the life of a Connection.

So what is needed is a way to manage the X-Openstack-Request-Id header
on a per-request basis.

This commit adds a global_request_id kwarg to
keystoneauth1.session.Session.request, which is the funnel point for all
requests coming through Adapter as well as Session itself. (All the
methods feeding into that one already accept and pass through arbitrary
**kwargs.) If present, the value in the X-Openstack-Request-Id header is
set accordingly. Note that this will *override*
Adapter.global_request_id, which is exactly what we want, as described
above.

[1] http://specs.openstack.org/openstack/oslo-specs/specs/pike/global-req-id.html
[2] bea9058f02/nova/scheduler/client/report.py (L200)
[3] bea9058f02/nova/scheduler/client/report.py (L243)
[4] bea9058f02/nova/utils.py (L1219-L1221)
[5] bf6651f149/openstack/proxy.py (L114)

Change-Id: Ied73320fcd813ae796e40cbdb30717900486b92c
2019-07-11 10:35:44 -05:00
doc Merge "Replace git.openstack.org URLs with opendev.org URLs" 2019-05-29 18:45:09 +00:00
keystoneauth1 Add a per-request global_request_id 2019-07-11 10:35:44 -05:00
releasenotes Merge "Limit interval between retries to 1 minute" 2019-06-21 19:55:04 +00:00
.coveragerc Update coverage to keystoneauth1 2015-12-09 11:46:00 +11:00
.gitignore Migrate to stestr 2017-09-20 15:47:15 -05:00
.gitreview OpenDev Migration Patch 2019-04-19 19:39:37 +00:00
.mailmap Add mailmap entry 2014-05-07 12:12:43 -07:00
.stestr.conf Migrate to stestr 2017-09-20 15:47:15 -05:00
.zuul.yaml Add Python 3 Train unit tests 2019-06-26 18:44:23 -04:00
bindep.txt add lower-constraints job 2018-04-19 09:54:28 +02:00
CONTRIBUTING.rst Use https for *.openstack.org references 2017-02-06 13:45:24 -08:00
HACKING.rst Migrate to stestr 2017-09-20 15:47:15 -05:00
LICENSE Initial Split of python-keystoneclient to keystoneauth 2015-04-20 14:49:59 -07:00
lower-constraints.txt Remove os-testr from requirements 2018-09-05 13:04:16 +02:00
README.rst Replace git.openstack.org URLs with opendev.org URLs 2019-05-29 02:30:15 +00:00
requirements.txt Implement service_type alias lookups 2018-05-03 15:28:50 -05:00
setup.cfg Drop py35 jobs 2019-03-01 11:32:50 +01:00
setup.py Updated from global requirements 2017-03-08 22:46:11 +00:00
test-requirements.txt Cap bandit 2019-06-19 09:35:49 -07:00
tox.ini Add Python 3 Train unit tests 2019-06-26 18:44:23 -04:00

Team and repository tags

image

keystoneauth

Latest Version

Downloads

This package contains tools for authenticating to an OpenStack-based cloud. These tools include:

  • Authentication plugins (password, token, and federation based)
  • Discovery mechanisms to determine API version support
  • A session that is used to maintain client settings across requests (based on the requests Python library)

Further information: