Project live domain trust readiness
This commit is contained in:
parent
6b1bb203df
commit
7a90fad360
5 changed files with 120 additions and 4 deletions
|
|
@ -2,8 +2,17 @@ export type DomainAccessStage = 'checking' | 'login-required' | 'identity-verifi
|
|||
|
||||
export interface DomainAccessProjection {
|
||||
blockers: string[];
|
||||
domainId?: string;
|
||||
nodeId?: string;
|
||||
runtimeReady: boolean;
|
||||
stage: DomainAccessStage;
|
||||
trustSource?: {
|
||||
reason?: 'ANCHOR_INVALID' | 'REGISTRY_INVALID' | 'SOURCE_UNAVAILABLE';
|
||||
registryVersion: string | null;
|
||||
signerCount: number;
|
||||
sourceCommit: string | null;
|
||||
status: 'CURRENT' | 'DEGRADED_LAST_KNOWN_GOOD' | 'UNAVAILABLE';
|
||||
};
|
||||
}
|
||||
|
||||
export interface DomainConnectionStep {
|
||||
|
|
@ -51,12 +60,31 @@ export function projectDomainConnectionSteps(access: DomainAccessProjection): Do
|
|||
return ordered.map(id => {
|
||||
const copy = stepCopy[id];
|
||||
const verified = access.runtimeReady || (!blockers.has(id) && access.stage !== 'checking');
|
||||
let detail = verified ? copy.verified : copy.pending;
|
||||
if (!verified && id === 'manifest' && access.trustSource) {
|
||||
if (access.trustSource.status === 'UNAVAILABLE') {
|
||||
detail = '当前无法回读灯塔的可信签名人登记表;系统保持关闭,不使用缓存猜测域权限';
|
||||
} else if (access.trustSource.status === 'DEGRADED_LAST_KNOWN_GOOD') {
|
||||
detail = '当前只能回读上一次可信签名人快照;实时来源恢复前不签发新的域权限';
|
||||
} else if (access.trustSource.signerCount === 0) {
|
||||
detail = '灯塔登记表已回读为当前版本,但尚未登记任何目标域签名人';
|
||||
}
|
||||
}
|
||||
return {
|
||||
id,
|
||||
label: copy.label,
|
||||
state: access.stage === 'checking' ? 'checking' : verified ? 'verified' : 'blocked',
|
||||
detail: access.stage === 'checking' ? '正在核对当前接入证据' : verified ? copy.verified : copy.pending,
|
||||
detail: access.stage === 'checking' ? '正在核对当前接入证据' : detail,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export function projectDomainTrustSource(access: DomainAccessProjection): string {
|
||||
const source = access.trustSource;
|
||||
if (!source) return '可信清单来源尚未由桌面运行时回读';
|
||||
if (source.status === 'UNAVAILABLE') return '可信清单来源不可用 · 域入口保持关闭';
|
||||
const commit = source.sourceCommit ? source.sourceCommit.slice(0, 8) : '未知提交';
|
||||
const version = source.registryVersion ?? '未知版本';
|
||||
const health = source.status === 'CURRENT' ? '当前' : '上次可信快照';
|
||||
return `可信清单 ${health} · v${version} · ${commit} · 已登记签名人 ${source.signerCount}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue