openstacksdk/openstack/tests/unit/key_manager
Pavlo Shchelokovskyy 2692290776 Return payload as text only for text/plain secrets
currently SDK always returns Response.text for secret payload,
which is problematic for pure binary secrets,
as the value returned is decoded as whatever encoding
`chardet` lib has detected on this random binary data.

This makes SDK basically unusable for retreving and using binary
secrets, as one can not make any educated guess using only sdk-provided
data on what encoding to use to get the payload as raw bytes.

Instead, do what barbicanclient does, and return raw bytes
(Response.content) for everything but content type "text/plain",
for which decode those bytes to UTF-8.

This will also make it easier to transition from barbicanclient to
openstacksdk if needed.

Change-Id: I0e5ac1288c0d0423fa3a7a4e63173675b78aae79
2024-09-13 09:59:25 +01:00
..
v1 Return payload as text only for text/plain secrets 2024-09-13 09:59:25 +01:00
__init__.py Rename key_management to key_manager 2015-12-15 12:15:51 -06:00