We now expect context objects to support returning a redacted copy of
themselves.
As a related cleanup, removed the practice entirely of using
dictionaries to represent contexts in unit tests and the logging driver.
As part of developing this change, I discovered code in Glance (and
potentially other services) which explicitly pass {} in lieu of a
context when notifying; so we now properly handle dictionaries as
contexts.
To ensure we have the method required; require oslo.context 5.3.0 or
newer.
Change-Id: I894f38cc83c98d3e8d48b59864c0c7c2d27e7dcd
We encountered bug 2037312 in unit tests when attempting to get this
change rolled out. Heat apparently will attempt to set is_admin using
policy logic if it's not passed in for a new context; this breaks as the
context we are requested doesn't have all the needed information to
exercise the policy logic.
is_admin is just a bool; it's not sensitive; easiest route forward is to
add it to the safe list
Closes-bug: 2037312
Change-Id: I78b08edfcb8115cddd7de9c6c788c0a57c8218a8
Publishing a fully hydrated context object in a notification would give
someone with access to that notification the ability to impersonate the
original actor through inclusion of sensitive fields.
Now, instead, we pare down the context object to the bare minimum before
passing it for serialization in notification workflows.
Related-bug: 2030976
Change-Id: Ic94323658c89df1c1ff32f511ca23502317d0f00
Remove six, the python 2/3 compatibility library. It's not needed
anymore since the repo is python3 only.
Remove a now unneeded hacking test.
Change-Id: I40522c4accb4aaf8115d11fee8b081e2d991cb4d
Log messages are no longer being translated. This removes all use of
the _LE, _LI, and _LW translation markers to simplify logging and to
avoid confusion with new contributions.
Change-Id: I9ddb6595fc52e46ed8844e39d2fa71029c90b65c
Closes-Bug: #1674567
To facilitate removing rpc_backend support, disentangle the aliases
code by removing it to simplify the code and the tests. Aliases were
first depreacted in 5.20.0 during Pike.
Change-Id: I7d80cd050ce1eca2c6b6c38f0fac29d090b90bf3
Closes-Bug: #1424728
Since RPC and notifications can have different backends, it is
useful to warn users if they use a notification transport in RPC
and vice versa. This patch introduces RPCTransport and
NotificationTransport subclasses of Transport, so it's easier to
add different behavior for them if need be.
Related-Bug: #1680192
Change-Id: Iab60544d69053c8e74c28a2d5c84665be749013f
Be specific regarding which characters can be used in the 'username'
and 'password' fields of the URL.
Change-Id: I9a2a801b3dd86fceffb05f4d52c715748c88d0cb
Closes-Bug: #1693967
The get_rpc_transport wraps get_transport to unify the API in
anticipation of comprehensive separation of RPC and Notification
messaging backends.
Related-Bug: 1680192
Change-Id: Ic6af07b98ff43806c2af38a3ba129991f1e0ec86
When the underlying RPC is configured with rabbit along
with oslo_messaging_notifications, currently the retry is
not supported. There are retry support specific to drivers,
it's better to have the support uniform across the drivers,
by adding configuration retry on the oslo_messaging_notifier.
Closes-bug: 1666364
Change-Id: I8d547ef2a9e8b086f94a1efca17735f3f3cdaac1
Generating the payload of a notificatiton might be expensive due
to database access. This expensive step is unnecessary if the
notification driver is set to noop because it means that the
generated payload will not be sent.
This patch makes it possible for the user of the notifier to check
if the notifier will emit any notification before the payload
is generated.
Cinder already implemented similar behavior in
I77f655d3ef90088ce71304da5d4ea7b543991e90 and nova also plans
to do it in I3e6741d59df49e1e58409314008c2ed609fdedc1
Change-Id: Ib992f5c20fef85224fb00823e1d8d9c6cff19bec
Rework the inline documentation for executors, RPC servers and
clients, notifiers and notification listeners for clarity and flow.
Change-Id: If4f1db853a7fc85340177fd2c9c43a479d72459d
This was previously undocumented. Most of the information was taken from the
docstring for get_transport
Change-Id: I92652f4de9dd1e59ae5c3f9ce39e5ee808f24c7d
The transport_url may contain credentials to the message queue; For
this reason, this option should be secret for it to not leak into the
logs.
Closes-Bug: #1567233
Change-Id: I49c641a2662976d7220e4222e3c4a4d2586b1336
Looks like there is a disconnect between the __init__
parameter 'topic' in Notifier and what we need when
we look up a driver. We should allow multiple topics
to be specified as a new topics parameter and pass
that along directly.
Change-Id: Id89957411aa219cff92fafec2f448c81cb57b3ca
1. Use translation marker functions, their argument must just be a string
2. Any message with more than one variable should use named
interpolation instead of positional to allow translators
to move the variables around in the string to account for
differences in grammar and writing direction.
3. String interpolation should be delayed to be handled by the logging
code, rather than being done at the point of the logging call.
For more details, please refert to oslo.i18n guideline [1]
Note: this commit doesn't touch test code.
[1] http://docs.openstack.org/developer/oslo.i18n/guidelines.html
Change-Id: I5f013d65b20396bbe0e5a2cceaed2a33fad1af23
In change Ief6f95ea906bfd95b3218a930c9db5d8a764beb9, we
decoupled RPC and Notifications a bit. We should take another
step and separate out the options for notifications into
its own group.
Change-Id: Ib51e2839f9035d0cc0e3f459939d9f9003a8c810
Add a new configuration option for setting up
an alternate notification_transport_url that
can be used for notifications. This allows
operators to separate the transport mechanisms
used for RPC and Notifications.
DocImpact
Closes-Bug: #1504622
Change-Id: Ief6f95ea906bfd95b3218a930c9db5d8a764beb9
Our class hierarchy hides classes and modules that so its hard
for folks to write a custom Notification driver. We should
make these public and document them
Closes-Bug: #1426046
Change-Id: Ifb96c2ae9868426cac2700bf4917c27c02c90b15
Move the public API out of oslo.messaging to oslo_messaging. Retain
the ability to import from the old namespace package for backwards
compatibility for this release cycle.
bp/drop-namespace-packages
Co-authored-by: Mehdi Abaakouk <mehdi.abaakouk@enovance.com>
Change-Id: Ia562010c152a214f1c0fed767c82022c7c2c52e7