Where doeas secret_dto.secret come from?

barbican/plugin/resources.py
----------------------------
from barbican.plugin.util import translations as tr

def store_secret(unencrypted_raw, content_type_raw, content_encoding,
                 secret_model, project_model,
                 transport_key_needed=False,
                 transport_key_id=None):
  ...
  unencrypted, content_type = tr.normalize_before_encryption(
      unencrypted_raw, content_type_raw, content_encoding,
      secret_model.secret_type, enforce_text_only=True)
  ...
  secret_dto = secret_store.SecretDTO(type=secret_model.secret_type,
                                      secret=unencrypted,
                                      key_spec=key_spec,
                                      content_type=content_type,
                                      transport_key=transport_key)

so secret_dto.secret = unencrypted which is set in
tr.normalize_before_encryption

barbican/plugin/util/translations.py
------------------------------------
normalize_before_encryption is defined here:

https://github.com/openstack/barbican/blob/7.0.0/barbican/plugin/util/translations.py#L25

It returns:

    return b64payload, normalized_media_type

It seems that b64payload may not be correctly getting encoded for py3.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1799746

Title:
  PY3: when uploading file as secret: TypeError: a bytes-like object is
  required, not 'str'

To manage notifications about this bug go to:
https://bugs.launchpad.net/castellan/+bug/1799746/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to