Skip to content

sbx secret set-custom upsert is keyed on placeholder and silently replaces unrelated mappings #229

@devbeard

Description

@devbeard

Version: sbx v0.32.0 (5558036), macOS Apple silicon

Description

set-custom seems to treat the placeholder string as the unique key. If you create a new custom secret reusing a placeholder, the old row is replaced even when both --env and --host are different. There is no output indicating a replace happened.

sbx secret set-custom -g --host api.first.com  --env TOKEN_A --placeholder "tok_shared00" --value secret1
sbx secret set-custom -g --host api.second.com --env TOKEN_B --placeholder "tok_shared00" --value secret1
sbx secret ls
# only the api.second.com row exists now

I hit this while trying to get one credential injected on two hosts (same secret, same placeholder, two mappings). I get that one-placeholder-one-host might be by design, but the silent replace across env/host is surprising either way. An error on placeholder collision would have saved me a lot of confusion, the only symptom downstream is the upstream API answering "Bad credentials" because it received the literal placeholder.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions