Add Railway secrets provider#721
Conversation
Greptile SummaryThis PR adds a fully-functional Railway secrets provider (
Confidence Score: 5/5Safe to merge — the change is additive, self-contained within its new package, and the security-sensitive push path has been deliberately hardened with error redaction. The implementation is complete and consistent with existing provider patterns. The one security-sensitive path (secret value appearing in CLI arguments and error messages) is explicitly handled by No files require special attention. The two comments left are minor polish items (semantic use of Important Files Changed
Sequence DiagramsequenceDiagram
participant CLI as sh1pt CLI
participant Adapter as secrets-railway adapter
participant Exec as core/exec (spawn)
participant RailwayCLI as railway CLI
CLI->>Adapter: connect(ctx, config)
Adapter->>Exec: exec('railway', ['whoami'])
Exec->>RailwayCLI: spawn railway whoami
RailwayCLI-->>Exec: stdout/stderr
Exec-->>Adapter: ExecResult
Adapter-->>CLI: "{ accountId: scope }"
CLI->>Adapter: pull(ctx, config)
Adapter->>Exec: exec('railway', ['variable','list','--json',...scopedArgs])
Exec->>RailwayCLI: spawn railway variable list --json
RailwayCLI-->>Exec: JSON stdout
Exec-->>Adapter: "ExecResult { stdout }"
Adapter->>Adapter: "parseVariables(stdout) — handles array & object shapes"
Adapter-->>CLI: SecretRef[]
CLI->>Adapter: push(ctx, secrets, config)
loop for each secret
Adapter->>Adapter: assertSecretKey(key)
Adapter->>Exec: "exec('railway', [...commonArgs, 'KEY=VALUE'])"
Exec->>RailwayCLI: "spawn railway variable set KEY=VALUE"
RailwayCLI-->>Exec: exit code
alt non-zero exit
Exec-->>Adapter: "throws Error (message contains KEY=VALUE)"
Adapter->>Adapter: "redactSecretArgError → replaces KEY=VALUE with KEY=<redacted>"
Adapter-->>CLI: throws redacted Error
else success
Exec-->>Adapter: ExecResult
end
end
Adapter-->>CLI: "{ count: N }"
Reviews (4): Last reviewed commit: "Redact Railway secret values on CLI fail..." | Re-trigger Greptile |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
c06ec81 to
fd321ca
Compare
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
10 similar comments
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
|
🤖 Auto-rebase: The branch was rebased successfully locally but could not be pushed to the fork. Please enable 'Allow edits from maintainers' in the PR settings, or rebase manually: |
Summary
railway variable list/setrailwayunder thesecretsadapter categoryRefs #710.
Via ugig gig, ugig user liudong-design.
Testing
git diff --checknode --check packages/secrets/railway/src/index.tsusing local bundled Nodepnpm --filter @profullstack/sh1pt-secrets-railway typecheckandpnpm vitest run packages/secrets/railway/src/index.test.tsbecause this execution environment does not have pnpm/npm/corepack available on PATH.