🏗️ fermata: redaction-first security model, unified .botsecrets config
Realign fermata around redaction (PostToolUse) as the primary security layer, with access control (PreToolUse) as supplementary write/bash protection. Remove botignore.toml — policy rules now live in .botsecrets [policy] section. Add fermata.toml as an alias for .botsecrets. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,11 +2,13 @@ use dirigent_fermata::core::{Decision, Op, Policy};
|
||||
use std::fs;
|
||||
use tempfile::TempDir;
|
||||
|
||||
fn make_project(botignore: &str, toml_text: &str) -> TempDir {
|
||||
fn make_project(botignore: &str, botsecrets: &str) -> TempDir {
|
||||
let tmp = TempDir::new().unwrap();
|
||||
fs::write(tmp.path().join(".botignore"), botignore).unwrap();
|
||||
if !toml_text.is_empty() {
|
||||
fs::write(tmp.path().join("botignore.toml"), toml_text).unwrap();
|
||||
if !botignore.is_empty() {
|
||||
fs::write(tmp.path().join(".botignore"), botignore).unwrap();
|
||||
}
|
||||
if !botsecrets.is_empty() {
|
||||
fs::write(tmp.path().join(".botsecrets"), botsecrets).unwrap();
|
||||
}
|
||||
tmp
|
||||
}
|
||||
@@ -42,8 +44,8 @@ fn unmatched_path_allowed() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn toml_read_block_applies_only_to_read() {
|
||||
let tmp = make_project("", "[read]\npatterns = [\"secrets/**\"]\n");
|
||||
fn policy_read_block_applies_only_to_read() {
|
||||
let tmp = make_project("", "[policy.read]\npatterns = [\"secrets/**\"]\n");
|
||||
let policy = Policy::load(tmp.path()).unwrap();
|
||||
let target = tmp.path().join("secrets/key.pem");
|
||||
fs::create_dir_all(target.parent().unwrap()).unwrap();
|
||||
@@ -53,8 +55,8 @@ fn toml_read_block_applies_only_to_read() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn toml_write_block_applies_only_to_write() {
|
||||
let tmp = make_project("", "[write]\npatterns = [\"vendor/**\"]\n");
|
||||
fn policy_write_block_applies_only_to_write() {
|
||||
let tmp = make_project("", "[policy.write]\npatterns = [\"vendor/**\"]\n");
|
||||
let policy = Policy::load(tmp.path()).unwrap();
|
||||
let target = tmp.path().join("vendor/lib.rs");
|
||||
fs::create_dir_all(target.parent().unwrap()).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user