Skip to content

Commit 0289b61

Browse files
authored
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
1 parent 83c4314 commit 0289b61

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

src/config/groups.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { defineGroups } from './utils';
55
//
66
// Email groups (isEmailGroup: true) accept emails from anyone (including external users)
77
// and notify group members for each email.
8+
//
9+
// Groups are created on all platforms (GitHub and Google) by default.
10+
// To limit a group to specific platforms, set the onlyOnPlatforms array (e.g., onlyOnPlatforms: ['google']).
811
export const GROUPS = defineGroups([
912
{
1013
name: 'test-parent',
@@ -24,5 +27,12 @@ export const GROUPS = defineGroups([
2427
name: 'antitrust',
2528
description: 'Antitrust compliance contacts',
2629
isEmailGroup: true,
30+
onlyOnPlatforms: ['google'],
31+
},
32+
{
33+
name: 'catch-all',
34+
description: 'Catch-all email group',
35+
isEmailGroup: true,
36+
onlyOnPlatforms: ['google'],
2737
},
2838
] as const);

src/config/users.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ export const MEMBERS: readonly Member[] = [
66
email: 'adam@modelcontextprotocol.io',
77
memberOf: ['test-child'],
88
},
9+
{
10+
email: 'adamj@anthropic.com',
11+
memberOf: ['catch-all'],
12+
},
913
{
1014
email: 'davidsp@anthropic.com',
1115
memberOf: ['antitrust'],

src/config/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ function isValidGroupName(name: string): boolean {
44
return /^[a-z][a-z0-9-]*[a-z]$/.test(name);
55
}
66

7+
export type Platform = 'github' | 'google';
8+
79
export function defineGroups<
810
const T extends readonly {
911
name: Lowercase<string>;
1012
description: string;
1113
memberOf?: readonly (T[number]['name'])[];
1214
isEmailGroup?: boolean;
15+
onlyOnPlatforms?: readonly Platform[];
1316
}[]
1417
>(groups: T) {
1518
for (const group of groups) {
@@ -30,6 +33,7 @@ export interface Group {
3033
description: string;
3134
memberOf?: readonly GroupKey[];
3235
isEmailGroup?: boolean;
36+
onlyOnPlatforms?: readonly Platform[];
3337
}
3438

3539
export interface Member {

src/github.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import { MEMBERS } from './config/users';
66
const teams: Record<string, github.Team> = {};
77

88
GROUPS.forEach((group: Group) => {
9+
// Skip groups that don't include github in their platforms
10+
if (group.onlyOnPlatforms && !group.onlyOnPlatforms.includes('github')) return;
11+
912
teams[group.name] = new github.Team(group.name, {
1013
name: group.name,
1114
description: group.description + ' \n(Managed by github.com/modelcontextprotocol/access)',

src/google.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import { MEMBERS } from './config/users';
66
const groups: Record<string, gworkspace.Group> = {};
77

88
GROUPS.forEach((group: Group) => {
9+
// Skip groups that don't include google in their platforms
10+
if (group.onlyOnPlatforms && !group.onlyOnPlatforms.includes('google')) return;
11+
912
groups[group.name] = new gworkspace.Group(group.name, {
1013
email: `${group.name}@modelcontextprotocol.io`,
1114
name: group.name,

0 commit comments

Comments
 (0)