Open the OpenBao login in pinned Playwright Chromium.
All checks were successful
CCR intake gate / gate (push) Successful in 14s
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s

The Windows default browser presented a signed-in Firefox session. The
launcher now starts coulomb-social's headed Playwright Chromium with a new
empty profile.

Assistant: grok
Assistant-Session: 01a198fa-fd27-7e41-a0a2-57355c3e4efd
This commit is contained in:
codex 2026-11-02 02:59:51 +01:00
parent 8cb5b13c77
commit 962aa9e262
5 changed files with 73 additions and 51 deletions

View file

@ -17,8 +17,26 @@ class BrowserBoundary(unittest.TestCase):
self.assertFalse(allowed('https://kc.coulomb.social/?redirect_uri=http://localhost:8250/oidc/callback&redirect_uri=https://evil.example'))
def test_launch_uses_empty_profile(self):
url='https://kc.coulomb.social/authorize?'+urlencode({'redirect_uri':'http://localhost:8250/oidc/callback'})
argv=launch_argv(r'C:\Edge\msedge.exe', r'C:\fresh\profile', url)
self.assertEqual(argv[0], r'C:\Edge\msedge.exe')
self.assertIn(r'--user-data-dir=C:\fresh\profile', argv)
browser='/cache/ms-playwright/chromium-1234/chrome-linux64/chrome'
argv=launch_argv(browser, '/tmp/fresh-profile', url)
self.assertEqual(argv[0], browser)
self.assertIn('--user-data-dir=/tmp/fresh-profile', argv)
self.assertEqual(argv[-1], url)
self.assertNotIn('explorer.exe', ' '.join(argv))
self.assertNotIn('--headless', argv)
joined=' '.join(argv)
for banned in ('explorer.exe', 'powershell', 'msedge', 'firefox', '/mnt/c/'):
self.assertNotIn(banned, joined)
def test_chromium_comes_from_the_playwright_pin(self):
import json
import tempfile
from pathlib import Path
with tempfile.TemporaryDirectory() as raw:
root=Path(raw)
spec=root/'browsers.json'
spec.write_text(json.dumps({'browsers':[{'name':'chromium','revision':'1234'},{'name':'firefox','revision':'1538'}]}))
binary=root/'chromium-1234'/'chrome-linux64'/'chrome'
binary.parent.mkdir(parents=True)
binary.write_text('')
binary.chmod(0o755)
self.assertEqual(launcher['chromium_executable'](spec, root), str(binary))
self.assertEqual(launcher['chromium_executable'](root/'missing.json', root), '')