forked from baron/baron-sso
fix(headless-login): show parsed jwks n preview
- reproduce the missing n preview with the actual parsedKeys response shape - read nPreview from DevFront instead of the old n field - keep the preview text as provided by backend summaries
This commit is contained in:
@@ -102,12 +102,6 @@ function formatDateTime(value?: string) {
|
|||||||
return date.toLocaleString();
|
return date.toLocaleString();
|
||||||
}
|
}
|
||||||
|
|
||||||
function previewKeyMaterial(value?: string) {
|
|
||||||
if (!value) return "-";
|
|
||||||
if (value.length <= 23) return value;
|
|
||||||
return `${value.slice(0, 10)}...${value.slice(-10)}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function ClientGeneralPage() {
|
function ClientGeneralPage() {
|
||||||
const params = useParams();
|
const params = useParams();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@@ -1347,7 +1341,7 @@ function ClientGeneralPage() {
|
|||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
<p className="break-all rounded-lg border border-border bg-background px-3 py-2 font-mono text-[11px]">
|
<p className="break-all rounded-lg border border-border bg-background px-3 py-2 font-mono text-[11px]">
|
||||||
{previewKeyMaterial(key.n)}
|
{key.nPreview || "-"}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export type ClientDetailResponse = {
|
|||||||
kty?: string;
|
kty?: string;
|
||||||
use?: string;
|
use?: string;
|
||||||
alg?: string;
|
alg?: string;
|
||||||
n?: string;
|
nPreview?: string;
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -149,7 +149,8 @@ test.describe("DevFront clients lifecycle", () => {
|
|||||||
kty: "RSA",
|
kty: "RSA",
|
||||||
use: "sig",
|
use: "sig",
|
||||||
alg: "RS256",
|
alg: "RS256",
|
||||||
n: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",
|
nPreview:
|
||||||
|
"voVbHlo_UHkj...Hb8PiTCQ",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -229,7 +230,7 @@ test.describe("DevFront clients lifecycle", () => {
|
|||||||
await expect(page.getByText(algorithm, { exact: true }).last()).toBeVisible();
|
await expect(page.getByText(algorithm, { exact: true }).last()).toBeVisible();
|
||||||
}
|
}
|
||||||
await expect(
|
await expect(
|
||||||
page.getByText("abcdefghij...0123456789", { exact: true }),
|
page.getByText("voVbHlo_UHkj...Hb8PiTCQ", { exact: true }),
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
await expect(
|
await expect(
|
||||||
page.getByRole("button", { name: /refresh|새로고침/i }),
|
page.getByRole("button", { name: /refresh|새로고침/i }),
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export type Client = {
|
|||||||
kty?: string;
|
kty?: string;
|
||||||
use?: string;
|
use?: string;
|
||||||
alg?: string;
|
alg?: string;
|
||||||
n?: string;
|
nPreview?: string;
|
||||||
}>;
|
}>;
|
||||||
};
|
};
|
||||||
metadata?: Record<string, unknown>;
|
metadata?: Record<string, unknown>;
|
||||||
|
|||||||
Reference in New Issue
Block a user