Skip to content

feat: add secure secret sources to alien dev - #681

Merged
alongubkin merged 3 commits into
mainfrom
alon/alien-913-add-secure-secret-sources-to-alien-dev
Sep 23, 2026
Merged

alongubkin merged 3 commits into
mainfrom
alon/alien-913-add-secure-secret-sources-to-alien-dev

Conversation

@alongubkin

Copy link
Copy Markdown
Member

alien dev --secret KEY=VALUE puts secret values in process arguments and often shell history. This adds --secret-file KEY=PATH[:targets] and --secret-env KEY=SOURCE_ENV[:targets], so the CLI receives only a source reference while preserving per-resource scoping.

Secret-source errors identify the destination key and source without rendering the loaded value. CliEnvVar debug output now redacts all secret values, including values supplied through the existing flag. Secret files discard one conventional trailing \n or \r\n.

Closes ALIEN-913.

Validation:

  • cargo test -p alien-cli --lib secret_ (5 passed)
  • git diff --check
  • cargo clippy -p alien-cli --lib --all-features was inspected but not used as a clean gate because the current workspace emits extensive pre-existing warnings from generated models and dependency crates.

@enclave-ai

enclave-ai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Enclave skipped this draft pull request. It will run automatically when you mark the PR as Ready for review.

@alongubkin
alongubkin marked this pull request as ready for review September 21, 2026 15:14
@greptile-apps

greptile-apps Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

The PR appears safe to merge; the previously reported issues are fixed and no new actionable defects remain.

Summary

The PR adds safer secret sources for local development while preserving resource scoping and preventing loaded values from appearing in debug output.

  • Adds --secret-file and --secret-env to alien dev.
  • Removes one conventional trailing line ending from file-backed secrets.
  • Redacts secret values in CliEnvVar debug output.
  • Provides focused parser and redaction tests.
  • Documents the safer workflow in the public and CLI READMEs.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A["alien dev"] --> B{"Secret option"}
    B -->|"--secret-file KEY=PATH:targets"| C["Read file"]
    B -->|"--secret-env KEY=SOURCE_ENV:targets"| D["Read inherited environment"]
    C --> E["Remove one trailing line ending"]
    D --> F["Loaded secret value"]
    E --> F
    F --> G["CliEnvVar<br/>is_secret = true"]
    G --> H["Apply optional resource targets"]
    G --> I["Debug output: [REDACTED]"]
Loading

Reviews (2) · Last reviewed commit: "fix: validate secure secret source synta..."

Comment thread crates/alien-cli/src/lib.rs Outdated
Comment thread crates/alien-cli/src/lib.rs
Comment thread crates/alien-cli/README.md
@alongubkin

Copy link
Copy Markdown
Member Author

@greptileai review

@alongubkin
alongubkin merged commit 198312d into main Sep 23, 2026
22 checks passed
@alongubkin
alongubkin deleted the alon/alien-913-add-secure-secret-sources-to-alien-dev branch September 23, 2026 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant