The conjur_variable lookup plugin takes in a variable path:
"{{ lookup('cyberark.conjur.conjur_variable', '/path/to/secret namespace/secret maybe with spaces') }}"
It's important that the variable path is not urlencoded - the lookup plugin will urlencode the path before sending the request to Conjur.
In particular, if the path is pre-cleaned so that spaces are replaced by + symbols, the lookup plugin will treat the + as a literal +, and not as a symbol that represents a space.
We should also consider adding a preliminary troubleshooting section to the README that includes this case:
- You have a variable with spaces in its path, like
/path/to/secret namespace/secret with spaces
- You pass it to the lookup plugin as
/path/to/secret+namespace/secret+with+spaces
- The lookup plugin errors
- You see an entry in the Conjur logs like:
<13>1 2020-07-16T20:40:42.169+00:00 8b117ffb7cc7 nginx - - [meta sequenceId="22"] 10.202.76.252 "GET /secrets/variable/path%2Fto%2Fsecret+namespace%2Fsecret+with+spaces HTTP/1.1" 404 424 "-" "Python-urllib/2.7" 0.015 0.014
AC:
- The README is clear about what the input parameters to the lookup plugin are
- The README has a troubleshooting section which includes the case above
The
conjur_variablelookup plugin takes in a variable path:It's important that the variable path is not urlencoded - the lookup plugin will urlencode the path before sending the request to Conjur.
In particular, if the path is pre-cleaned so that spaces are replaced by
+symbols, the lookup plugin will treat the+as a literal+, and not as a symbol that represents a space.We should also consider adding a preliminary troubleshooting section to the README that includes this case:
/path/to/secret namespace/secret with spaces/path/to/secret+namespace/secret+with+spacesAC: