Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to escape quotes in secret values generated by agent template #3135

Open
wfjsw opened this issue Feb 20, 2025 · 1 comment
Open

Comments

@wfjsw
Copy link

wfjsw commented Feb 20, 2025

Feature description

Using the following template:

{{- with secret "*" "*" "/" `{"recursive": true, "expandSecretReferences": true}` }}
{{- range . }}
{{ .Key }}="{{ .Value }}"
{{- end }}
{{- end }}

When {{ .Value }} contains double quotes, it would generate invalid combinations, for example:

"["abc"]"

It would be great if the template could handle this situation.

Why would it be useful?

It won't require user to manually escape them, creating a surprise.

@Arnaud-IFEA
Copy link

Hello,
Infisical uses Go Template: https://pkg.go.dev/text/template

There's not much you can do, you can either remove the double quote from your template:
{{ .Key }}={{ .Value }}

or maybe use something like:
{{ .Key }}="{{ .Value | js }}"
to escape double quote in the value.

To test whether the value contains quotes, you need other functions... Infisical could add a third party library like this : https://masterminds.github.io/sprig/ to help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants