1
0
forked from baron/baron-sso

Trusted RP 생성 흐름 테스트 추가

This commit is contained in:
2026-03-30 13:08:10 +09:00
parent 3a057ee860
commit cfe97ecb1e
4 changed files with 299 additions and 0 deletions

View File

@@ -8,6 +8,8 @@ import {
} from "./helpers/devfront-fixtures";
const appNamePlaceholder = /My Awesome Application|예: 멋진 애플리케이션/i;
const sshRsaPublicKey =
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAABwECAwQFBgc= test@example";
test.describe("DevFront clients lifecycle", () => {
test.beforeEach(async ({ page }) => {
@@ -120,4 +122,69 @@ test.describe("DevFront clients lifecycle", () => {
page.getByRole("textbox", { name: /인증 콜백 URL|Callback/i }),
).toHaveValue(/https:\/\/after\.example\.com\/callback/);
});
test("pkce trusted rp with inline ssh-rsa key should persist mapped payload", async ({
page,
}) => {
const state = {
clients: [makeClient("client-trusted", { name: "Trusted App", type: "pkce" })],
consents: [] as Consent[],
auditLogsByCursor: undefined,
};
await installDevApiMock(page, state);
await page.goto("/clients/client-trusted/settings");
await page
.getByRole("switch", {
name: /Trusted RP \(자체 로그인 UI 사용\)|Trusted RP \(Custom Login UI\)/i,
})
.click();
await expect(
page.getByRole("heading", {
name: /공개키 등록|Public Key Registration/i,
}),
).toBeVisible();
await page
.getByPlaceholder(
/ssh-rsa AAA\.\.\.|Paste an 'ssh-rsa AAA\.\.\.' public key first/i,
)
.fill(sshRsaPublicKey);
await page.getByRole("button", { name: /^저장$|^Save$/i }).click();
await expect.poll(() => state.clients[0]?.tokenEndpointAuthMethod).toBe(
"private_key_jwt",
);
await expect
.poll(() => state.clients[0]?.metadata?.headless_login_enabled)
.toBe(true);
await expect
.poll(
() =>
(state.clients[0]?.jwks as { keys?: Array<{ kty?: string; alg?: string }> })
?.keys?.[0]?.kty,
)
.toBe("RSA");
await expect
.poll(
() =>
(state.clients[0]?.jwks as { keys?: Array<{ kty?: string; alg?: string }> })
?.keys?.[0]?.alg,
)
.toBe("RS256");
await page.reload();
await expect(
page.getByRole("heading", {
name: /공개키 등록|Public Key Registration/i,
}),
).toBeVisible();
await expect(
page.getByPlaceholder(
/ssh-rsa AAA\.\.\.|Paste an 'ssh-rsa AAA\.\.\.' public key first/i,
),
).toHaveValue(/"kty": "RSA"/);
});
});