Add bridge device login and cloud credential resolution

Implement the phase-three client: device-code login (auth login/logout/bridge) with a 0600 token file, cloud credential resolution with an in-memory cache, pre-minted Hose token injection via tokenType/tokenName, cloud Seal sessions without local renewal, elevation guards, and a local-only doctor check. Cloud enterprises still avoid tokens.json.
This commit is contained in:
gitea committed 2026-11-19 17:48:58 +08:00
1 parent 887df2d32f
commit 71a2e9a2e3
19 files changed
+964 -84

No files matched your search

+6
View File
@@ -406,6 +406,12 @@ export async function extractKeysFromLinkAction(link: string, options: { reveal?
export async function showCorpKeysAction(targetCorpId: string | undefined, options: { reveal?: boolean }) {
const corp = selectCorp(targetCorpId);
const reveal = options.reveal === true;
if ((corp.storage ?? "local") === "cloud") {
throw new CliError(
`企业「${corp.name}」(id: ${corp.id}) 使用云端凭据,本地不提供密钥查看或提权。\n请在桥接平台的凭据管理中维护该企业。`,
2
);
}
if (corp.source.type !== "hose") {
throw new CliError(`【合思子域专享能力】当前企业「${corp.name}」(id: ${corp.id}) 为原生 Seal (${corp.source.type}) 租户,非合思 (Hose/合思云/易快报) 渠道企业。\n` +
"OpenAPI 密钥查询与提权能力专属于合思生态租户(用于从合思协助链接或合思凭据中提取开发者密钥提升权限等级),非合思渠道企业不支持此能力。", 2);