conjur-api-go
conjur-api-go copied to clipboard
client.RetrieveSecret fails to retrieve secret if secretID contains a colon
Summary
client.RetrieveSecret fails to retrieve secret if secretID contains a colon.
Steps to Reproduce
Steps to reproduce the behavior:
- Create variable with ID
some/secret:goes/here
- Run
client.RetrieveSecret("some/secret:goes/here")
- The client will fail to retrieve the secret
Expected Results
A clear and concise description of what you expected to happen.
Actual Results (including error logs, if applicable)
404
Reproducible
- [x] Always
- [ ] Sometimes
- [ ] Non-Reproducible
Version/Tag number
all
Environment setup
does apply
Additional Information
When retrieving the full ID of the variable, if it contains a ':' then it assumes the first part is the resource variable, group, policy
.
The makeFullId
is the problem.
https://github.com/cyberark/conjur-api-go/blob/master/conjurapi/router_v5.go#L149
As you can see it splits the secret ID and assumes the first part if the kind
and the second part is the id
.
https://github.com/cyberark/conjur-api-go/blob/6d8c9c19fcab4a9410eae0e219615f773aab71e1/conjurapi/client.go#L157-L166