Thanks to visit codestin.com
Credit goes to github.com

Skip to content

User secrets dashboard cannot create multiline file secrets #27173

Description

@kyusic

Problem

The User Secrets page currently does not preserve multiline values when creating a secret from the web UI.

This makes it difficult or impossible to create file-target secrets for common multiline files such as:

  • kubeconfig files
  • PEM certificates or keys
  • YAML configuration files

For example, if I paste a kubeconfig into the Value field and set the file target to ~/.kube/config, the value is collapsed into a single line. The resulting file in the workspace is not a valid kubeconfig.

Steps to reproduce

  1. Go to Account -> Secrets.
  2. Click Add secret.
  3. Paste a multiline value into the Value field, for example a kubeconfig.
  4. Set File path to ~/.kube/config.
  5. Save the secret.
  6. Start or restart a workspace.
  7. Inspect the generated file.

Expected behavior

The pasted value should be preserved exactly, including newline characters between lines, so the file target receives the same content that was pasted into the UI.

Actual behavior

The pasted value is treated as a single-line input, so newlines are not preserved. This breaks file-target secrets that are intended to write multiline files.

Workaround

Using the CLI works because stdin is preserved verbatim:

coder secret create kubeconfig --file ~/.kube/config < ./kubeconfig

However, this is not discoverable for users who manage secrets through the dashboard.

Additional context

File-target secrets imply that users can store file contents, but many useful secret files are multiline.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions