Commit graph access/src/google.ts
Author SHA1 Message Date
claude[bot]
5917af2589
Declare allowExternalMembers on managed groups so deploys stop re-arming the external-member purge (#140)
* Declare allowExternalMembers on managed group settings

Every pulumi up was resetting the Google Workspace per-group setting
ALLOW_EXTERNAL_MEMBERS to false on all managed groups, because the
GroupSettings resources never declared allowExternalMembers and the
provider (SamuZad/googleworkspace 0.11.1) defaults the field to false.
Google then silently purges external-email members from affected groups
roughly 1-2 days after each apply, with no audit events.

Pin the setting to true for all managed groups. External membership
itself remains governed exclusively by config/users.ts entries; this
setting only permits it.

Part of the #133 incident.

* Scope allowExternalMembers per group, derived from membership config

Instead of permitting external members on every managed group, derive
allowExternalMembers per group: true only for groups whose membership
config (config/users.ts) resolves at least one member to a
non-@modelcontextprotocol.io email. Email resolution is factored into
resolveGoogleMemberEmail and shared with GroupMember creation so the
two cannot drift. The field stays declared on every group because the
provider defaults it to false on each apply, after which Google
silently purges external members (#133 incident).

With current config, exactly these groups derive true: maintainers,
registry-wg, antitrust, catch-all. A config test pins this set so
changes to it are always deliberate.

* Make allowExternalMembers an explicit per-role opt-in with config validation

Replace the derived per-group allowExternalMembers (computed from
membership config) with an explicit opt-in: group owners set
allowExternalMembers: true on the role's google config in
src/config/roles.ts, and src/google.ts passes it straight through to
GroupSettings (defaulting to false). The field stays declared on every
group because the provider resets an omitted field to false on each
apply, after which Google silently purges external members (#133).

Roles opting in, matching current membership: maintainers,
registry-maintainers (registry-wg), antitrust, catch-all.

A validate-config check replaces the old pinned-set test: it fails with
an actionable error whenever a group has a member resolving to a
non-@modelcontextprotocol.io email but its role does not opt in, naming
the group, the member email, and the exact config line to add.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-07-03 01:19:16 +00:00
Paul Carleton
9d584ea6cf Suppress googleworkspace permadiffs in preview output
- GroupSettings: ignoreChanges on isArchived (upstream
  hashicorp/terraform-provider-googleworkspace#398)
- OrgUnit: drop the stale import option; it was only needed for the
  initial adopt and now triggers a re-compare on every preview
2026-06-17 11:07:13 -07:00
David Soria Parra
ec18773746 fix: stop importing existing GWS users into Pulumi state
The GWS provider validates email types during import, but GWS itself
returns empty types for primary/alias emails. This causes unrecoverable
validation errors on every new user import. Instead, skip managing
existing users entirely and let group memberships be created directly.

Also marks den as existingGWSUser.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:55:09 +00:00
David Soria Parra
520ccc7bd8 fix: ignoreChanges on all user-managed fields for GWS users
After creation/import we only care that the user exists and is in the
right groups. All profile settings (name, recovery info, password,
org unit, etc.) are left to users and admins to manage directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:22:17 +00:00
David Soria Parra
f916271ed9 fix: ignore recoveryEmail and recoveryPhone on imported GWS users
These are user-managed fields that shouldn't be touched by IaC.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:20:06 +00:00
David Soria Parra
56ccba8a79 fix: only ignoreChanges on description, parentOrgUnitPath is required by provider
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:11:52 +00:00
David Soria Parra
09bc0fc0b8 fix: add ignoreChanges and match existing description to prevent OrgUnit update
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:09:53 +00:00
David Soria Parra
48904bb454 fix: add back parentOrgUnitPath (required by provider)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:05:51 +00:00
David Soria Parra
9d8906075d fix: drop parentOrgUnitPath and description from OrgUnit to avoid update after import
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:04:08 +00:00
David Soria Parra
dca636df65 fix: import existing OrgUnit by ID 03ph8a2z0nc6rsr
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 23:59:44 +00:00
David Soria Parra
9fe97a1d2a fix: create OrgUnit resource before provisioning GWS users
The orgUnitPath '/Model Context Protocol' was hardcoded but the OU
didn't exist in Pulumi state, causing INVALID_OU_ID errors for all
user creates/updates. Create it as a Pulumi resource and wire up
dependsOn so users are provisioned after the OU exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 23:41:53 +00:00
David Soria Parra
2de77b8684
Add Google Workspace user account provisioning (#66)
* Add Google Workspace user account provisioning

* Fix validation: remove stale skipGoogleUserProvisioning from a-akimov, add it for BobDickinson

- a-akimov: had skipGoogleUserProvisioning but is not in a provisionUser role (DOCS_MAINTAINERS)
- BobDickinson: is in REGISTRY_MAINTAINERS (provisionUser role) but missing Google user fields
2026-02-19 22:17:25 +00:00
David Soria Parra
f960494174
Add Discord role sync with role-centric architecture (#22)
* Add Discord role sync with role-centric architecture

This refactors the access management to use a role-centric model where
each role explicitly defines which platforms it exists on (GitHub,
Discord, Google).

Key changes:
- Add Discord role sync via Pulumi Dynamic Provider
- Replace groups.ts with roleIds.ts + roles.ts for type-safe role definitions
- Use ROLE_IDS constants to prevent typos in memberOf references
- Each role has platform-specific config (github/discord/google keys)
- Discord-only roles (e.g., administrators) and GitHub-only roles
  (e.g., typescript-sdk-auth) are now explicitly modeled
- Add PR preview workflow to show Pulumi changes before merge
- Add test-config.ts for config structure validation
- Fix typo: docs-maintaners -> docs-maintainers

Discord roles will match existing server roles:
- administrators, lead maintainers, core maintainers
- sdk maintainers, working groups, interest groups
- etc.

Requires new GitHub secrets:
- DISCORD_BOT_TOKEN
- DISCORD_GUILD_ID

* Fix GitHub team ordering and make Discord integration optional

- Add topological sort for GitHub teams to ensure parent teams are
  created before child teams, fixing the registry-wg parentTeamId issue
- Make Discord integration optional by using config.get() instead of
  config.require(), allowing CI preview to succeed without Discord secrets
- Add sortRolesByGitHubDependency() utility function in config/utils.ts

Claude-Generated-By: Claude Code (cli/claude-opus-4-5=20%)
Claude-Steers: 2
Claude-Permission-Prompts: 1
Claude-Escapes: 0

* Reconcile Discord roles for listed users

Replace per-role-membership approach with per-user role sync that:
- Adds missing roles users should have
- Removes managed roles users shouldn't have
- Only touches roles defined in config (won't affect admin roles, etc.)

Users not in config remain untouched.

Claude-Generated-By: Claude Code (cli/claude-opus-4-5=100%)
Claude-Steers: 4
Claude-Permission-Prompts: 1
Claude-Escapes: 0

* Fix descriptions to match existing resources

* Cache Pulumi plugins and fix GITHUB_TOKEN for pulumi install

* Remove accidentally committed state backup

* Use github.token for pulumi install

* Fix formatting

Fix deploy: add pulumi login before config set

Fix deploy: set PULUMI_CONFIG_PASSPHRASE_FILE for config commands

Import existing docs-maintainers team (remove after deploy)

Remove docs-maintainers import workaround

Add docs-maintainers cleanup to state cleanup

Add pulumi refresh before up to sync state with reality

Rename Discord roles to add (synced) suffix

Cleanup Makefile and add lead-maintainers GitHub team
2026-01-13 23:35:18 +00:00
David Soria Parra
3c1d641add
Add prettier formatting and CI validation checks
- Add prettier with consistent formatting config
- Add format and format:check npm scripts
- Add prettier pre-commit hook
- Add validation and formatting checks to CI workflow
- Reformat all TypeScript and JSON files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-13 10:01:28 +00:00
adam jones
7883dbc5e3
Migrate GitHub teams to infrastructure-as-code (#5)
* Migrate GitHub teams to infrastructure-as-code

- Add 25 teams with proper hierarchy (steering-committee, SDK teams, working groups, interest groups)
- Add 67 team members with their assignments
- Add repository access configuration for all 21 repositories
- Refactor github.ts to use config-driven approach with repoAccess.ts
- Mark all MCP teams as GitHub-only with onlyOnPlatforms
- Use RepositoryCollaborators for authoritative access management

Note: GitHub Projects V2 permissions are not yet supported by Pulumi and must be managed manually. See https://github.com/pulumi/pulumi-github/issues/1006

* Add individual user collaborators to repository access

Preserves direct collaborator access for users who have explicit permissions outside of team membership, including:
- jspahrsummers: admin on multiple core repos
- Go SDK collaborators (neild, rsc, rolandshoemaker, h9jiang)
- C# SDK collaborators (jeffhandley, MackinnonBuck, jozkee, localden, PederHP)
- Rust SDK collaborators (jamadeo, jokemanfire, 4t145)
- Inspector collaborators (richardkmichael, olaservo, an-dustin, ashwin-ant)
- Financial services IG collaborators (aniabot, imfing, sambhav, KengoA, nitsanh)
- And others

Without this, RepositoryCollaborators (authoritative mode) would remove all individual user access.
2025-10-03 22:02:52 +00:00
adam jones
0289b61df4
Add catch-all email group and platform filtering (#3)
- Add catch-all email group with admin-adam@modelcontextprotocol.io
- Add onlyOnPlatforms configuration to restrict groups to specific platforms
- Set antitrust and catch-all groups to Google only
- Groups default to all platforms when onlyOnPlatforms is not specified
2025-10-01 00:59:04 +01:00
adam jones
83c4314971
Add antitrust email group (#2)
Sets up antitrust@modelcontextprotocol.io email group
2025-10-01 00:50:47 +01:00
Adam Jones
744709c087
Improve clarity of comments for google groups 2025-09-22 14:01:32 +00:00
Adam Jones
e3f0af2f94
Initial commit 2025-09-20 02:47:33 +00:00