get_secret and delete_secret in key_manager always fail with 404
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack SDK |
New
|
Undecided
|
Douglas Mendizábal |
Bug Description
The key_manager methods to retrieve a secret, and to delete a secret always fail with 404 for existing secrets. Consider the following sample code:
from openstack import profile
from openstack import connection
prof = profile.Profile()
prof.
conn = connection.
my_secret = conn.key_
# my_secret has been successfully created in the service at this point
retrieved_
conn.
The expected behavior is that get_secret and delete_secret should succeed since the secret is successfully created with create_secret.
Changed in python-openstacksdk: | |
assignee: | nobody → Douglas Mendizábal (dougmendizabal) |
I dug around the source tree for a bit, and these failures are due to an error when preparing the URL used in the GET /v1/secrets/UUID and DELETE /v1/secrets/UUID requests. Since Barbican objects don't have an 'id' property, the current implementation uses a workaround that sets a new 'secret_id' property on the Secret class that is set to be an alternate_id.
However, there is a subtle detail in the logic that uses alternate_id properties that makes the 'secret_id' property not work as intended. This results in the prepared URLs being set to /v1/secrets/ SECRET_ REF_URL which results in a 404.