fix: clarify account access CLI roles

This commit is contained in:
lyon
2026-06-15 15:12:24 +08:00
parent dbdac6e68a
commit 8633ab77a7
+3 -3
View File
@@ -3080,18 +3080,18 @@ function accessStatusBodyForCli(body: any, parsed: ParsedArgs) {
if (parsed.full === true) return redactUserQueryBody(body);
const source = body?.data && typeof body.data === "object" ? body.data : body;
const routes = source?.routes && typeof source.routes === "object" ? Object.keys(source.routes).sort() : undefined;
const roleCatalog = arrayOfText(source?.roles ?? body?.roles);
return pruneUndefined({
ok: body?.ok,
authenticated: source?.authenticated ?? body?.authenticated,
actor: actorForCli(source?.actor ?? body?.actor),
user: actorForCli(source?.user ?? body?.user),
role: text(source?.role ?? body?.role) || undefined,
role: text(source?.role ?? body?.role ?? source?.actor?.role ?? body?.actor?.role) || undefined,
authMethod: text(source?.authMethod ?? body?.authMethod) || undefined,
permissions: arrayOfText(source?.permissions ?? body?.permissions),
scopes: arrayOfText(source?.scopes ?? body?.scopes),
roles: arrayOfText(source?.roles ?? body?.roles),
tools: source?.tools,
routes,
roleCatalogCount: roleCatalog?.length,
routeCount: routes?.length,
key: apiKeyMetadataForCli(source?.key ?? source?.apiKey ?? body?.key ?? body?.apiKey),
error: errorForCli(body?.error),