Skip to content

Commit 6add183

Browse files
shanselmanCopilot
andcommitted
fix(exec): align allowlist copy with runtime policy
Co-authored-by: Copilot App <[email protected]>
1 parent a9662be commit 6add183

7 files changed

Lines changed: 20 additions & 15 deletions

File tree

‎src/OpenClaw.Tray.WinUI/Pages/PermissionsPage.xaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@
232232
</Grid.ColumnDefinitions>
233233
<StackPanel Grid.Column="0" Spacing="2">
234234
<TextBlock x:Uid="PermissionsPage_TextBlock_28" Text="Executable-path allowlist" Style="{StaticResource BodyStrongTextBlockStyle}"/>
235-
<TextBlock x:Uid="PermissionsPage_PatternsAreMatchedLeft" Text="When an approval offers Allow Always, use it to approve a simple command. You can also add a resolved executable-path pattern such as **/hostname.exe. Deny and Ask remain controlled by Default action. Changes save automatically."
235+
<TextBlock x:Uid="PermissionsPage_PatternsAreMatchedLeft" Text="Allow Always creates an argument-bound entry for an eligible native .exe command. Entries added here are path-only and can allow matching executables with any arguments. Deny and Ask remain controlled by Default action. Changes save automatically."
236236
Style="{StaticResource CaptionTextBlockStyle}"
237237
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
238238
TextWrapping="Wrap"/>
@@ -258,7 +258,7 @@
258258

259259
<!-- Empty state — visible when there are no allowlist entries -->
260260
<TextBlock x:Uid="PermissionsPage_NoRulesYetAdd" x:Name="RulesEmptyState"
261-
Text="No executable-path allowlist entries. When an approval offers Allow Always, use it to approve a simple command, or add a pattern such as **/hostname.exe."
261+
Text="No executable-path allowlist entries. Approve an eligible native .exe command with Allow Always, or add a path-only pattern such as **/hostname.exe."
262262
Style="{StaticResource CaptionTextBlockStyle}"
263263
Foreground="{ThemeResource TextFillColorTertiaryBrush}"
264264
TextWrapping="Wrap"

‎src/OpenClaw.Tray.WinUI/Strings/en-us/Resources.resw‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4501,7 +4501,7 @@ Commands are blocked while sandboxing is unavailable because strict fallback blo
45014501
<value>What happens when a command doesn't match the executable-path allowlist below.</value>
45024502
</data>
45034503
<data name="PermissionsPage_PatternsAreMatchedLeft.Text" xml:space="preserve">
4504-
<value>When an approval offers Allow Always, use it to approve a simple command. You can also add a resolved executable-path pattern such as **/hostname.exe. Deny and Ask remain controlled by Default action. Changes save automatically.</value>
4504+
<value>Allow Always creates an argument-bound entry for an eligible native .exe command. Entries added here are path-only and can allow matching executables with any arguments. Deny and Ask remain controlled by Default action. Changes save automatically.</value>
45054505
</data>
45064506
<data name="PermissionsPage_Saved.Text" xml:space="preserve">
45074507
<value>Saved</value>
@@ -4510,7 +4510,7 @@ Commands are blocked while sandboxing is unavailable because strict fallback blo
45104510
<value>0 entries</value>
45114511
</data>
45124512
<data name="PermissionsPage_NoRulesYetAdd.Text" xml:space="preserve">
4513-
<value>No executable-path allowlist entries. When an approval offers Allow Always, use it to approve a simple command, or add a pattern such as **/hostname.exe.</value>
4513+
<value>No executable-path allowlist entries. Approve an eligible native .exe command with Allow Always, or add a path-only pattern such as **/hostname.exe.</value>
45144514
</data>
45154515
<data name="PermissionsPage_WindowsPrivacy.Text" xml:space="preserve">
45164516
<value>Windows privacy</value>

‎src/OpenClaw.Tray.WinUI/Strings/fr-fr/Resources.resw‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4454,7 +4454,7 @@ Les commandes sont bloquées tant que le sandboxing est indisponible, car le blo
44544454
<value>Ce qui se passe lorsqu’une commande ne correspond pas à la liste d’autorisation des chemins d’exécutables ci-dessous.</value>
44554455
</data>
44564456
<data name="PermissionsPage_PatternsAreMatchedLeft.Text" xml:space="preserve">
4457-
<value>Lorsqu’une demande d’approbation propose Toujours autoriser, utilisez cette option pour approuver une commande simple. Vous pouvez également ajouter un motif de chemin d’exécutable résolu tel que **/hostname.exe. Refuser et Demander restent contrôlés par Action par défaut. Les modifications sont enregistrées automatiquement.</value>
4457+
<value>Toujours autoriser crée une entrée liée aux arguments pour une commande .exe native admissible. Les entrées ajoutées ici sont basées uniquement sur le chemin et peuvent autoriser les exécutables correspondants avec n’importe quels arguments. Refuser et Demander restent contrôlés par Action par défaut. Les modifications sont enregistrées automatiquement.</value>
44584458
</data>
44594459
<data name="PermissionsPage_Saved.Text" xml:space="preserve">
44604460
<value>Enregistré</value>
@@ -4463,7 +4463,7 @@ Les commandes sont bloquées tant que le sandboxing est indisponible, car le blo
44634463
<value>0 entrée</value>
44644464
</data>
44654465
<data name="PermissionsPage_NoRulesYetAdd.Text" xml:space="preserve">
4466-
<value>Aucune entrée dans la liste d’autorisation des chemins d’exécutables. Lorsqu’une demande d’approbation propose Toujours autoriser, utilisez cette option pour approuver une commande simple, ou ajoutez un motif tel que **/hostname.exe.</value>
4466+
<value>Aucune entrée dans la liste d’autorisation des chemins d’exécutables. Approuvez une commande .exe native admissible avec Toujours autoriser, ou ajoutez un motif basé uniquement sur le chemin tel que **/hostname.exe.</value>
44674467
</data>
44684468
<data name="PermissionsPage_WindowsPrivacy.Text" xml:space="preserve">
44694469
<value>Confidentialité Windows</value>

