From 8633ab77a79a59ba0dfbf01ab6dca72da64f3eae Mon Sep 17 00:00:00 2001 From: lyon Date: Mon, 15 Jun 2026 15:12:24 +0800 Subject: [PATCH] fix: clarify account access CLI roles --- tools/src/hwlab-cli-lib.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/src/hwlab-cli-lib.ts b/tools/src/hwlab-cli-lib.ts index 47998a51..e258e184 100644 --- a/tools/src/hwlab-cli-lib.ts +++ b/tools/src/hwlab-cli-lib.ts @@ -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),