test(lasuite-docs): update stale OIDC tests for impress v5.4.0 Bearer-auth removal #12
Reference in New Issue
Block a user
No description provided.
Delete Branch "test/lasuite-docs-stale-test-20260803"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stale-test fix: lasuite-docs OIDC tests vs impress v5.4.0 Bearer-auth removal
Stale tests:
tests/lasuite-docs/custom/test_oidc_login.py::test_oidc_login_via_keycloakandtests/lasuite-docs/custom/test_create_doc.py::test_create_doc_and_read_back.What changed upstream: impress v5.4.0 removed Bearer/JWT authentication on the API —
the backend now only accepts its own session cookie (Django
SessionAuthentication) establishedthrough the OIDC authorization-code flow. Both tests authenticated with
Authorization: Bearer <password-grant JWT>and went RED with401 "Authentication credentials were not provided"on the v5.4.1 upgrade(drone build #1136 on the paired recipe PR).
The fix — successor auth path, no assertion weakened:
_oidc_session.pydrives the real OIDC authorization-code login(app → keycloak login form → callback → session cookie; CSRF headers on unsafe methods).
Recipe-local per the
tests/ghost/custom/_ghost.pyprecedent — promote torunner/harnessif a third recipe needs it.
test_oidc_login: keeps the unauth-challenge assertion; adds an assertion that a rawBearer JWT is now rejected (401/403 — the v5.4.0 hardening as the new correct behavior);
then asserts the session-authenticated
/api/v1.0/users/me/returns the provisioned user.test_create_doc: identical create + read-back round-trip assertions, now over thesession-authenticated API.
Paired recipe upgrade PR (the pair goes green together):
recipe-maintainers/lasuite-docs#7 (carry-over from
/upgrade-all 2026-07-24; also flagged 2026-07-31).
Lint:
ruff check+ruff format --checkclean on the changed files with the repo dev-shellruff (0.15.14). Note:
test_oidc_with_keycloak.pyhas pre-existing format drift onmain(untouched here).
Opened for visibility/historical record; merged directly once the paired verification is green
(the
/cc-ci-tests-updateinvocation is the authorization).Verified GREEN — cold full-suite ×1 against the paired recipe PR head (
upgrade-505e53c@ f772297f), with this branch's tests applied on cc-ci:install/upgrade/backup/restore/custom all pass (log:
verify-lasuite-docs-20260803T204348Z.1.log).The OIDC authorization-code session login works against the live v5.4.1 deploy, and the raw-Bearer rejection assertion confirms the v5.4.0 hardening.
Merging directly per policy: PR opened for visibility/historical record; the /cc-ci-tests-update invocation is the authorization.