Which get_encoded() is getting called?

In barbican's store_secret() this line is called:

    opaque_data.OpaqueData(secret_dto.secret)

castellan/common/objects/opaque_data.py
---------------------------------------
class OpaqueData(managed_object.ManagedObject):
    """This class represents opaque data."""

    def __init__(self, data, name=None, created=None, id=None):
        """Create a new OpaqueData object.

        Expected type for data is a bytestring.
        """
        self._data = data
        super(OpaqueData, self).__init__(name=name, created=created, id=id)

    @property
    def format(self):
        """This method returns 'Opaque'."""
        return "Opaque"

    def get_encoded(self):
        """Returns the data in its original format."""
        return self._data

Ok OpaqueData.__init__() expects a bytestring for data so appears it
should already be encoded when the object is initialized and
get_encoded() should just return the already encoded string.

-- 
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