@shad70w0 on X: "magpie + Trae 插件实测没办法走企业订阅" - a Trae enterprise
subscription couldn't be used through this plugin. The sign-in URL sent
hide_saas_login=true (copied from the relays in 6c048c7), which hides the
enterprise/SSO sign-in on www.trae.cn/authorization and
www.trae.ai/authorization, so an enterprise user could only sign in as a
personal account.
What changed:
- the authorization URL sends hide_saas_login=false.
- traeHost: a host a sign-in names is taken only when it is a well-formed
https host (no port, credentials, query) on trae.cn, trae.ai or
mchost.guru; anything else is ignored and the consumer host used, as
before.
- Trae CN: a sign-in host on mchost.guru / trae-api-*, or another trae.cn
host than www/api/grow*, is the account's model host. Trae Global: a
trae.ai host other than www/api-*/grow* is too, after the existing
US/coresg rules. Personal hosts (api.trae.cn, api-us-east, api-sg-central,
growsg-normal, coresg-normal) route as before.
- the sign-in's host (host), a token host the callback names (authHost /
auth_host / userInfo.AuthHost, on the realm's own domain only) and the
userInfo's tenant/enterprise/login-type fields (account; no field that
looks like a secret) are kept in the auth record. Renewal (sign-in and
refresh) goes to authHost when one is kept. Nothing new is sent.
- README: enterprise sign-in is offered, not tried with a real enterprise
account.
Run: bun test in packages/trae (103 pass, 6 new in enterprise.test.mjs);
the whole repo's bun test with HOME under a scratch TMPDIR (1168 pass, 0
fail); bun scripts/check.mjs. Each change broken by hand turns
enterprise.test.mjs red: hide_saas_login back to true, no enterprise CN
host, no domain check, http allowed, refresh at the consumer host, no
account kept, api.trae.cn taken as a model host, a secret-looking field kept.
Not tried: no real enterprise account. Which host(s) and fields an
enterprise sign-in sends back is unknown; the hosts in the tests are made
up, and whether the callback ever names an auth host is a guess.
13 lines
592 B
JSON
13 lines
592 B
JSON
{
|
|
"name": "@magpie-community/opencode-trae-auth",
|
|
"version": "0.2.10",
|
|
"description": "OpenCode provider plugins for Trae: Trae CN (trae.cn) and Trae Global (trae.ai), free tier included, with Trae's own browser sign-in",
|
|
"type": "module",
|
|
"main": "./index.mjs",
|
|
"exports": "./index.mjs",
|
|
"files": ["index.mjs", "README.md"],
|
|
"keywords": ["opencode", "opencode-plugin", "magpie", "trae", "trae-cn", "trae-global", "bytedance"],
|
|
"license": "MIT",
|
|
"repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/trae" }
|
|
}
|