Fixes #367.
On Linux the overseas chat leaves X-Tm out: the gateway refuses the
official "linux" value for plugin-only accounts (#367; menhouran got 200
with only X-Tm removed on x64; on arm64 only the platform values were
tried, not omission). Sign-in, refresh, wallets, check-in, CN chat and
macOS/Windows keep their headers.
An exact uncoded 403 "forbidden" (JSON or plain text) on both chat hosts
no longer reads as a dead token on its own: the wallets route decides.
It takes the token: 403 permission_error, sign-in kept. Every host
refuses it: 401, expired. Mixed or failed check: the upstream 403 goes
through with no X-Magpie-Sign-In, which magpie leaves unmarked.
signInHolds now says false only when every wallets host refused; for
sizeRefusal false and null already led to the same answer. 0.2.22.
Run at cd6da42dd (no live AutoClaw request, no credentials):
- WSL Ubuntu 24.04, Bun 1.4.2, temp HOME: bun test packages/autoclaw
117 pass 0 fail; root bun test 8189 pass 19 skip 0 fail;
bun scripts/check.mjs ok.
- Merged with origin/main f85f9ad0b: autoclaw 117 pass; root bun test
8192 pass 0 fail; check.mjs ok.
- Windows 11, temp HOME/USERPROFILE: autoclaw 117 pass 0 fail; check ok.
Broken by hand on WSL, one at a time, each red: X-Tm always set (2),
exact-message guard dropped (1), uncoded guard dropped (1), classifier
off (3), plain-text path off (1), wallets check skipped (3), unknown
read as expired (1), wallets refusal kept (1), signInHolds' any refusal
as false (1), unknown dropping the upstream body (1), res2 status guard
off (1), only host 2's fingerprint read (1).
Not caught: reading only host 1's fingerprint (a bare forbidden on host
2 alone after a different 403 on host 1) passes all tests.
Not tried: a real AutoClaw account; omission on arm64.
Co-authored-by: yetihan <roc.han@nio.com>
38 lines
1.1 KiB
JSON
38 lines
1.1 KiB
JSON
{
|
|
"name": "@magpie-community/opencode-autoclaw-auth",
|
|
"version": "0.2.22",
|
|
"description": "OpenCode provider plugin for AutoClaw (Zhipu OpenClaw): oversea web sign-in (Google/z.ai) and CN phone SMS, multi-account pool, credit balance and daily check-in",
|
|
"type": "module",
|
|
"main": "./opencode.mjs",
|
|
"exports": { ".": "./opencode2.mjs" },
|
|
"files": [
|
|
"index.mjs",
|
|
"opencode.mjs",
|
|
"opencode2.mjs",
|
|
"README.md",
|
|
"README.en.md"
|
|
],
|
|
"keywords": [
|
|
"opencode",
|
|
"opencode-plugin",
|
|
"magpie",
|
|
"autoclaw",
|
|
"zhipu",
|
|
"glm"
|
|
],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/autoclaw"
|
|
},
|
|
"magpie": {
|
|
"icon": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='32' cy='32' r='30' fill='%234f6ef7'/%3E%3Ctext x='32' y='42' font-size='28' text-anchor='middle' fill='white' font-family='sans-serif'%3E%E8%9F%B9%3C/text%3E%3C/svg%3E",
|
|
"options": {
|
|
"signin": true,
|
|
"signinHour": null,
|
|
"signinOnUsage": false
|
|
}
|
|
}
|
|
}
|