Technical reference
Bề mặt thông tin xác thực SecretRef
Trang này định nghĩa bề mặt thông tin xác thực SecretRef chuẩn.
Mục đích phạm vi:
- Trong phạm vi: chỉ các thông tin xác thực do người dùng cung cấp mà OpenClaw không phát hành hoặc xoay vòng.
- Ngoài phạm vi: thông tin xác thực được phát hành hoặc xoay vòng lúc chạy, dữ liệu làm mới OAuth, và các hiện vật kiểu phiên.
Thông tin xác thực được hỗ trợ
Đích openclaw.json (secrets configure + secrets apply + secrets audit)
models.providers.*.apiKeymodels.providers.*.headers.*models.providers.*.request.auth.tokenmodels.providers.*.request.auth.valuemodels.providers.*.request.headers.*models.providers.*.request.proxy.tls.camodels.providers.*.request.proxy.tls.certmodels.providers.*.request.proxy.tls.keymodels.providers.*.request.proxy.tls.passphrasemodels.providers.*.request.tls.camodels.providers.*.request.tls.certmodels.providers.*.request.tls.keymodels.providers.*.request.tls.passphraseskills.entries.*.apiKeyagents.defaults.memorySearch.remote.apiKeyagents.list[].tts.providers.*.apiKeyagents.list[].memorySearch.remote.apiKeytalk.providers.*.apiKeymessages.tts.providers.*.apiKeytools.web.fetch.firecrawl.apiKeyplugins.entries.acpx.config.mcpServers.*.env.*plugins.entries.brave.config.webSearch.apiKeyplugins.entries.exa.config.webSearch.apiKeyplugins.entries.google.config.webSearch.apiKeyplugins.entries.xai.config.webSearch.apiKeyplugins.entries.moonshot.config.webSearch.apiKeyplugins.entries.perplexity.config.webSearch.apiKeyplugins.entries.firecrawl.config.webSearch.apiKeyplugins.entries.minimax.config.webSearch.apiKeyplugins.entries.tavily.config.webSearch.apiKeyplugins.entries.voice-call.config.realtime.providers.*.apiKeyplugins.entries.voice-call.config.streaming.providers.*.apiKeyplugins.entries.voice-call.config.tts.providers.*.apiKeyplugins.entries.voice-call.config.twilio.authTokentools.web.search.apiKeygateway.auth.passwordgateway.auth.tokengateway.remote.tokengateway.remote.passwordcron.webhookTokenchannels.telegram.botTokenchannels.telegram.webhookSecretchannels.telegram.accounts.*.botTokenchannels.telegram.accounts.*.webhookSecretchannels.slack.botTokenchannels.slack.appTokenchannels.slack.userTokenchannels.slack.signingSecretchannels.slack.accounts.*.botTokenchannels.slack.accounts.*.appTokenchannels.slack.accounts.*.userTokenchannels.slack.accounts.*.signingSecretchannels.discord.tokenchannels.discord.pluralkit.tokenchannels.discord.voice.tts.providers.*.apiKeychannels.discord.accounts.*.tokenchannels.discord.accounts.*.pluralkit.tokenchannels.discord.accounts.*.voice.tts.providers.*.apiKeychannels.irc.passwordchannels.irc.nickserv.passwordchannels.irc.accounts.*.passwordchannels.irc.accounts.*.nickserv.passwordchannels.bluebubbles.passwordchannels.bluebubbles.accounts.*.passwordchannels.feishu.appSecretchannels.feishu.encryptKeychannels.feishu.verificationTokenchannels.feishu.accounts.*.appSecretchannels.feishu.accounts.*.encryptKeychannels.feishu.accounts.*.verificationTokenchannels.qqbot.clientSecretchannels.qqbot.accounts.*.clientSecretchannels.msteams.appPasswordchannels.mattermost.botTokenchannels.mattermost.accounts.*.botTokenchannels.matrix.accessTokenchannels.matrix.passwordchannels.matrix.accounts.*.accessTokenchannels.matrix.accounts.*.passwordchannels.nextcloud-talk.botSecretchannels.nextcloud-talk.apiPasswordchannels.nextcloud-talk.accounts.*.botSecretchannels.nextcloud-talk.accounts.*.apiPasswordchannels.zalo.botTokenchannels.zalo.webhookSecretchannels.zalo.accounts.*.botTokenchannels.zalo.accounts.*.webhookSecretchannels.googlechat.serviceAccountquaserviceAccountRefđồng cấp (ngoại lệ tương thích)channels.googlechat.accounts.*.serviceAccountquaserviceAccountRefđồng cấp (ngoại lệ tương thích)
Đích auth-profiles.json (secrets configure + secrets apply + secrets audit)
profiles.*.keyRef(type: "api_key"; không được hỗ trợ khiauth.profiles.<id>.mode = "oauth")profiles.*.tokenRef(type: "token"; không được hỗ trợ khiauth.profiles.<id>.mode = "oauth")
Ghi chú:
- Các đích kế hoạch hồ sơ xác thực yêu cầu
agentId. - Các mục kế hoạch nhắm đến
profiles.*.key/profiles.*.tokenvà ghi các ref đồng cấp (keyRef/tokenRef). - Các ref hồ sơ xác thực được đưa vào phạm vi phân giải lúc chạy và kiểm tra.
- Trong
openclaw.json, SecretRefs phải dùng các đối tượng có cấu trúc như{"source":"env","provider":"default","id":"DISCORD_BOT_TOKEN"}. Chuỗi đánh dấu cũsecretref-env:<ENV_VAR>bị từ chối trên các đường dẫn thông tin xác thực SecretRef; chạyopenclaw doctor --fixđể di chuyển các dấu đánh dấu hợp lệ. - Bộ bảo vệ chính sách OAuth:
auth.profiles.<id>.mode = "oauth"không thể được kết hợp với đầu vào SecretRef cho hồ sơ đó. Khởi động/tải lại và phân giải hồ sơ xác thực sẽ thất bại nhanh khi chính sách này bị vi phạm. - Đối với các nhà cung cấp mô hình do SecretRef quản lý, các mục
agents/*/agent/models.jsonđược tạo sẽ lưu các dấu đánh dấu không bí mật (không phải giá trị bí mật đã phân giải) cho các bề mặtapiKey/header. - Việc lưu dấu đánh dấu lấy nguồn làm thẩm quyền: OpenClaw ghi dấu đánh dấu từ ảnh chụp nhanh cấu hình nguồn đang hoạt động (trước phân giải), không phải từ các giá trị bí mật lúc chạy đã phân giải.
- Đối với tìm kiếm web:
- Ở chế độ nhà cung cấp tường minh (đặt
tools.web.search.provider), chỉ khóa nhà cung cấp đã chọn là hoạt động. - Ở chế độ tự động (không đặt
tools.web.search.provider), chỉ khóa nhà cung cấp đầu tiên phân giải được theo thứ tự ưu tiên là hoạt động. - Ở chế độ tự động, các ref nhà cung cấp không được chọn được xem là không hoạt động cho đến khi được chọn.
- Các đường dẫn nhà cung cấp cũ
tools.web.search.*vẫn phân giải trong khoảng thời gian tương thích, nhưng bề mặt SecretRef chuẩn làplugins.entries.<plugin>.config.webSearch.*.
- Ở chế độ nhà cung cấp tường minh (đặt
Thông tin xác thực không được hỗ trợ
Thông tin xác thực ngoài phạm vi bao gồm:
commands.ownerDisplaySecrethooks.tokenhooks.gmail.pushTokenhooks.mappings[].sessionKeyauth-profiles.oauth.*channels.discord.threadBindings.webhookTokenchannels.discord.accounts.*.threadBindings.webhookTokenchannels.whatsapp.creds.jsonchannels.whatsapp.accounts.*.creds.json
Lý do:
- Các thông tin xác thực này thuộc các lớp được phát hành, xoay vòng, mang phiên, hoặc bền vững theo OAuth, không phù hợp với phân giải SecretRef bên ngoài chỉ đọc.