‎src/OpenClaw.Tray.WinUI/Strings/nl-nl/Resources.resw‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4455,7 +4455,7 @@ Opdrachten worden geblokkeerd zolang sandboxing niet beschikbaar is, omdat strik
44554455
<value>Wat gebeurt er als een opdracht niet overeenkomt met de allowlist voor paden van uitvoerbare bestanden hieronder.</value>
44564456
</data>
44574457
<data name="PermissionsPage_PatternsAreMatchedLeft.Text" xml:space="preserve">
4458-
<value>Wanneer bij een goedkeuring Altijd toestaan wordt aangeboden, gebruikt u dit om een eenvoudige opdracht goed te keuren. U kunt ook een opgelost padpatroon voor uitvoerbare bestanden toevoegen, zoals **/hostname.exe. Weigeren en Vragen blijven onder Standaardactie vallen. Wijzigingen worden automatisch opgeslagen.</value>
4458+
<value>Altijd toestaan maakt een aan argumenten gebonden vermelding voor een geschikte systeemeigen .exe-opdracht. Vermeldingen die u hier toevoegt, zijn alleen op het pad gebaseerd en kunnen overeenkomende uitvoerbare bestanden met alle argumenten toestaan. Weigeren en Vragen blijven onder Standaardactie vallen. Wijzigingen worden automatisch opgeslagen.</value>
44594459
</data>
44604460
<data name="PermissionsPage_Saved.Text" xml:space="preserve">
44614461
<value>Opgeslagen</value>
@@ -4464,7 +4464,7 @@ Opdrachten worden geblokkeerd zolang sandboxing niet beschikbaar is, omdat strik
44644464
<value>0 vermeldingen</value>
44654465
</data>
44664466
<data name="PermissionsPage_NoRulesYetAdd.Text" xml:space="preserve">
4467-
<value>Geen vermeldingen in de allowlist voor paden van uitvoerbare bestanden. Wanneer bij een goedkeuring Altijd toestaan wordt aangeboden, gebruikt u dit om een eenvoudige opdracht goed te keuren of voegt u een patroon toe, zoals **/hostname.exe.</value>
4467+
<value>Geen vermeldingen in de allowlist voor paden van uitvoerbare bestanden. Keur een geschikte systeemeigen .exe-opdracht goed met Altijd toestaan of voeg een patroon toe dat alleen op het pad is gebaseerd, zoals **/hostname.exe.</value>
44684468
</data>
44694469
<data name="PermissionsPage_WindowsPrivacy.Text" xml:space="preserve">
44704470
<value>Windows-privacy</value>

‎src/OpenClaw.Tray.WinUI/Strings/zh-cn/Resources.resw‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4454,7 +4454,7 @@
44544454
<value>当命令与下列可执行文件路径允许列表不匹配时发生什么。</value>
44554455
</data>
44564456
<data name="PermissionsPage_PatternsAreMatchedLeft.Text" xml:space="preserve">
4457-
<value>当审批提供“始终允许”选项时,可使用它来批准简单命令。也可添加解析后的可执行文件路径模式,例如 **/hostname.exe。“拒绝”和“询问”仍由“默认操作”控制。更改将自动保存。</value>
4457+
<value>“始终允许”会为符合条件的原生 .exe 命令创建参数绑定条目。在此添加的条目仅按路径匹配,可能允许匹配的可执行文件使用任意参数。“拒绝”和“询问”仍由“默认操作”控制。更改将自动保存。</value>
44584458
</data>
44594459
<data name="PermissionsPage_Saved.Text" xml:space="preserve">
44604460
<value>已保存</value>
@@ -4463,7 +4463,7 @@
44634463
<value>0 个条目</value>
44644464
</data>
44654465
<data name="PermissionsPage_NoRulesYetAdd.Text" xml:space="preserve">
4466-
<value>没有可执行文件路径允许列表条目。当审批提供“始终允许”选项时,可使用它来批准简单命令,或添加 **/hostname.exe 等路径模式。</value>
4466+
<value>没有可执行文件路径允许列表条目。使用“始终允许”批准符合条件的原生 .exe 命令,或添加仅按路径匹配的模式,例如 **/hostname.exe。</value>
44674467
</data>
44684468
<data name="PermissionsPage_WindowsPrivacy.Text" xml:space="preserve">
44694469
<value>Windows 隐私</value>

