feat: snapshot Linux-first RMM MVP and pause handover
Rust development slice / linux (push) Failing after 1m10s
Rust development slice / linux (push) Failing after 1m10s
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// Real Chromium navigation with an isolated NSS truststore, no TLS bypass/artifacts.
|
||||
const { chromium } = require('../../web/node_modules/playwright');
|
||||
(async () => {
|
||||
const browser = await chromium.launch({
|
||||
headless: true,
|
||||
env: { ...process.env, HOME: process.env.RMM_OIDC_TEST_BROWSER_HOME },
|
||||
args: ['--host-resolver-rules=MAP rmm-dev.internal 127.0.0.1', '--no-proxy-server'],
|
||||
});
|
||||
try {
|
||||
const page = await browser.newPage();
|
||||
await page.goto(process.env.RMM_OIDC_TEST_ORIGIN + '/auth/oidc/login');
|
||||
await page.getByRole('button', { name: 'Authorize simulated test login' }).click();
|
||||
await page.waitForURL(process.env.RMM_OIDC_TEST_ORIGIN + '/');
|
||||
const result = await page.evaluate(async () => {
|
||||
const session = await fetch('/auth/session');
|
||||
const value = await session.json();
|
||||
return { status: session.status, simulation: value.testsimulation, principal: value.principal, csrf: Boolean(value.csrf_token) };
|
||||
});
|
||||
if (result.status !== 200 || result.simulation !== true || !result.csrf || result.principal !== process.env.RMM_OIDC_TEST_PRINCIPAL) throw new Error('browser contract failed');
|
||||
const cookies = await page.context().cookies();
|
||||
const session = cookies.find(c => c.name === '__Host-rmm_session');
|
||||
if (!session || !session.httpOnly || !session.secure || session.sameSite !== 'Strict' || cookies.some(c => c.name === '__Host-rmm_oidc_binding')) throw new Error('cookie contract failed');
|
||||
const logout = await page.evaluate(async () => {
|
||||
const s = await (await fetch('/auth/session')).json();
|
||||
const response = await fetch('/auth/logout', { method: 'POST', headers: { 'X-CSRF-Token': s.csrf_token } });
|
||||
return { logout: response.status, after: (await fetch('/auth/session')).status };
|
||||
});
|
||||
if (logout.logout !== 204 || logout.after !== 401) throw new Error('logout contract failed');
|
||||
console.log('PASS real Chromium OIDC code/PKCE/nonce/state + cross-site Lax callback, strict final session, simulated-test label and logout; no job approval');
|
||||
} finally { await browser.close(); }
|
||||
})().catch(() => { console.error('FAIL OIDC browser test (private details suppressed)'); process.exitCode = 1; });
|
||||
Reference in New Issue
Block a user