Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[server] move getToken api to separate group #20391

Merged
merged 1 commit into from
Nov 27, 2024
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