Skip to content

Commit 8d20205

Browse files
championshuttlerroboquat
authored andcommitted
Remove FORBIDDEN_SLUGS
1 parent 4257722 commit 8d20205

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

components/gitpod-db/src/typeorm/team-db-impl.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* See License-AGPL.txt in the project root for license information.
55
*/
66

7-
import { list as blocklist } from "the-big-username-blacklist";
87
import { Team, TeamMemberInfo, TeamMemberRole, TeamMembershipInvite, User } from "@gitpod/gitpod-protocol";
98
import { inject, injectable } from "inversify";
109
import { TypeORM } from "./typeorm";
@@ -16,39 +15,6 @@ import { DBTeamMembership } from "./entity/db-team-membership";
1615
import { DBUser } from "./entity/db-user";
1716
import { 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()
5420
export 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

Comments
 (0)