[Feature Request] Strip ambient credential variables a plugin knows about, not only declared @internal items
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript
Research direction
Start by reading how @internal items are handled and how plugins register their metadata; the issue does not name source files or tests. Decide how plugin-known ambient credentials and an optional generic strip mechanism should interact with explicit schema declarations, then define completion around the reproduction: OP_SERVICE_ACCOUNT_TOKEN is absent from the child environment when the 1Password plugin is loaded, with the documented override behavior covered.
Written by the indexing model from the issue text.
Description
Description
@internal keeps a secret-zero out of the child process, but only for items the schema declares. A credential that is already in the environment under another name reaches the app unchanged. Ask: let plugins declare the credential env vars they use, so varlock run strips them too, and/or add a way to strip named vars from the child (for example a root decorator or varlock run --strip VAR).
Motivation
With the 1Password plugin, the documented setup declares the token as OP_TOKEN (@type=opServiceAccountToken, internal by default). But the op CLI and 1Password's own docs use OP_SERVICE_ACCOUNT_TOKEN, so hosts and shells often carry that name too. Repro on 1.21.0:
.env.schema:
# @plugin(@varlock/1password-plugin)
# @initOp(token=$OP_TOKEN, allowAppAuth=false, useCliWithServiceAccount=true)
# @defaultSensitive=false
# ---
# @type=opServiceAccountToken @internal @optional
OP_TOKEN=
API_URL=https://api.example.com
OP_SERVICE_ACCOUNT_TOKEN=dummy varlock run -- sh -c 'env | grep ^OP_'
# OP_SERVICE_ACCOUNT_TOKEN=dummy
The app, and anything it spawns, can read every vault that token opens, while the schema looks like it keeps the secret-zero internal.
Declaring it yourself works (OP_SERVICE_ACCOUNT_TOKEN= with @internal @optional removes it from the child), but you have to know that name, and the same applies to every plugin's credential variables (AWS keys, Vault tokens, and so on).
Proposed Solution
- A plugin can register the ambient credential variables it knows about (
OP_SERVICE_ACCOUNT_TOKEN,OP_CONNECT_TOKENfor 1Password), and varlock treats them as@internalwhenever that plugin is loaded, unless the schema explicitly declares them non-internal. - Optionally a generic mechanism, e.g.
# @stripFromChild(OP_SERVICE_ACCOUNT_TOKEN, AWS_SECRET_ACCESS_KEY)orvarlock run --strip, for tokens no plugin knows about. varlock loadcould warn when a known credential variable is present but not declared.
Alternatives
- Declare each such variable as
@internal @optionalin every schema (works today, easy to forget). - Wrap the app with
env -u(outside varlock, and does nothing for auto-load).
Additional Information
Related to the secret-zero guidance in the 1Password plugin docs and the @internal item decorator.
- Dominant language
- TypeScript
- Stars
- 4.9k
- Forks
- 140
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 35
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dmno-dev/varlock
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
dmno-dev/varlock#1279 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
dmno-dev/varlock#1100 · 3 comments ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
dmno-dev/varlock#1278 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
dmno-dev/varlock#1275 · 1 comment ·
Maintainers usually reply within 1 day
-
core:varlock RFC
Difficulty 5/5 Over a week Newbie friendliness 28/100
dmno-dev/varlock#1258 · 1 comment ·
Maintainers usually reply within 1 day
All issues in dmno-dev/varlock
Similar issues
-
documentation good first issue roadmap
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
resend/react-email#3876 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
siyuan-note/siyuan#21324 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
himynameisdave/bsky-profanity-counter#59 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100