‎src/OpenClaw.Tray.WinUI/Strings/zh-tw/Resources.resw‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4454,7 +4454,7 @@
44544454
<value>當命令不符合下列可執行檔路徑允許清單時會發生什麼。</value>
44554455
</data>
44564456
<data name="PermissionsPage_PatternsAreMatchedLeft.Text" xml:space="preserve">
4457-
<value>當核准要求提供「一律允許」選項時,可使用此選項核准簡單命令。也可新增解析後的可執行檔路徑模式,例如 **/hostname.exe。「拒絕」和「詢問」仍由「預設動作」控制。變更會自動儲存。</value>
4457+
<value>「一律允許」會為符合條件的原生 .exe 命令建立參數繫結項目。在此新增的項目只依路徑比對,可能允許相符的可執行檔使用任何引數。「拒絕」和「詢問」仍由「預設動作」控制。變更會自動儲存。</value>
44584458
</data>
44594459
<data name="PermissionsPage_Saved.Text" xml:space="preserve">
44604460
<value>已儲存</value>
@@ -4463,7 +4463,7 @@
44634463
<value>0 個項目</value>
44644464
</data>
44654465
<data name="PermissionsPage_NoRulesYetAdd.Text" xml:space="preserve">
4466-
<value>沒有可執行檔路徑允許清單項目。當核准要求提供「一律允許」選項時,可使用此選項核准簡單命令,或新增 **/hostname.exe 等路徑模式。</value>
4466+
<value>沒有可執行檔路徑允許清單項目。使用「一律允許」核准符合條件的原生 .exe 命令,或新增只依路徑比對的模式,例如 **/hostname.exe。</value>
44674467
</data>
44684468
<data name="PermissionsPage_WindowsPrivacy.Text" xml:space="preserve">
44694469
<value>Windows 隱私</value>

‎tests/OpenClaw.Tray.Tests/AppRefactorContractTests.cs‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,10 @@ public void PermissionsPage_ExecPolicyEditor_IsExecutablePathAllowlistOnly()
465465
"<value>Controls which executables the agent can launch on this node. The executable-path allowlist starts empty.</value>",
466466
resources);
467467
Assert.Contains(
468-
"<value>When an approval offers Allow Always, use it to approve a simple command. You can also add a resolved executable-path pattern such as **/hostname.exe. Deny and Ask remain controlled by Default action. Changes save automatically.</value>",
468+
"<value>Allow Always creates an argument-bound entry for an eligible native .exe command. Entries added here are path-only and can allow matching executables with any arguments. Deny and Ask remain controlled by Default action. Changes save automatically.</value>",
469469
resources);
470470
Assert.Contains(
471-
"<value>No executable-path allowlist entries. When an approval offers Allow Always, use it to approve a simple command, or add a pattern such as **/hostname.exe.</value>",
471+
"<value>No executable-path allowlist entries. Approve an eligible native .exe command with Allow Always, or add a path-only pattern such as **/hostname.exe.</value>",
472472
resources);
473473
Assert.Contains(
474474
"<value>Enter an executable-path pattern such as **/hostname.exe. Basename or command-text patterns such as hostname are invalid.</value>",
@@ -490,10 +490,10 @@ public void PermissionsPage_ExecPolicyCopy_IsLocalizedAcrossSupportedLocales()
490490
};
491491
var hostnameExampleKeys = new[]
492492
{
493-
"PermissionsPage_PatternsAreMatchedLeft.Text",
494493
"PermissionsPage_NoRulesYetAdd.Text",
495494
"PermissionsPage_ExecAllowlistPatternValidation.Text",
496495
};
496+
const string runtimeContractKey = "PermissionsPage_PatternsAreMatchedLeft.Text";
497497

498498
foreach (var locale in new[] { "fr-fr", "nl-nl", "zh-cn", "zh-tw" })
499499
{
@@ -513,6 +513,11 @@ public void PermissionsPage_ExecPolicyCopy_IsLocalizedAcrossSupportedLocales()
513513
Assert.DoesNotContain("git.exe", value, StringComparison.OrdinalIgnoreCase);
514514
Assert.NotEqual(enUs[key], value);
515515
}
516+
517+
var runtimeContract = Assert.Contains(runtimeContractKey, localized);
518+
Assert.NotEmpty(runtimeContract);
519+
Assert.Contains(".exe", runtimeContract, StringComparison.OrdinalIgnoreCase);
520+
Assert.NotEqual(enUs[runtimeContractKey], runtimeContract);
516521
}
517522
}
518523

0 commit comments

Comments
 (0)