44 * See License-AGPL.txt in the project root for license information.
55 */
66
7- import { list as blocklist } from "the-big-username-blacklist" ;
87import { Team , TeamMemberInfo , TeamMemberRole , TeamMembershipInvite , User } from "@gitpod/gitpod-protocol" ;
98import { inject , injectable } from "inversify" ;
109import { TypeORM } from "./typeorm" ;
@@ -16,39 +15,6 @@ import { DBTeamMembership } from "./entity/db-team-membership";
1615import { DBUser } from "./entity/db-user" ;
1716import { DBTeamMembershipInvite } from "./entity/db-team-membership-invite" ;
1817
19- const FORBIDDEN_SLUGS = [
20- 'access-control' ,
21- 'account' ,
22- 'admin' ,
23- 'blocked' ,
24- 'branches' ,
25- 'from-referrer' ,
26- 'install-github-app' ,
27- 'integrations' ,
28- 'issues' ,
29- 'login' ,
30- 'merge-requests' ,
31- 'new' ,
32- 'notifications' ,
33- 'oauth-approval' ,
34- 'plans' ,
35- 'prebuilds' ,
36- 'preferences' ,
37- 'projects' ,
38- 'pull-requests' ,
39- 'settings' ,
40- 'setup' ,
41- 'snapshots' ,
42- 'sorry' ,
43- 'start' ,
44- 'subscription' ,
45- 'teams' ,
46- 'upgrade-subscription' ,
47- 'usage' ,
48- 'variables' ,
49- 'workspaces' ,
50- ...( blocklist ) ,
51- ] . sort ( ( a , b ) => b > a ? - 1 : 1 ) ;
5218
5319@injectable ( )
5420export class TeamDBImpl implements TeamDB {
@@ -129,9 +95,6 @@ export class TeamDBImpl implements TeamDB {
12995 throw new Error ( 'Please choose a team name containing only letters, numbers, -, _, \', or spaces.' ) ;
13096 }
13197 const slug = name . toLocaleLowerCase ( ) . replace ( / [ ' ] / g, '-' ) ;
132- if ( FORBIDDEN_SLUGS . indexOf ( slug ) !== - 1 ) {
133- throw new Error ( 'Creating a team with this name is not allowed' ) ;
134- }
13598 const userRepo = await this . getUserRepo ( ) ;
13699 const existingUsers = await userRepo . query ( 'SELECT COUNT(id) AS count FROM d_b_user WHERE fullName LIKE ? OR name LIKE ?' , [ name , slug ] ) ;
137100 if ( Number . parseInt ( existingUsers [ 0 ] . count ) > 0 ) {
0 commit comments