mirror of
https://github.com/hanzoai/bot.git
synced 2026-11-01 07:38:30 +00:00
Merged 3580 upstream commits from openclaw/main through a bridge branch that applied the openclaw→hanzo-bot rebrand before merging. Key upstream additions: - Android device diagnostics and notification actions - Device-auth v2 migration improvements - Docker CLI packaging fixes - Ollama discovery log demotion - Channel health monitoring - Slack native streaming - Linq iMessage channel - Gemini OAuth and FTS improvements - Inbound sender metadata - Daemon PATH improvements - Canvas host and onboarding enhancements - Security hardening (session files, exec allowlist)
37 lines
1.1 KiB
Swift
37 lines
1.1 KiB
Swift
import Testing
|
|
@testable import Bot
|
|
|
|
struct HostEnvSanitizerTests {
|
|
@Test func sanitizeBlocksShellTraceVariables() {
|
|
let env = HostEnvSanitizer.sanitize(overrides: [
|
|
"SHELLOPTS": "xtrace",
|
|
"PS4": "$(touch /tmp/pwned)",
|
|
"BOT_TEST": "1",
|
|
])
|
|
#expect(env["SHELLOPTS"] == nil)
|
|
#expect(env["PS4"] == nil)
|
|
#expect(env["BOT_TEST"] == "1")
|
|
}
|
|
|
|
@Test func sanitizeShellWrapperAllowsOnlyExplicitOverrideKeys() {
|
|
let env = HostEnvSanitizer.sanitize(
|
|
overrides: [
|
|
"LANG": "C",
|
|
"LC_ALL": "C",
|
|
"BOT_TOKEN": "secret",
|
|
"PS4": "$(touch /tmp/pwned)",
|
|
],
|
|
shellWrapper: true)
|
|
|
|
#expect(env["LANG"] == "C")
|
|
#expect(env["LC_ALL"] == "C")
|
|
#expect(env["BOT_TOKEN"] == nil)
|
|
#expect(env["PS4"] == nil)
|
|
}
|
|
|
|
@Test func sanitizeNonShellWrapperKeepsRegularOverrides() {
|
|
let env = HostEnvSanitizer.sanitize(overrides: ["BOT_TOKEN": "secret"])
|
|
#expect(env["BOT_TOKEN"] == "secret")
|
|
}
|
|
}
|