Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions components/server/src/auth/rate-limiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type GitpodServerMethodType =
| keyof Omit<GitpodServer, "dispose" | "setClient">
| typeof accessCodeSyncStorage
| typeof accessHeadlessLogs;
type GroupKey = "default" | "startWorkspace" | "createWorkspace" | "phoneVerification" | "sendHeartBeat";
type GroupKey = "default" | "startWorkspace" | "createWorkspace" | "phoneVerification" | "sendHeartBeat" | "getToken";
type GroupsConfig = {
[key: string]: {
points: number;
Expand Down Expand Up @@ -57,7 +57,7 @@ const defaultFunctions: FunctionsConfig = {
deleteOrgAuthProvider: { group: "default", points: 1 },
getConfiguration: { group: "default", points: 1 },
getGitpodTokenScopes: { group: "default", points: 1 },
getToken: { group: "default", points: 1 },
getToken: { group: "getToken", points: 1 },
deleteAccount: { group: "default", points: 1 },
getClientRegion: { group: "default", points: 1 },
getWorkspaces: { group: "default", points: 1 },
Expand Down Expand Up @@ -207,6 +207,10 @@ function getConfig(config: RateLimiterConfig): RateLimiterConfig {
points: 200, // 200 calls per user, per connection, per minute
durationsSec: 60,
},
getToken: {
points: 200, // 200 calls per user, per connection, per minute
durationsSec: 60,
},
startWorkspace: {
points: 3, // 3 workspace starts per user per 10s
durationsSec: 10,
Expand Down
Loading