Add auto-forwarding of java.no emails to personal email#123
Merged
Conversation
When the team-provisioner creates or syncs hero accounts, it now sets up Gmail auto-forwarding so all mail to the java.no address is forwarded to the member's personal email (with a copy kept in inbox). Uses domain-wide delegation to impersonate each user via the Gmail Settings API — forwarding addresses are accepted without verification.
Terraform Plan🚧 Changes detected — Plan: 0 to add, 1 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟢 LOW Routine Lambda function code update for team_provisioner with source code hash change.
|
The token expiry was changed to 60 days but the docstring on handle_resend_password_link still referenced "48h".
Terraform Plan🚧 Changes detected — Plan: 0 to add, 1 to change, 0 to destroy. Plan outputLLM ReviewRisk: 🟢 LOW Routine Lambda function code update for team_provisioner with source code hash change.
|
Alexanderamiri
added a commit
that referenced
this pull request
May 9, 2026
## Summary - When the team-provisioner creates or syncs hero accounts, it now sets up Gmail auto-forwarding so all mail to the java.no address is forwarded to the member's personal email (copy kept in inbox) - Uses domain-wide delegation to impersonate each user via the Gmail Settings API — forwarding addresses are accepted without verification - Applies to both new and existing accounts (idempotent — skips already-configured forwarding) ## Changes - Added `gmail.settings.sharing` scope to `GOOGLE_SCOPES` - New `_get_user_google_access_token()` — mints per-user JWT tokens (cached) - New `_setup_email_forwarding()` — registers forwarding address + enables auto-forwarding - Called after account creation in `handle_sync_groups_and_heros` for both new and existing accounts ## Prerequisites - `gmail.settings.sharing` scope added to domain-wide delegation in Google Admin console ✅ ## Test plan - [ ] Deploy Lambda, then merge registry PR #21 (members sync) - [ ] Verify forwarding is active on a newly created java.no account - [ ] Verify forwarding is set up for an existing account (e.g. alexander.amiri@java.no)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
gmail.settings.sharingscope toGOOGLE_SCOPES_get_user_google_access_token()— mints per-user JWT tokens (cached)_setup_email_forwarding()— registers forwarding address + enables auto-forwardinghandle_sync_groups_and_herosfor both new and existing accountsPrerequisites
gmail.settings.sharingscope added to domain-wide delegation in Google Admin console ✅Test plan