keystone/releasenotes/notes/bug-1813085-cf24b204e95fd7f5.yaml
Lance Bragstad af3aef940c Handle special cases with msgpack and python3
We attempt to be clever about string types in the token formatters.
We do this because in some cases, not all items in a token payload
are serialized to byte strings. To add flexibility for this, we use
tuples with a boolean value that denotes if the accompanying value is
a byte string or not. This helps us safely re-inflate the value from
a byte string back to it's .hex representations, typically with UUID
strings.

With python3, we actually hit an interesting case where what we pass
into the token payload doesn't actually maintain that state due to the
usage of msgpack. The msgpack library returns byte strings even though
the initial value may not have been a byte string. This breaks the
logic we have for the associated boolean value because the string type
changes and the boolean does not.

This commit adds a couple of if/statements to detect if we running on
python3 and if the boolean mismatches the actual value type. Then, it
attempts to do the right thing by decoding the string.

We should think about how we want to do this, or if there is a better
way.

Change-Id: Iaecd45ef985cbf5ff4a6a724df96c1304a927247
Closes-Bug: 1813085
2019-01-28 15:09:57 +00:00

8 lines
295 B
YAML

---
fixes:
- |
[`bug 1813085 <https://bugs.launchpad.net/keystone/+bug/1813085>`]
Validation of federated domain-scoped tokens scoped to the ``default``
domain no longer results in an ``HTTP 404 Domain Not Found`` due
to byte string conversion issues with msgpack in python 3.