Template: {{with secret "/auth/token/create" "policies=policy1,policy2"}}{{.Auth.ClientToken}}{{ end }}
Expected behavior
What should have happened?
I should get a new token with policies "policy1" and "policy2".
Actual behavior
I get an error, * child policies must be subset of parent. This is because my policies argument is being treated as a single policy with a comma in its name, rather than two separate policies.
Discussion
The parsing code for the secret function treats argument values as strings. There's no way to pass an array as is expected by the policies argument to auth/token/create.
Any change this is getting fixed? Workaround is to slowly create a "one-policy-to-rule-them-all" instead of attaching more policies and keep a clear sight of what's attached.
Template:
{{with secret "/auth/token/create" "policies=policy1,policy2"}}{{.Auth.ClientToken}}{{ end }}
Expected behavior
What should have happened?
I should get a new token with policies "policy1" and "policy2".
Actual behavior
I get an error,
* child policies must be subset of parent
. This is because mypolicies
argument is being treated as a single policy with a comma in its name, rather than two separate policies.Discussion
The parsing code for the
secret
function treats argument values as strings. There's no way to pass an array as is expected by thepolicies
argument toauth/token/create
.