Skip to content

IBX-12493: Treated CI web origins as secure contexts in browser tests - #203

Merged
alongosz merged 1 commit into
6.0from
ibx-12493-secure-context-browser-tests
Sep 10, 2026
Merged

IBX-12493: Treated CI web origins as secure contexts in browser tests#203
alongosz merged 1 commit into
6.0from
ibx-12493-secure-context-browser-tests

Conversation

@alongosz

@alongosz alongosz commented Sep 9, 2026

Copy link
Copy Markdown
Member
🎫 Issue IBX-12493

Related PRs:

Description:

Browser tests drive Chrome against http://web (or http://varnish). Neither is a secure context, so secure-only browser APIs are simply absent there. First victim: crypto.randomUUID() used by @ibexa/ai-assistant-ui. With ibexa/headless#303 every admin page in CI logs TypeError: crypto.randomUUID is not a function and the AI Assistant dies in its error boundary, so nothing actually tests it. See the JS console errors in job 102164857371.

  • Added --unsafely-treat-insecure-origin-as-secure=http://web,http://varnish to the Chrome args in behat_ibexa_oss.php. It's Chrome's own switch for exactly this case: comma-separated origins, exact scheme/host/port match (network_switches.cc). nginx, Varnish and Symfony keep speaking plain HTTP, only the browser treats the origin as trustworthy.

Checked on a local Headless 6.0 instance served over HTTPS: the assistant renders and crypto.randomUUID() works, so the real code path is fine. CI just never exercised it.

Note

The alternative is real TLS in the docker stack (ibexa/docker, recipes, WEB_HOST, Chrome cert flags, forwarded-proto). Much bigger change and, as far as the JS is concerned, it tests nothing more than this flag does. WDYT?

For QA:

Review. After merge, ibexa/headless#303 browser tests should show no randomUUID console errors. The Taxonomy failure there is a separate issue (the AI Assistant's hidden tag-picker modal matches TagPicker::confirm()'s XPath first).

Documentation:

No documentation required.

🤖 Generated with Claude Code

Chrome reaches the site as http://web (http://varnish on Varnish
setups). Neither is a secure context, so secure-only browser APIs
such as crypto.randomUUID() do not exist there and code relying on
them crashes before any scenario can exercise it. Chrome's own
switch --unsafely-treat-insecure-origin-as-secure marks those two
origins as trustworthy without changing the docker stack.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

alongosz added a commit to ibexa/headless that referenced this pull request Sep 9, 2026
Points browser tests at the Behat config that treats http://web and
http://varnish as secure contexts, so the AI Assistant bundle runs
instead of crashing on crypto.randomUUID.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@alongosz
alongosz marked this pull request as ready for review September 10, 2026 09:26
@alongosz
alongosz merged commit 210eb0f into 6.0 Sep 10, 2026
20 checks passed
@alongosz
alongosz deleted the ibx-12493-secure-context-browser-tests branch September 10, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants