mirror of
https://github.com/go-task/task.git
synced 2026-06-29 23:55:18 +00:00
fix: prevent secret variable leaks in summary, verbose and key ordering
- mask secret values in `task --summary` (commands and vars listing) - mask resolved value of dynamic (sh) secrets in verbose logs - use masked command for platform-skipped verbose log - allow `secret` key in any position in a var definition (not only first) - add `value` to the JSON schema var definition - skip masking pass when no secret is present and dedup mask helpers - document that the `secret` flag is not propagated to derived variables
This commit is contained in:
@@ -320,6 +320,29 @@ func TestSecretVars(t *testing.T) {
|
||||
),
|
||||
WithTask("test-env-secret-limitation"),
|
||||
)
|
||||
NewExecutorTest(t,
|
||||
WithName("secret vars are masked in summary"),
|
||||
WithExecutorOptions(
|
||||
task.WithDir("testdata/secrets"),
|
||||
task.WithSummary(true),
|
||||
),
|
||||
WithTask("test-secret-masking"),
|
||||
)
|
||||
NewExecutorTest(t,
|
||||
WithName("dynamic secret masked in verbose"),
|
||||
WithExecutorOptions(
|
||||
task.WithDir("testdata/secrets"),
|
||||
task.WithVerbose(true),
|
||||
),
|
||||
WithTask("test-dynamic-secret-verbose"),
|
||||
)
|
||||
NewExecutorTest(t,
|
||||
WithName("secret key order independent"),
|
||||
WithExecutorOptions(
|
||||
task.WithDir("testdata/secrets"),
|
||||
),
|
||||
WithTask("test-secret-key-order"),
|
||||
)
|
||||
}
|
||||
|
||||
func TestRequires(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user