Skip to content

Commit 83230d1

Browse files
authored
Claude code settings: improve permission rule validation (SchemaStore#5019)
Co-authored-by: bogini <[email protected]>
1 parent 62592a6 commit 83230d1

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/negative_test/claude-code-settings/invalid-permission-rule.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
"InvalidTool",
55
"Bash without parentheses",
66
"Read[wrong-brackets]",
7-
"WebFetch(invalid:syntax"
7+
"WebFetch(invalid:syntax",
8+
"Bash()",
9+
"Bash(*)",
10+
"Read(?)"
811
],
912
"ask": [
1013
"AnotherInvalidTool",
1114
"Write missing parentheses",
1215
"LS[wrong-brackets]",
13-
"Edit(invalid:syntax"
16+
"Edit(invalid:syntax",
17+
"Edit(**)"
1418
]
1519
}
1620
}

src/schemas/json/claude-code-settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"permissionRule": {
4848
"type": "string",
4949
"description": "Tool permission rule",
50-
"pattern": "^((Bash|BashOutput|Edit|ExitPlanMode|Glob|Grep|KillShell|NotebookEdit|Read|SlashCommand|Task|TodoWrite|WebFetch|WebSearch|Write)\\(?|^mcp__)",
50+
"pattern": "^((Bash|BashOutput|Edit|ExitPlanMode|Glob|Grep|KillShell|NotebookEdit|Read|SlashCommand|Task|TodoWrite|WebFetch|WebSearch|Write)(\\((?=.*[^)*?])[^)]+\\))?|mcp__.*)$",
5151
"examples": [
5252
"Bash(git commit:*)",
5353
"Bash(npm run lint:*)",

0 commit comments

Comments
 (0)