Skip to content

Commit ce50c94

Browse files
committed
Use camelCase for policy responses
1 parent b8e6569 commit ce50c94

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

codex-rs/execpolicy2/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ prefix_rule(
2424
{
2525
"match": {
2626
"decision": "allow|prompt|forbidden",
27-
"matched_rules": [
27+
"matchedRules": [
2828
{
2929
"prefixRuleMatch": {
30-
"matched_prefix": ["<token>", "..."],
30+
"matchedPrefix": ["<token>", "..."],
3131
"decision": "allow|prompt|forbidden"
3232
}
3333
}
@@ -41,7 +41,7 @@ prefix_rule(
4141
"noMatch"
4242
```
4343

44-
- `matched_rules` lists every rule whose prefix matched the command; `matched_prefix` is the exact prefix that matched.
44+
- `matchedRules` lists every rule whose prefix matched the command; `matchedPrefix` is the exact prefix that matched.
4545
- The effective `decision` is the strictest severity across all matches (`forbidden` > `prompt` > `allow`).
4646

4747
## CLI

codex-rs/execpolicy2/src/policy.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub enum Evaluation {
4646
NoMatch,
4747
Match {
4848
decision: Decision,
49+
#[serde(rename = "matchedRules")]
4950
matched_rules: Vec<RuleMatch>,
5051
},
5152
}

codex-rs/execpolicy2/src/rule.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ impl PrefixPattern {
6060
#[serde(rename_all = "camelCase")]
6161
pub enum RuleMatch {
6262
PrefixRuleMatch {
63+
#[serde(rename = "matchedPrefix")]
6364
matched_prefix: Vec<String>,
6465
decision: Decision,
6566
},

0 commit comments

Comments
 (0)