feat(fermata): plain settings (true, 3600, AUTH_ENABLED) make no manifest entry; *AUTH* becomes three patterns
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
//! stands in for its `safeParse`: a replacement that fails it would be dropped for
|
||||
//! the original output.
|
||||
|
||||
use dirigent_fermata::core::secrets::value_class::is_plain_setting;
|
||||
use assert_cmd::Command;
|
||||
use serde_json::{json, Value};
|
||||
use std::fs;
|
||||
@@ -556,12 +557,13 @@ fn a_refusal_keeps_every_enum_value_of_every_tool() {
|
||||
}
|
||||
|
||||
/// A secret equal to an enum value: the value stays, the text beside it takes a mask,
|
||||
/// and nothing is refused.
|
||||
/// and nothing is refused. Values that are plain settings (`true`) make no secret, so
|
||||
/// they are not tried.
|
||||
#[test]
|
||||
fn a_secret_equal_to_an_enum_value_keeps_the_value_in_every_tool() {
|
||||
for (tool, fields) in TOOL_ENUMS {
|
||||
for (field, values) in *fields {
|
||||
for value in values.iter().filter(|v| v.len() >= 4) {
|
||||
for value in values.iter().filter(|v| v.len() >= 4 && !is_plain_setting("API_TOKEN", v, true)) {
|
||||
let p = project(&format!("API_TOKEN={value}\n"), "[files]\npatterns = [\".env\"]\n");
|
||||
let out = hook(&p, tool, &json!({ *field: value, "note": format!("x {value} y") }));
|
||||
let output = updated(&out);
|
||||
|
||||
Reference in New Issue
Block a user