mirror of
https://github.com/penpot/penpot.git
synced 2026-08-07 13:29:07 +00:00
* 🐛 Demote unable-to-retrieve-user-info OIDC error to warning level 401 responses from the OIDC userinfo endpoint (e.g. expired/revoked GitHub token) are normal auth failures, not server errors. Logging at :error level triggers the database and Mattermost error reporters unnecessarily. AI-assisted-by: deepseek-v4-flash * ✨ Add pure function tests for OIDC auth module Add tests for: int-in-range?, valid-info?, qualify-prop-key, qualify-props, provider-has-email-verified?, profile-has-provider-props?, redirect-response, redirect-with-error, redirect-to-verify-token, and build-redirect-uri. AI-assisted-by: deepseek-v4-flash * ✨ Add HTTP-mock tests for fetch-user-info and fetch-access-token Replace with-redefs with binding (cf/config is ^:dynamic). Add tests for: fetch-user-info (success, 401, 500, request structure), fetch-access-token (success, 400 error). AI-assisted-by: deepseek-v4-flash * ✨ Add get-info integration tests with partial mocking Test all branches: token/userinfo/auto info sources, incomplete info, role checks (satisfied and insufficient), state props merge, sso-session-id from claims, and sso-provider-id for uuid providers. AI-assisted-by: deepseek-v4-flash * ✨ Add callback-handler integration tests with real tokens and session Tests all main branches: error param, no profile (registration disabled), profile blocked, provider mismatch, inactive profile, success flow, and graceful handling of unable-to-retrieve-user-info exception. Uses real tokens/generate, tokens/verify, and session/inmemory-manager. AI-assisted-by: deepseek-v4-flash