-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Wrap/Unwrap: Use the same GUI as in KV view to support multiline strings #28579
Comments
@Himura2la Does toggling the "JSON" view when creating a secret not solve your workflow? When you toggle the JSON option when creating a secret you should be able to paste the unwrapped json object and it will create a multi-line secret. Or is there another part of this workflow that this doesn't cover? |
@Monkeychip, please, pay attention to the last sentence of the post. Yes, it's technically possible, but requires converting a multiline string into a JSON string. Also, there's no option to switch JSON off in "Wrap Data" view, which is exactly what's the issue about. |
Hi @Himura2la , just to confirm that we've understood correctly, could you provide an example to clarify what you mean by "multiline secret"? |
@lane-wetmore, I mean any string with line breaks (and quotation marks and backslashes), which can't be directly copy-pasted as-is into a JSON string between quotation marks. For instance, if I need to store a YAML document, it's required to perform manual conversion: jq -Rs <<EOF
services:
pgsql:
image: postgres:alpine
container_name: pgsql
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
volumes:
- data:/var/lib/postgresql/data
restart: unless-stopped
volumes:
data:
EOF
"services:\n pgsql:\n image: postgres:alpine\n container_name: pgsql\n environment:\n - POSTGRES_DB=postgres\n - POSTGRES_USER=postgres\n - POSTGRES_PASSWORD=postgres\n ports:\n - \"5432:5432\"\n volumes:\n - data:/var/lib/postgresql/data\n restart: unless-stopped\nvolumes:\n data:\n"
# wrap/unwrap
echo '"services:\n pgsql:\n image: postgres:alpine\n container_name: pgsql\n environment:\n - POSTGRES_DB=postgres\n - POSTGRES_USER=postgres\n - POSTGRES_PASSWORD=postgres\n ports:\n - \"5432:5432\"\n volumes:\n - data:/var/lib/postgresql/data\n restart: unless-stopped\nvolumes:\n data:\n"' | jq -r .
services:
pgsql:
image: postgres:alpine
container_name: pgsql
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- "5432:5432"
volumes:
- data:/var/lib/postgresql/data
restart: unless-stopped
volumes:
data: or the same thing with A real-world example is passing someone a private key in PEM format. |
Is your feature request related to a problem? Please describe.
I'm always frustrated when trying to send a multiline secret string to my colleague using a Wrap feature. The Wrap GUI enforces JSON markup, but does not provide JSON serializer:
Describe the solution you'd like
Since you force wrapped secrets to be JOSN, please replace the current Wrap/Unwrap view with a user-friendly view from the "Create Secret" page, where I can paste a multiline string as is and have them automatically serialized to JSON:
Describe alternatives you've considered
We have to use
base64
orjq
for multiline secrets on both sending and receiving sides.The text was updated successfully, but these errors were encountered: