From c25fd41bf715485b8a6d5a873691ec7d94ee50af Mon Sep 17 00:00:00 2001 From: Petr Simecek Date: Sun, 26 Apr 2026 00:56:44 +0200 Subject: [PATCH] feat(auth): Google Workspace groups on /profile + tag-triggered Keboola deploy workflow (#56) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(auth): display Google Workspace groups on /profile - Request cloud-identity.groups.readonly scope in Google OAuth - Fetch groups via Cloud Identity API after callback; tolerate 4xx (non-Workspace tenants) and network errors — never break login - Store result in Starlette session as google_groups - Replace /profile redirect with a real profile page rendering account details (email, name, role) and the group list; show a friendly empty state when no groups are available - Tests: helper parsing + 403 + exception paths; profile page smoke test; updated the old redirect test * test: remove stale /profile redirect tests Cherry-pick of Zdeněk's 4f7e4cd ("display Google Workspace groups on /profile") replaces the /profile redirect with a real profile page — but only updated one of three tests that expected the old behaviour. These two tests in test_admin_tokens_ui.py and test_pat.py were left asserting `/profile → 302 /tokens`, which now returns `/profile → 302 /login?next=%2Fprofile` for unauth users (the standard auth guard) or `/profile → 200 HTML` for authenticated users. Removed both rather than patched — coverage for the new behaviour already exists in tests/test_auth_providers.py (added by the same commit). The /tokens render assertions in the deleted test_pat.py case are redundant with test_admin_tokens_ui.py's own /tokens UI tests. * fix(auth): Google groups search query needs parent + labels predicates Cloud Identity Groups Search API returns 400 INVALID_ARGUMENT when the CEL query lacks the required `parent == 'customers/'` predicate AND a `'