This repo was created by accident, use deb-python-oslo.context
instead.
Needed-By: I1ac1a06931c8b6dd7c2e73620a0302c29e605f03
Change-Id: I81894aea69b9d09b0977039623c26781093a397a
Now that there is a passing gate job, we can claim support for
Python 3.5 in the classifier. This patch also adds the convenience
py35 venv.
Change-Id: I800ad84596d1ff25686516fcf84184ce185cc77a
The oslo.middleware request_id middleware that is used by most services
sets the request_id into the environment at 'openstack.request_id'. Pick
this value up into the context object if it is present in the
environment.
Change-Id: Iae3799f4c5ad799961a4a6b01d2b77fd97e72be3
is_admin_project is provided by keystonemiddleware and used by
oslo.policy to enforce that a project scoped token exists in the admin
project.
To make this usable we add the ability to read the X-Is-Admin-Project
header from the environment, and add it to the outputted policy values.
Note the value is added to keystonemiddleware in the depend review
however it must work even with older auth_token middlewares so is fine
to merge prior to a middleware release.
Closes-Bug: #1577996
Depends-On: Ic680e6eaa683926914cf4b2152ec3bb67c6601ff
Change-Id: Ie48fedb8092e33e9645a37ea3fe44b88d34ad3b8
If somehow whitespace gets into the roles coming from headers we should
remove it and only save the actual role name. This is not possible
coming from auth_token middleware but is tested by some services and is
simple to support here.
Change-Id: I11ac3959d8f8b233c8785671d7a59263a4dc36df
from_environ only supported the current environ variables from
auth_token middleware as these have been in use for a long time. It
turns out particularly in testing that services may still use the
deprecated headers so we should still support those in oslo.context.
Change-Id: Ia7faf7b657525c11f728ac753422efe87f6ac34f
When we compose a string for user_identity, we should
ensure that we don't break for non-ascii strings in
user name or tenant name or domain names.
Change-Id: Id457ebe415f78c435fc8ece810f0a1b20964dabf
Closes-Bug: #1507937
Currently all the services pass there own dictionary to the oslo.policy
enforcement engine. This means that there is no standard policy language
between services.
Create a dictionary with the standard credential items that may be
required in policy enforcement. This method will need to be overriden
from individual services for backwards compatibility for some time.
Change-Id: I7bc31764e79eb61f602c7b8601149ac75bee9f9f
Closes-Bug: #1537653
This reverts commit 01aaeae060.
This causes test failures with oslo.log change
Ica445ad5dfe9bd27dfcf1b1bcb6401a0bc9496a5 when passing these attributes
to a log message and a context object. The result of setting these in
context causes log.record values to be overridden with blank values.
Catering for this condition causes subsequent mismatches for test
conditions mixing context and optional passing additional attributes
to log.
Change-Id: I5450e105dc914f822a2b4c03b759a682d8b4a3e7
Roles are an important part of the user context. They typically don't
need to be serialized for RPC but they are needed for policy. Include
roles onto the context object and make sure it is loaded from the
auth_token middleware environment.
Related-Bug: #1537653
Change-Id: Ia575ba803a0fb70f39146bd75d381ed19414bd23
Replace the existing argument specified values in from_dict() method
to be argument agnostic for any future arguments. Based from version
found in Solum.
All current boolean values match instantiation defaults.
Change-Id: I17c76881aa662de7ff245b3f6bfca309896ddf24
Add to get_logging_values() attributes that used in format string parameters
and that can cause an exception when the are not defined.
This is being refactored from the oslo.log formatter functionality.
Change-Id: I7108a51bea01db6ccd9b6b24afc7b8d92b8eeda7
Implements: blueprint app-agnostic-logging-parameters
This initial review defines a new method that will be used to define
and extend context attributes specifically useful in logging.
This enables other uses of the RequestContext to use the existing to_dict()
method.
This placholder is also needed for cross project dependencies with oslo.log.
Change-Id: I963a6db4aef74f7348e75a642e2e195cedacecaa
Implements: blueprint app-agnostic-logging-parameters
These tests are to cover existing class functionality before
modifications of app agnostic parameters and changes in Oslo Log.
Change-Id: I0b041746865e4da5d2c73ce6093f96bd48760e24
generate_request_id() was previously modified by the change
I389cf20e4c999c9bb576a42388497852f8ba27ec to return a bytes string
instead of a text string. According to the author of the change, it
was a mistake (the right fix is to update the unit test, not modify
the tested function).
Having a request_id as a byte string is not convenient on Python 3.
For example, it's a bug to write '"id:%s" % request_id', a
BytesWarning exception is raised when python3 is run with -bb command
line option. It not possible to write str+bytes neither.
Right now, oslo_log emits logs with b'...' which is unexpected. I
prefer to fix the issue in oslo_context rather than working around
the issue in oslo_log. Example of log emitted on Python 3:
"WARNING glance.api.v2.tasks [b'req-83a6...' 54492... - - -] ..."
This change depends on changes in Glance, Neutron and oslo.middleware
which prepares unit tests to support bytes and str request_id. So
their unit tests will work on the old and new versions of
oslo.context. Changes on unit tests are required for the master
branch but also Liberty because their python34 check job is voting on
Liberty and master.
This change depends on the following changes:
* change Ia8578ecab1b1f1bf21020c91290458efad646cd9
* change Ia5203581db120bb4f8e24fd752d6ae14e6558505
* change I872c268ef5f17dc2c1fe0ce8aa7e8af4ebc1d757
* change Ia4df8f05d5746887eb99bbf368d29e8d30a3a90a
Closes-Bug: #1526662
Change-Id: If48ee7f4d1c113f1f26b3b1698c6b055807b950f
The intention here is to provide better integration between what
oslo.context expects and what keystonemiddleware provides. As auth_token
middleware changes each service has to react independently to the new
options and the way they build contexts.
By providing a helper here we can improve the consistency across
services to standardize the options and provide a common way to react to
auth_token middleware improvements.
Change-Id: Ic590b3ee359e9a9c27eef3d11c0738066f475881
The user, tenant and similar values are ambiguous. Most contexts that
subclass oslo.context already provide some version of this and use the
_id attributes anyway.
Ideally we would deprecate these values in future but for now just
provide the alias.
Change-Id: Ia59bf69eaa83be1904abe835bfee68b785c92c54
Everything in this file is automatically generated by pbr. There
appears to be no good reason to keep it around.
Change-Id: I7cbc66a5c4fc472ffbb7b11fbf94dd9fe3c1639c
* Remove support for python 2.6
* Remove skipsdist : Needs to be set only if
sdist is expensive
* Remove usedevelop : only needed when skipsdist
is set to True
* Remove install_command : We can just use the
default, we don't need to override
* Remove setenv : We can just use the default as
we don't need any extra environment variables
* Remove requirements.txt from deps, as this is
already added automatically
Change-Id: Ibceadc1d9f315044121e904f97e53aafec3b7cfa
is_user_context refers to a user_id and project_id attribute in
the context object which are not defined in this base class.
Change-Id: I2ac6d4a7d31d026e6fedcba80c4a760dcac747e8
Closes-Bug: 1508217