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
This commit is contained in:
parent
83c4314971
commit
0289b61df4
5 changed files with 24 additions and 0 deletions
|
|
@ -5,6 +5,9 @@ import { defineGroups } from './utils';
|
|||
//
|
||||
// Email groups (isEmailGroup: true) accept emails from anyone (including external users)
|
||||
// and notify group members for each email.
|
||||
//
|
||||
// Groups are created on all platforms (GitHub and Google) by default.
|
||||
// To limit a group to specific platforms, set the onlyOnPlatforms array (e.g., onlyOnPlatforms: ['google']).
|
||||
export const GROUPS = defineGroups([
|
||||
{
|
||||
name: 'test-parent',
|
||||
|
|
@ -24,5 +27,12 @@ export const GROUPS = defineGroups([
|
|||
name: 'antitrust',
|
||||
description: 'Antitrust compliance contacts',
|
||||
isEmailGroup: true,
|
||||
onlyOnPlatforms: ['google'],
|
||||
},
|
||||
{
|
||||
name: 'catch-all',
|
||||
description: 'Catch-all email group',
|
||||
isEmailGroup: true,
|
||||
onlyOnPlatforms: ['google'],
|
||||
},
|
||||
] as const);
|
||||
|
|
@ -6,6 +6,10 @@ export const MEMBERS: readonly Member[] = [
|
|||
email: 'adam@modelcontextprotocol.io',
|
||||
memberOf: ['test-child'],
|
||||
},
|
||||
{
|
||||
email: 'adamj@anthropic.com',
|
||||
memberOf: ['catch-all'],
|
||||
},
|
||||
{
|
||||
email: 'davidsp@anthropic.com',
|
||||
memberOf: ['antitrust'],
|
||||
|
|
|
|||
|
|
@ -4,12 +4,15 @@ function isValidGroupName(name: string): boolean {
|
|||
return /^[a-z][a-z0-9-]*[a-z]$/.test(name);
|
||||
}
|
||||
|
||||
export type Platform = 'github' | 'google';
|
||||
|
||||
export function defineGroups<
|
||||
const T extends readonly {
|
||||
name: Lowercase<string>;
|
||||
description: string;
|
||||
memberOf?: readonly (T[number]['name'])[];
|
||||
isEmailGroup?: boolean;
|
||||
onlyOnPlatforms?: readonly Platform[];
|
||||
}[]
|
||||
>(groups: T) {
|
||||
for (const group of groups) {
|
||||
|
|
@ -30,6 +33,7 @@ export interface Group {
|
|||
description: string;
|
||||
memberOf?: readonly GroupKey[];
|
||||
isEmailGroup?: boolean;
|
||||
onlyOnPlatforms?: readonly Platform[];
|
||||
}
|
||||
|
||||
export interface Member {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ import { MEMBERS } from './config/users';
|
|||
const teams: Record<string, github.Team> = {};
|
||||
|
||||
GROUPS.forEach((group: Group) => {
|
||||
// Skip groups that don't include github in their platforms
|
||||
if (group.onlyOnPlatforms && !group.onlyOnPlatforms.includes('github')) return;
|
||||
|
||||
teams[group.name] = new github.Team(group.name, {
|
||||
name: group.name,
|
||||
description: group.description + ' \n(Managed by github.com/modelcontextprotocol/access)',
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ import { MEMBERS } from './config/users';
|
|||
const groups: Record<string, gworkspace.Group> = {};
|
||||
|
||||
GROUPS.forEach((group: Group) => {
|
||||
// Skip groups that don't include google in their platforms
|
||||
if (group.onlyOnPlatforms && !group.onlyOnPlatforms.includes('google')) return;
|
||||
|
||||
groups[group.name] = new gworkspace.Group(group.name, {
|
||||
email: `${group.name}@modelcontextprotocol.io`,
|
||||
name: group.name,
|
||||
|
|
|
|||
Loading…
Reference in a new issue