conjur-api-go icon indicating copy to clipboard operation
conjur-api-go copied to clipboard

client.RetrieveSecret fails to retrieve secret if secretID contains a colon

Open AndrewCopeland opened this issue 4 years ago • 2 comments

Summary

client.RetrieveSecret fails to retrieve secret if secretID contains a colon.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create variable with ID some/secret:goes/here
  2. Run client.RetrieveSecret("some/secret:goes/here")
  3. 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

AndrewCopeland avatar Nov 04 '20 21:11 AndrewCopeland