Skip to content

swamp vault put fails when value contains special characters from GCP access tokens #880

@bixu

Description

@bixu

Description

`swamp vault put` fails with `TooManyArgumentsError` when the secret value contains characters that the CLI argument parser interprets as separate arguments. GCP access tokens (from `gcloud auth print-access-token`) consistently trigger this.

Steps to Reproduce

```bash
TOKEN=$(gcloud auth print-access-token)
swamp vault put gcp-oauth GCP_ACCESS_TOKEN "$TOKEN"
```

Error:
```
TooManyArgumentsError: Too many arguments: ya29.a0Aa7MYio7IUnvZ...
```

Also fails with:

  • `swamp vault put gcp-oauth GCP_ACCESS_TOKEN "'$TOKEN'"`
  • `gcloud auth print-access-token | swamp vault put gcp-oauth GCP_ACCESS_TOKEN --stdin` (no `--stdin` flag exists)

Workaround

Store directly in 1Password, bypassing swamp:
```bash
op item edit GCP_ACCESS_TOKEN --vault swamp "password=$(gcloud auth print-access-token)"
```

Proposed Solution

Either:

  1. Accept the value as a single positional argument regardless of content (stop parsing after the third positional arg)
  2. Add `--stdin` or `--value-file` support for piping secret values
  3. Both

Environment

  • swamp: `20260325.232536.0-sha.eb02760e`
  • Shell: zsh
  • OS: macOS Darwin 25.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglifecycle/doneCompleted and merged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions