fix: enhance cron job execution conditions with remote allowance
This commit is contained in:
parent
c8ac5e5ecc
commit
4ec24a0f63
1 changed files with 2 additions and 4 deletions
|
|
@ -40,7 +40,7 @@ func NewCronTool(
|
||||||
execEnabled := true
|
execEnabled := true
|
||||||
if config != nil {
|
if config != nil {
|
||||||
allowCommand = config.Tools.Cron.AllowCommand
|
allowCommand = config.Tools.Cron.AllowCommand
|
||||||
execEnabled = config.Tools.Exec.Enabled
|
execEnabled = config.Tools.Exec.Enabled && config.Tools.Exec.AllowRemote
|
||||||
}
|
}
|
||||||
|
|
||||||
var execTool *ExecTool
|
var execTool *ExecTool
|
||||||
|
|
@ -189,9 +189,7 @@ func (t *CronTool) addJob(ctx context.Context, args map[string]any) *ToolResult
|
||||||
return ErrorResult("one of at_seconds, every_seconds, or cron_expr is required")
|
return ErrorResult("one of at_seconds, every_seconds, or cron_expr is required")
|
||||||
}
|
}
|
||||||
|
|
||||||
// GHSA-pv8c-p6jf-3fpp: command scheduling requires internal channel. When
|
// If command is set, check if execution is allowed and if confirmation is provided when required
|
||||||
// allow_command is disabled, explicit confirmation is required as an override.
|
|
||||||
// Non-command reminders remain open to all channels.
|
|
||||||
command, _ := args["command"].(string)
|
command, _ := args["command"].(string)
|
||||||
commandConfirm, _ := args["command_confirm"].(bool)
|
commandConfirm, _ := args["command_confirm"].(bool)
|
||||||
if command != "" {
|
if command != "" {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue