Files
computer-playbook/tests/unit/python
kevinveenbirkenbachandClaude Opus 5.5 8fdfa6ef51 feat(web-app-semaphore): sign in on the onion sibling as well as on clearnet
Semaphore v2.19.17 builds its post-login redirect from its one WebHost
(url.JoinPath(WebHost, return)), marks the session cookie Secure when
WebHost is https, and registered a single OIDC provider whose
redirect_url is clearnet. A login started on the onion sibling therefore
lost the oauthstate cookie at the clearnet callback and the session on
the plain-http onion origin: semaphore#0 of run 40625679270 failed five
login and design specs in PASS 2, where Playwright picked the .onion
sibling ("http: named cookie not present" 24 times in the container
log, while LDAP accepted the rotated credentials six times).

Semaphore keys OIDC providers by id from the URL path and gives each its
own redirect_url, so when the role has an onion sibling and SSO is on:

- a second provider keycloak_onion, same issuer, client and claims, with
  the onion sibling's plaintext redirect_url; Keycloak's redirect_uris
  lookup already registers http://<onion>/*;
- the onion vhost rewrites the absolute WebHost redirects to relative
  ones (proxy_redirect) and drops Secure from the semaphore cookie
  (proxy_cookie_flags), next to the existing base-href rewrite;
- location = /api/auth/login filters the provider list per vhost with
  sub_filter, so clearnet offers keycloak and the onion vhost
  keycloak_onion, both labelled as before; each dropped provider has a
  pattern for either list position because Semaphore does not fix the
  order.

Without an onion sibling the provider JSON and both proxy hooks render
exactly as before. test_onion_login renders the vars through Ansible's
templar for both cases; 16 of its 18 tests fail against the previous
files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 02:29:59 +01:00
..