From a0d74bfa5e0cb7d23aea39288332f8dab9f46615 Mon Sep 17 00:00:00 2001 From: akazwz <50396286+akazwz@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:28:11 +0800 Subject: [PATCH] fix(capabilities): update default shell command validator pattern The default validator pattern '\\S+' is too restrictive for common shell commands as it doesn't allow spaces or special characters. This causes validation errors when using commands like `echo 'Hello World!'`. Changed the validator to '*' to support: - Commands with spaces - Commands with quotes - Other common shell command patterns This change improves developer experience by allowing standard shell commands to work out of the box while maintaining security through the capabilities system. --- src/content/docs/plugin/shell.mdx | 2 +- src/content/docs/zh-cn/plugin/shell.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/docs/plugin/shell.mdx b/src/content/docs/plugin/shell.mdx index b8e16d5553..49641c90e3 100644 --- a/src/content/docs/plugin/shell.mdx +++ b/src/content/docs/plugin/shell.mdx @@ -139,7 +139,7 @@ See the [Capabilities Overview](/security/capabilities/) for more information an "args": [ "-c", { - "validator": "\\S+" + "validator": "*" } ], "sidecar": false diff --git a/src/content/docs/zh-cn/plugin/shell.mdx b/src/content/docs/zh-cn/plugin/shell.mdx index dd4ff317d8..7d5f673832 100644 --- a/src/content/docs/zh-cn/plugin/shell.mdx +++ b/src/content/docs/zh-cn/plugin/shell.mdx @@ -136,7 +136,7 @@ if output.status.success() { "args": [ "-c", { - "validator": "\\S+" + "validator": "*" } ], "sidecar": false