consul-template icon indicating copy to clipboard operation
consul-template copied to clipboard

can't pass array argument to `secret`

Open lexelby opened this issue 7 years ago • 2 comments

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.

lexelby avatar Mar 01 '19 18:03 lexelby

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.

marknl avatar Jan 24 '23 08:01 marknl