qoder 0.2.53: Qoder CN signs in to an enterprise dedicated domain (企业版专属域)

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.
This commit is contained in:
yetone
2026-11-02 18:57:34 +08:00
parent bcd60af045
commit 731277004a
4 changed files with 409 additions and 3 deletions
+37
View File
@@ -315,6 +315,43 @@ paths, client id and protocol are the public ones:
The hosts and reply shapes come from a real VPC account's report
(yetone/magpie#312). This plugin has not been tried with a VPC account.
### Enterprise dedicated domain (企业版专属域)
An enterprise whose Qoder IDE signs in through 「企业版专属域登录」 with a
domain of its own (any https host, such as `your-corp.rdc.aliyuncs.com`)
signs in with **Sign in with Qoder CN Enterprise dedicated domain
(企业版专属域)** (since 0.2.53). It asks for the domain as it is set in
Qoder IDE's settings: a host or an https address (a path is dropped).
It follows Qoder IDE 1.38.0's own rules for that setting:
- It first asks `GET <domain>/algo/api/v1/version`. A 404 means a legacy
Lingma 1.0 (通义灵码) dedicated domain. Its sign-in goes through another
protocol, which this plugin doesn't have yet, so the sign-in stops and
says so. Any other answer means Qoder CN 2.0. A domain that doesn't answer
is refused.
- A Qoder CN 2.0 domain uses the VPC protocol on hosts named the IDE's way:
`-openapi` or `-gateway` after the host's first label. An IP or a host
with no dot keeps its own origin. The sign-in uses the IDE's client id and
no `redirect_uri`.
| | Dedicated domain `your-corp.rdc.aliyuncs.com` |
|---|---|
| Sign-in page | your-corp.rdc.aliyuncs.com/device/selectAccounts |
| Accounts: poll, tokens, user info, usage | your-corp-openapi.rdc.aliyuncs.com |
| Models and chat | your-corp-gateway.rdc.aliyuncs.com |
- Models and chat use the gateway host when it answers at sign-in.
Otherwise they use the domain itself, which answered the probe on the
same `/algo` path. The IDE's language server makes this choice, and its
rule wasn't read, so this part is inferred.
- The domain is kept with the account, which is named
`<email> (<domain>)`. An account whose kept domain isn't one is asked to
sign in again; it is never sent to the public hosts.
The rules come from Qoder IDE's code. This plugin has not been tried with a
dedicated account.
## The card's name
An account signed in with a phone is shown by that phone — masked, `138****8000` — not by
+249
View File
@@ -0,0 +1,249 @@
// Qoder CN enterprise dedicated domains (企业版专属域), such as Milktea's
// <corp>.rdc.aliyuncs.com, against a local stand-in for the domain's hosts.
// Nothing here comes from a real dedicated account: the rules are read from
// Qoder IDE 1.38.0's workbench (config.general.dedicatedUrl):
// - its probe GETs <domain>/algo/api/v1/version; 404 is a Lingma 1.0
// dedicated domain, any other status Qoder CN 2.0;
// - a 2.0 domain signs in at <origin>/device/selectAccounts with the IDE's
// client id and no redirect_uri, and polls and reads the user on the host
// named with "-openapi" after its first label ("-gateway" for its gateway);
// an IP or a host with no dot keeps its origin.
// The account shapes are the VPC ones (vpc.test.mjs): the same protocol.
import { afterAll, afterEach, beforeAll, expect, test } from "bun:test"
import { QoderAuthPlugin, QoderCNAuthPlugin, _internal } from "./index.mjs"
const IDE_CLIENT = "f5a7f67c-11a8-491e-8b8e-a07f2d0df4b7"
const WEB = "corp.rdc.aliyuncs.com"
const OPENAPI = "corp-openapi.rdc.aliyuncs.com"
const GATEWAY = "corp-gateway.rdc.aliyuncs.com"
const PUBLIC = ["qoder.cn", "openapi.qoder.com.cn", "gateway.qoder.com.cn", "openapi.qoder.sh", "api3.qoder.sh"]
let server
let route = () => new Response("", { status: 404 })
let seen = []
let unreachable = new Set()
const real = globalThis.fetch
beforeAll(() => {
server = Bun.serve({
port: 0,
async fetch(req) {
const u = new URL(req.url)
const host = req.headers.get("x-qoder-host")
const body = req.method === "GET" ? "" : await req.text()
seen.push({ host, path: u.pathname, query: u.searchParams, method: req.method, headers: req.headers, body })
return route(host + u.pathname, { req, url: u, body })
},
})
})
afterAll(() => server.stop(true))
const toServer = () => {
globalThis.fetch = async (input, init = {}) => {
const u = new URL(typeof input === "string" ? input : input instanceof URL ? input.href : input.url)
if (unreachable.has(u.host)) throw new TypeError(`getaddrinfo ENOTFOUND ${u.hostname}`)
const headers = new Headers(init.headers)
headers.set("x-qoder-host", u.host)
return real(`http://127.0.0.1:${server.port}${u.pathname}${u.search}`, { ...init, headers })
}
}
afterEach(() => {
globalThis.fetch = real
route = () => new Response("", { status: 404 })
seen = []
unreachable = new Set()
})
const json = (v, status = 200) => new Response(JSON.stringify(v), { status, headers: { "Content-Type": "application/json" } })
function store(initial) {
let auth = initial
return {
client: { auth: { set: async ({ body }) => (auth = body) } },
get: async () => auth,
auth: () => auth,
}
}
const hostsOf = () => [...new Set(seen.map((s) => s.host))]
const noPublic = () => expect(hostsOf().filter((h) => PUBLIC.includes(h))).toEqual([])
const dedicatedMethod = (hooks) => hooks.auth.methods.find((m) => m.prompts?.some((p) => p.key === "dedicated"))
test("a dedicated domain is read as the IDE reads config.general.dedicatedUrl: a host or https address, path dropped", () => {
for (const v of ["corp.rdc.aliyuncs.com", " corp.rdc.aliyuncs.com/ ", "https://corp.rdc.aliyuncs.com", "https://corp.rdc.aliyuncs.com/", "https://corp.rdc.aliyuncs.com/some/path?x=1", "HTTPS://CORP.rdc.aliyuncs.com"])
expect([v, _internal.dedicatedOrigin(v)]).toEqual([v, "https://" + WEB])
expect(_internal.dedicatedOrigin("https://corp.example.com:8443")).toBe("https://corp.example.com:8443")
for (const v of ["", " ", "http://corp.rdc.aliyuncs.com", "https://u:p@corp.rdc.aliyuncs.com", "ftp://corp.rdc.aliyuncs.com", "https://"])
expect([v, _internal.dedicatedOrigin(v)]).toEqual([v, undefined])
})
test("its openapi and gateway hosts are the IDE's: the suffix after the first label, an IP or dotless host kept", () => {
const h = _internal.dedicatedHost
expect(h("https://" + WEB, "-openapi")).toBe("https://" + OPENAPI)
expect(h("https://" + WEB, "-gateway")).toBe("https://" + GATEWAY)
expect(h("https://acme.vpc.qoder.com.cn", "-openapi")).toBe("https://acme-openapi.vpc.qoder.com.cn")
expect(h("https://corp.example.com:8443", "-gateway")).toBe("https://corp-gateway.example.com:8443")
for (const o of ["https://10.0.0.5", "https://10.0.0.5:8443", "https://[::1]", "https://intranet"]) expect([o, h(o, "-openapi")]).toEqual([o, o])
expect(_internal.dedicatedSite(_internal.SITES["qoder-cn"], WEB)).toMatchObject({
id: "qoder-cn",
web: "https://" + WEB,
openapi: "https://" + OPENAPI,
api: "https://" + GATEWAY,
clientId: IDE_CLIENT,
redirect: "",
vpc: WEB,
dedicated: WEB,
})
})
test("only Qoder CN has the dedicated method, after the ones it had", async () => {
const hooks = await QoderCNAuthPlugin({ client: store().client })
expect(hooks.auth.methods[0].label).toBe("Sign in with Qoder CN")
const m = dedicatedMethod(hooks)
expect(hooks.auth.methods.at(-1)).toBe(m)
expect(m.label).toBe("Sign in with Qoder CN Enterprise dedicated domain (企业版专属域)")
expect(m.prompts[0].validate("corp.rdc.aliyuncs.com")).toBeUndefined()
expect(m.prompts[0].validate("http://corp.rdc.aliyuncs.com")).toContain("Not a dedicated domain")
expect(dedicatedMethod(await QoderAuthPlugin({ client: store().client }))).toBeUndefined()
})
test("a Qoder CN 2.0 dedicated sign-in probes, opens the domain's page and polls and reads the user on its openapi host", async () => {
toServer()
let polls = 0
route = (at, { url, body, req }) => {
// the IDE counts any status but 404 as 2.0
if (at === WEB + "/algo/api/v1/version") return new Response("<html></html>", { status: 200 })
if (at === GATEWAY + "/algo/api/v1/version") return new Response("", { status: 401 })
if (at === OPENAPI + "/api/v1/deviceToken/poll") {
expect(url.searchParams.get("challenge_method")).toBe("S256")
return ++polls < 2 ? new Response("", { status: 404 }) : json({ token: "dt-ded", refresh_token: "drt-ded", user_id: "u-ded" })
}
if (at === OPENAPI + "/api/v1/me/jobToken") {
expect(JSON.parse(body)).toEqual({ clientId: IDE_CLIENT })
return json({ message: "client not allowed" }, 403)
}
if (at === OPENAPI + "/api/v1/userinfo") {
expect(req.headers.get("authorization")).toBe("Bearer dt-ded")
return json({ id: "u-ded", name: "Milk", email: "milk@corp.example" })
}
return new Response("", { status: 404 })
}
const flow = await dedicatedMethod(await QoderCNAuthPlugin({ client: store().client })).authorize({ dedicated: "https://corp.rdc.aliyuncs.com/" })
const u = new URL(flow.url)
expect(u.origin + u.pathname).toBe("https://" + WEB + "/device/selectAccounts")
expect(u.searchParams.get("client_id")).toBe(IDE_CLIENT)
expect(u.searchParams.has("redirect_uri")).toBe(false)
const cred = await flow.callback()
expect(cred).toMatchObject({
type: "success",
access: "dt-ded",
deviceChat: true,
uid: "u-ded",
accountId: `milk@corp.example (${WEB})`,
vpc: WEB,
dedicated: WEB,
})
expect(cred.dedicatedApi).toBeUndefined()
expect(hostsOf()).toEqual([WEB, GATEWAY, OPENAPI])
}, 10_000)
test("a domain that answers 404 at /algo/api/v1/version is Lingma 1.0 and is refused before any sign-in", async () => {
toServer()
route = () => new Response("", { status: 404 })
const m = dedicatedMethod(await QoderCNAuthPlugin({ client: store().client }))
await expect(m.authorize({ dedicated: WEB })).rejects.toThrow("Lingma 1.0")
expect(seen.map((s) => s.host + s.path)).toEqual([WEB + "/algo/api/v1/version"])
})
test("a domain that doesn't answer is refused, never read as either kind", async () => {
toServer()
unreachable.add(WEB)
const m = dedicatedMethod(await QoderCNAuthPlugin({ client: store().client }))
await expect(m.authorize({ dedicated: WEB })).rejects.toThrow("didn't answer")
})
const MODEL = { key: "performance", display_name: "Performance", enable: true, is_reasoning: true, max_input_tokens: 180000, format: "openai", source: "system", tags: [] }
const sse = (...chunks) =>
new Response(chunks.map((c) => `data: ${JSON.stringify({ statusCodeValue: 200, body: JSON.stringify(c) })}\n\n`).join(""), { headers: { "Content-Type": "text/event-stream" } })
const signedIn = (over = {}) => ({
type: "oauth",
access: "dt-ded",
refresh: "drt-ded",
expires: Date.now() + 3_600_000,
deviceChat: true,
accountId: `milk@corp.example (${WEB})`,
uid: "u-ded",
machineId: "m-ded",
deviceToken: "dt-ded",
deviceRefresh: "drt-ded",
vpc: WEB,
dedicated: WEB,
...over,
})
const chat = { model: "performance", messages: [{ role: "user", content: "hi" }] }
const served = (host) => (at) => {
if (at === host + "/algo/api/v2/model/list") return json({ chat: [MODEL] })
if (at === host + "/algo/api/v2/service/pro/sse/agent_chat_generation") return sse({ choices: [{ index: 0, delta: { content: "OK" }, finish_reason: "stop" }] })
return new Response("", { status: 404 })
}
test("a dedicated account's chat and list go to its gateway host, never the public ones", async () => {
toServer()
route = served(GATEWAY)
const s = store(signedIn())
const opts = await (await QoderCNAuthPlugin({ client: s.client })).auth.loader(s.get)
expect(opts.baseURL).toBe("https://" + GATEWAY)
const res = await opts.fetch(opts.baseURL + "/chat/completions", { method: "POST", body: JSON.stringify(chat) })
expect(res.status).toBe(200)
expect((await res.json()).choices[0].message.content).toBe("OK")
expect(hostsOf()).toEqual([GATEWAY])
noPublic()
})
test("when the gateway host doesn't answer at sign-in, the account chats on the domain's own origin", async () => {
toServer()
unreachable.add(GATEWAY)
route = (at) => {
if (at === WEB + "/algo/api/v1/version") return json({ version: "x" })
if (at === OPENAPI + "/api/v1/deviceToken/poll") return json({ token: "dt-ded", refresh_token: "drt-ded", user_id: "u-ded" })
if (at === OPENAPI + "/api/v1/me/jobToken") return json({}, 403)
if (at === OPENAPI + "/api/v1/userinfo") return json({ id: "u-ded", email: "milk@corp.example" })
return new Response("", { status: 404 })
}
const flow = await dedicatedMethod(await QoderCNAuthPlugin({ client: store().client })).authorize({ dedicated: WEB })
const cred = await flow.callback()
expect(cred.dedicatedApi).toBe("https://" + WEB)
seen = []
route = served(WEB)
const s = store({ ...signedIn(), ...cred, type: "oauth" })
const opts = await (await QoderCNAuthPlugin({ client: s.client })).auth.loader(s.get)
expect(opts.baseURL).toBe("https://" + WEB)
expect((await opts.fetch(opts.baseURL + "/chat/completions", { method: "POST", body: JSON.stringify(chat) })).status).toBe(200)
expect(hostsOf()).toEqual([WEB])
}, 10_000)
test("a dedicated device token is renewed on its openapi host", async () => {
toServer()
route = (at) => {
if (at === OPENAPI + "/api/v1/deviceToken/refresh")
return json({ device_token: "dt-ded-2", refresh_token: "drt-ded-2", expires_at: new Date(Date.now() + 7_200_000).toISOString() })
return served(GATEWAY)(at)
}
const s = store(signedIn({ expires: Date.now() + 60_000 }))
const opts = await (await QoderCNAuthPlugin({ client: s.client })).auth.loader(s.get)
const res = await opts.fetch(opts.baseURL + "/chat/completions", { method: "POST", body: JSON.stringify(chat) })
expect(res.status).toBe(200)
expect(s.auth()).toMatchObject({ access: "dt-ded-2", deviceToken: "dt-ded-2", dedicated: WEB })
expect(seen[0].host + seen[0].path).toBe(OPENAPI + "/api/v1/deviceToken/refresh")
noPublic()
})
test("an account whose dedicated domain on record isn't one is not sent to the public hosts", async () => {
toServer()
route = served("gateway.qoder.com.cn")
const s = store(signedIn({ dedicated: "http://nope" }))
const hooks = await QoderCNAuthPlugin({ client: s.client })
const ms = await hooks.provider.models({ models: {} }, { auth: s.auth() }).catch(() => ({}))
expect(Object.keys(ms)).toEqual([])
noPublic()
})
+121 -1
View File
@@ -315,6 +315,104 @@ function vpcSite(site, instance) {
return { ...site, web: `https://${name}.${d}`, openapi: `https://${name}-openapi.${d}`, api: `https://${name}-gateway.${d}`, vpc: name }
}
// ---- enterprise dedicated domain (Qoder CN 企业版专属域) ----------------------
//
// Qoder IDE (1.38.0) signs in to an enterprise's dedicated domain from its
// config.general.dedicatedUrl (Settings, 「企业版专属域登录」), any https host
// such as <corp>.rdc.aliyuncs.com, not only <instance>.vpc.qoder.com.cn. It
// first asks GET <domain>/algo/api/v1/version: a 404 is a legacy Lingma 1.0
// (通义灵码) dedicated domain, signed in to through another protocol; any
// other status is Qoder CN 2.0, signed in to with the same device flow as
// qoder.cn: /device/selectAccounts on the domain's origin, and the poll and
// user info on an openapi host named by putting "-openapi" after the host's
// first label (foo.rdc.aliyuncs.com → foo-openapi.rdc.aliyuncs.com; its
// gateway host is the same with "-gateway"). An IP, a bracketed IPv6 host or
// a host with no dot keeps its origin. The workbench's client id there is
// the IDE's production one.
const DEDICATED_CLIENT = "f5a7f67c-11a8-491e-8b8e-a07f2d0df4b7"
const DEDICATED_VERSION = "/algo/api/v1/version"
// dedicatedOrigin is the https origin of what the user entered as their
// dedicated domain: a host or an https:// address, a path dropped as the
// IDE drops it for sign-in. undefined: not one (http://, credentials, no host).
function dedicatedOrigin(input) {
let e = String(input ?? "").trim()
if (!e) return undefined
if (!/^[a-z][a-z\d+.-]*:\/\//i.test(e)) e = `https://${e}`
let u
try {
u = new URL(e)
} catch {
return undefined
}
if (u.protocol !== "https:" || u.username || u.password || !u.hostname) return undefined
return u.origin
}
// dedicatedHost is origin's host with suffix after its first label, as the
// IDE's helper names a dedicated domain's openapi and gateway hosts; origin
// itself for an IP, an IPv6 host or a host with no dot.
function dedicatedHost(origin, suffix) {
const u = new URL(origin)
const h = u.hostname
if (!h || (h.startsWith("[") && h.endsWith("]")) || h.includes(":") || /^\d{1,3}(\.\d{1,3}){3}$/.test(h)) return origin
const i = h.indexOf(".")
if (i <= 0 || i === h.length - 1) return origin
const host = `${h.slice(0, i)}${suffix}.${h.slice(i + 1)}`
return `${u.protocol}//${u.port ? `${host}:${u.port}` : host}`
}
// dedicatedSite is site served from a dedicated domain (its host, as kept on
// the account), with api its chat host when the sign-in found the gateway
// host unreachable and chose the domain's own origin; undefined: not one.
function dedicatedSite(site, domain, api) {
const origin = dedicatedOrigin(domain)
if (!origin) return undefined
const host = new URL(origin).host
return {
...site,
web: origin,
openapi: dedicatedHost(origin, "-openapi"),
api: api ? dedicatedOrigin(api) ?? dedicatedHost(origin, "-gateway") : dedicatedHost(origin, "-gateway"),
clientId: DEDICATED_CLIENT,
redirect: "",
vpc: host,
dedicated: host,
}
}
// dedicatedProbe is the status GET <origin>/algo/api/v1/version answers, as
// the IDE's probe asks it; undefined when nothing answered.
async function dedicatedProbe(origin) {
try {
const r = await fetch(origin + DEDICATED_VERSION, { headers: { "User-Agent": "Qoder" }, signal: AbortSignal.timeout(10_000) })
await r.body?.cancel().catch(() => {})
return r.status
} catch {
return undefined
}
}
// dedicatedSignIn reads the domain as the IDE does and starts its device
// sign-in. A legacy Lingma domain is refused with what it is: its sign-in
// (cosy's login/generateUrl, a qoder-cn-ide:// callback) isn't served here.
// The chat host is the gateway host when it answers at all, else the
// domain's own origin, which answered the probe on the same /algo path; the
// IDE leaves this to its language server, whose rule wasn't read (inferred).
async function dedicatedSignIn(site, input) {
const origin = dedicatedOrigin(input)
if (!origin) throw new Error(`Not a dedicated domain: ${String(input ?? "").slice(0, 100)}`)
const status = await dedicatedProbe(origin)
if (status === undefined) throw new Error(`${site.name}: ${origin} didn't answer (${DEDICATED_VERSION}); check the address and your network`)
if (status === 404)
throw new Error(
`${site.name}: ${origin} is a Lingma 1.0 (通义灵码) dedicated domain, which this plugin can't sign in to yet; ${new URL(origin).host} answers 404 at ${DEDICATED_VERSION}, as Qoder IDE tells one apart`,
)
const gateway = dedicatedHost(origin, "-gateway")
const api = gateway !== origin && (await dedicatedProbe(gateway)) === undefined ? origin : undefined
return deviceSignIn(dedicatedSite(site, origin, api))
}
// siteOf is the site an account is served from: its VPC instance's when it
// was signed in to one, else site. An instance on record that names none
// is not read as "no VPC", which would send the enterprise's tokens to the
@@ -327,6 +425,11 @@ function siteOf(site, a) {
const base = `https://${a.enterpriseHost}`
return { ...site, web: base, openapi: base, api: base, vpc: a.enterpriseHost }
}
if (a?.dedicated) {
const s = dedicatedSite(site, a.dedicated, a.dedicatedApi)
if (!s) throw new SignInGone(`${site.name}: the account's dedicated domain "${a.dedicated}" isn't one; sign in again`)
return s
}
if (a?.vpc === undefined || a?.vpc === null || a?.vpc === "") return site
const s = vpcSite(site, a.vpc)
if (!s) throw new SignInGone(`${site.name}: the account's VPC instance "${a.vpc}" isn't one; sign in again`)
@@ -418,6 +521,7 @@ async function deviceSignIn(site) {
deviceRefresh: dt.refresh_token ?? "",
...(site.vpc ? { vpc: site.vpc } : {}),
...(site.enterpriseDomain ? { vpc: site.enterpriseDomain, enterpriseHost: site.enterpriseDomain } : {}),
...(site.dedicated ? { dedicated: site.dedicated, ...(site.api !== dedicatedHost(site.web, "-gateway") ? { dedicatedApi: site.api } : {}) } : {}),
}
},
}
@@ -3167,6 +3271,22 @@ const makePlugin = (site) => async ({ client }) => {
return deviceSignIn(s)
},
},
// an enterprise dedicated domain (企业版专属域), as Qoder IDE's
// settings take one: any https host, e.g. <corp>.rdc.aliyuncs.com
{
type: "oauth",
label: `Sign in with ${site.name} Enterprise dedicated domain (企业版专属域)`,
prompts: [
{
type: "text",
key: "dedicated",
message: "Your enterprise's dedicated domain, as set in Qoder IDE (企业版专属域地址)",
placeholder: "your-corp.rdc.aliyuncs.com or https://your-corp.rdc.aliyuncs.com",
validate: (v) => (dedicatedOrigin(v) ? undefined : "Not a dedicated domain: enter its host or https:// address"),
},
],
authorize: (inputs) => dedicatedSignIn(site, inputs?.dedicated),
},
]
: []),
],
@@ -3302,4 +3422,4 @@ export async function QwenWorkEnterpriseAuthPlugin({ client }) {
export const protocol = { makePlugin, deviceSignIn, openapi, siteOf }
// for tests
export const _internal = { freeView, maskPhone, phoneLabelOf, realEmailOf, chatHeaders, machineOS, machineHostname, cosyHeaders, typedUnions, Splitter, campaignRuntime, RUNTIMES, campaignPage, campaignTarget, vpcInstance, vpcSite, parseUsage, gfmt, when, failure, modelInfo, qoderBody, qoderMessages, cacheMarked, sessionOf, namedSession, taskOf, TASKS, TASK_MAX, TASK_IDLE, SESSION, SITES, decodeBody, events, QUEUE, queueState }
export const _internal = { freeView, maskPhone, phoneLabelOf, realEmailOf, chatHeaders, machineOS, machineHostname, cosyHeaders, typedUnions, Splitter, campaignRuntime, RUNTIMES, campaignPage, campaignTarget, vpcInstance, vpcSite, dedicatedOrigin, dedicatedHost, dedicatedSite, parseUsage, gfmt, when, failure, modelInfo, qoderBody, qoderMessages, cacheMarked, sessionOf, namedSession, taskOf, TASKS, TASK_MAX, TASK_IDLE, SESSION, SITES, decodeBody, events, QUEUE, queueState }
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@magpie-community/opencode-qoder-auth",
"version": "0.2.52",
"description": "Qoder and QwenWork (千问办公) subscriptions in OpenCode and magpie: qoder.com, qoder.cn, gateway.qwenwork.cn and the enterprise flagship (VPC)",
"version": "0.2.53",
"description": "Qoder and QwenWork (千问办公) subscriptions in OpenCode and magpie: qoder.com, qoder.cn, gateway.qwenwork.cn and the enterprise flagship, VPC and dedicated domains",
"type": "module",
"main": "./index.mjs",
"exports": "./index.mjs",