On a 204 response, the entire response object is returned, but I think it should be an empty dict instead (or maybe None would be fine as well), to be more consistent, since Vault is known to return 204 responses when it has nothing to say, and that result is more appropriate to deal with as a client.
As an example, if I want to test for this case, I need to import requests and test the the type of the response, or I can try checking for a status_code field, but if the vault request returned some data with a status_code field, then I can't rely on that.
There's a number of workarounds I can think of to handle this, but it'd be better for this common response type to be handled by the adapter in a way that's friendlier to deal with on the client side.
https://github.com/hvac/hvac/blob/ec048ded30d21c13c21cfa950d148c8bfc1467b0/hvac/adapters.py#L365-L371
On a 204 response, the entire response object is returned, but I think it should be an empty dict instead (or maybe
None
would be fine as well), to be more consistent, since Vault is known to return 204 responses when it has nothing to say, and that result is more appropriate to deal with as a client.As an example, if I want to test for this case, I need to
import requests
and test the the type of the response, or I can try checking for astatus_code
field, but if the vault request returned some data with astatus_code
field, then I can't rely on that.There's a number of workarounds I can think of to handle this, but it'd be better for this common response type to be handled by the adapter in a way that's friendlier to deal with on the client side.