Files
bot/apps/macos/Tests/OpenClawIPCTests/HostEnvSanitizerTests.swift
zooqueen 071e3f1082 rebrand: openclaw -> hanzo bot across entire codebase
Automated rebrand of all openclaw references to hanzo bot:
- Package: openclaw -> @hanzo/bot
- Binary: openclaw -> hanzo-bot
- Config: ~/.openclaw -> ~/.hanzo/bot
- Docker: ghcr.io/hanzoai/bot
- Env vars: OPENCLAW_* -> BOT_*
- Bundle IDs: ai.hanzo.bot.*
- Product name: Hanzo Bot
2026-03-19 13:52:32 -07:00

37 lines
1.1 KiB
Swift

import Testing
@testable import Hanzo Bot
struct HostEnvSanitizerTests {
@Test func `sanitize blocks shell trace variables`() {
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 `sanitize shell wrapper allows only explicit override keys`() {
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 `sanitize non shell wrapper keeps regular overrides`() {
let env = HostEnvSanitizer.sanitize(overrides: ["BOT_TOKEN": "secret"])
#expect(env["BOT_TOKEN"] == "secret")
}
}