Milktea (Discord) has a Qoder CN enterprise dedicated domain on
<corp>.rdc.aliyuncs.com. Qoder IDE signs in to it through 「企业版专属域登录」
once the domain is set in its settings. The VPC method takes only
<instance>.vpc.qoder.com.cn, so it refused the domain.
The new method, "Sign in with Qoder CN Enterprise dedicated domain
(企业版专属域)", takes any https host. It follows Qoder IDE 1.38.0's
workbench (config.general.dedicatedUrl, _loginDedicatedWithProbe):
- It asks GET <domain>/algo/api/v1/version. A 404 is a Lingma 1.0
dedicated domain. Its sign-in is cosy's login/generateUrl with a
qoder-cn-ide:// callback, which this plugin doesn't serve, so it is
refused with what it is. Any other status is Qoder CN 2.0. If nothing
answers, the domain is refused (the IDE falls back to Lingma there).
- For 2.0, the domain's origin serves /device/selectAccounts, with the
IDE's client id f5a7f67c-… and no redirect_uri. The poll, user info,
tokens and usage go to <label>-openapi.<rest>, and models and chat to
<label>-gateway.<rest>. These hosts follow the IDE's RNc/TNc/JL0 rule,
which keeps the origin for an IP or a dotless host.
- Inferred: the IDE's language server picks the chat host, and its rule
wasn't read. The account chats on the gateway host if that host answers
at sign-in. If not, it chats on the domain itself, which answered on
/algo. The pick is kept as dedicatedApi.
The domain is kept on the account as `dedicated` (and `vpc`, for its
name suffix). siteOf routes it before the VPC rule. A kept domain that
isn't one is asked to sign in again, never sent to the public hosts.
Run (mote, bun 1.4.2): packages/qoder `bun test`, 355 pass, 0 fail
(dedicated.test.mjs 10, vpc.test.mjs 17 unchanged). `bun
scripts/check.mjs` passes.
Broken by hand: with siteOf's dedicated branch off, the 404 check off,
and the origin fallback off, 4 of the 10 dedicated tests went red
(Lingma refusal, gateway chat, origin fallback, renewal).
Not tried: any real dedicated account, either kind. The fixtures come
from the IDE's code, and the reply shapes are the VPC ones (#312). The
Lingma 1.0 path is not implemented.