-
-
Notifications
You must be signed in to change notification settings - Fork 935
feat(vfox): allow plugins to request env var redaction via MiseEnvResult #8166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ impl EnvResults { | |
| source: PathBuf, | ||
| name: String, | ||
| value: &Value, | ||
| redact: bool, | ||
| redact: Option<bool>, | ||
| env: IndexMap<String, String>, | ||
| ) -> Result<()> { | ||
| let path = dirs::PLUGINS.join(name.to_kebab_case()); | ||
|
|
@@ -49,8 +49,10 @@ impl EnvResults { | |
| } | ||
|
|
||
| // Add env vars | ||
| // User's explicit redact setting takes priority, otherwise use plugin's preference | ||
| let should_redact = redact.unwrap_or(response.redact); | ||
| for (k, v) in response.env { | ||
| if redact { | ||
| if should_redact { | ||
|
Comment on lines
+52
to
+55
|
||
| r.redactions.push(k.clone()); | ||
| } | ||
| r.env.insert(k, (v, source.clone())); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are unit tests for other hook result parsers in
crates/vfox/src/hooks/but none forMiseEnvResult::from_lua. Since this change adds new parsing logic and error messaging for theredactfield (and alters extended-format detection), please add tests covering: defaultredact=falsewhen omitted,redact=truewhen provided, and invalid types producing the expected runtime error.