mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-08-14 02:22:35 +00:00
* fix(security): harden upstream critical surfaces Refs #30 * fix(security): close pre-landing review gaps Refs #30 * fix(security): close official release blockers
16 lines
476 B
Go
16 lines
476 B
Go
package security
|
|
|
|
import "testing"
|
|
|
|
func TestValidateLauncherArgsDeniesEnvCommandLaunch(t *testing.T) {
|
|
if reason := validateLauncherArgs("env", []string{"bash", "-lc", "id"}); reason == "" {
|
|
t.Fatal("expected env with command args to be denied")
|
|
}
|
|
}
|
|
|
|
func TestValidateLauncherArgsAllowsPlainNonLauncherCommand(t *testing.T) {
|
|
if reason := validateLauncherArgs("git", []string{"status"}); reason != "" {
|
|
t.Fatalf("expected git args to be allowed, got %q", reason)
|
|
}
|
|
}
|