mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Comprehensive rename of all openclaw references to hanzo-bot equivalents: - Package: openclaw → @hanzo/bot - Binary: openclaw → hanzo-bot - Types: OpenClaw* → Bot* - Env vars: OPENCLAW_* → BOT_* - Android: ai.openclaw.android → ai.hanzo.bot.android - iOS/macOS: ai.openclaw.* → ai.hanzo.* - Swift modules: OpenClaw* → Bot* - Plugins: openclaw.plugin.json → bot.plugin.json - Paths: .openclaw/ → .hanzo/bot/ - URLs: github.com/openclaw → github.com/hanzoai
3.7 KiB
3.7 KiB
summary, read_when, title
| summary | read_when | title | |||
|---|---|---|---|---|---|
| Contract for `secrets apply` plans: allowed target paths, validation, and ref-only auth-profile behavior |
|
Secrets Apply Plan Contract |
Secrets apply plan contract
This page defines the strict contract enforced by hanzo-bot secrets apply.
If a target does not match these rules, apply fails before mutating config.
Plan file shape
hanzo-bot secrets apply --from <plan.json> expects a targets array of plan targets:
{
version: 1,
protocolVersion: 1,
targets: [
{
type: "models.providers.apiKey",
path: "models.providers.openai.apiKey",
pathSegments: ["models", "providers", "openai", "apiKey"],
providerId: "openai",
ref: { source: "env", provider: "default", id: "OPENAI_API_KEY" },
},
],
}
Allowed target types and paths
target.type |
Allowed target.path shape |
Optional id match rule |
|---|---|---|
models.providers.apiKey |
models.providers.<providerId>.apiKey |
providerId must match <providerId> when present |
skills.entries.apiKey |
skills.entries.<skillKey>.apiKey |
n/a |
channels.googlechat.serviceAccount |
channels.googlechat.serviceAccount |
accountId must be empty/omitted |
channels.googlechat.serviceAccount |
channels.googlechat.accounts.<accountId>.serviceAccount |
accountId must match <accountId> when present |
Path validation rules
Each target is validated with all of the following:
typemust be one of the allowed target types above.pathmust be a non-empty dot path.pathSegmentscan be omitted. If provided, it must normalize to exactly the same path aspath.- Forbidden segments are rejected:
__proto__,prototype,constructor. - The normalized path must match one of the allowed path shapes for the target type.
- If
providerId/accountIdis set, it must match the id encoded in the path.
Failure behavior
If a target fails validation, apply exits with an error like:
Invalid plan target path for models.providers.apiKey: models.providers.openai.baseUrl
No partial mutation is committed for that invalid target path.
Ref-only auth profiles and implicit providers
Implicit provider discovery also considers auth profiles that store refs instead of plaintext credentials:
type: "api_key"profiles can usekeyRef(for example env-backed refs).type: "token"profiles can usetokenRef.
Behavior:
- For API-key providers (for example
volcengine,byteplus), ref-only profiles can still activate implicit provider entries. - For
github-copilot, if the profile has no plaintext token, discovery will trytokenRefenv resolution before token exchange.
Operator checks
# Validate plan without writes
hanzo-bot secrets apply --from /tmp/bot-secrets-plan.json --dry-run
# Then apply for real
hanzo-bot secrets apply --from /tmp/bot-secrets-plan.json
If apply fails with an invalid target path message, regenerate the plan with hanzo-bot secrets configure or fix the target path to one of the allowed shapes above.