Skip to content

Commit feba8e8

Browse files
committed
Apply specialized rate-limits to many endpoints (experimental)
1 parent fad53bc commit feba8e8

60 files changed

Lines changed: 543 additions & 37 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
namespace Refresh.Core.RateLimits.Activity;
2+
3+
public static class ActivityPageEndpointLimits
4+
{
5+
public const int TimeoutDuration = 300;
6+
public const int GameRequestAmount = 25;
7+
public const int ApiRequestAmount = 65;
8+
public const int BlockDuration = 240;
9+
public const string GameRequestBucket = "activity-game";
10+
public const string ApiRequestBucket = "activity-api";
11+
12+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Refresh.Core.RateLimits.Challenges;
2+
3+
public static class ChallengeListEndpointLimits
4+
{
5+
public const int TimeoutDuration = 420;
6+
public const int RequestAmount = 20;
7+
public const int BlockDuration = 300;
8+
public const string RequestBucket = "challenge-list";
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Refresh.Core.RateLimits.Challenges;
2+
3+
public static class ChallengeScoreListEndpointLimits
4+
{
5+
public const int TimeoutDuration = 420;
6+
public const int RequestAmount = 25;
7+
public const int BlockDuration = 300;
8+
public const string RequestBucket = "challenge-score-list";
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Refresh.Core.RateLimits.Challenges;
2+
3+
public static class ChallengeScoreUploadEndpointLimits
4+
{
5+
public const int TimeoutDuration = 420;
6+
public const int RequestAmount = 12;
7+
public const int BlockDuration = 300;
8+
public const string RequestBucket = "challenge-score-upload";
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Refresh.Core.RateLimits.Challenges;
2+
3+
public static class ChallengeSingleScoreEndpointLimits
4+
{
5+
public const int TimeoutDuration = 420;
6+
public const int RequestAmount = 18;
7+
public const int BlockDuration = 300;
8+
public const string RequestBucket = "challenge-single-score";
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Refresh.Core.RateLimits.Challenges;
2+
3+
public static class ChallengeUploadEndpointLimits
4+
{
5+
public const int TimeoutDuration = 420;
6+
public const int RequestAmount = 10;
7+
public const int BlockDuration = 300;
8+
public const string RequestBucket = "challenge-upload";
9+
}

Refresh.Core/RateLimits/Comments/CommentListEndpointLimits.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Refresh.Core.RateLimits.Comment;
1+
namespace Refresh.Core.RateLimits.Comments;
22

33
public static class CommentListEndpointLimits
44
{

Refresh.Core/RateLimits/Comments/CommentUploadEndpointLimits.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Refresh.Core.RateLimits.Comment;
1+
namespace Refresh.Core.RateLimits.Comments;
22

33
public static class CommentUploadEndpointLimits
44
{

Refresh.Core/RateLimits/Comments/SingleCommentEndpointLimits.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Refresh.Core.RateLimits.Comment;
1+
namespace Refresh.Core.RateLimits.Comments;
22

33
public static class SingleCommentEndpointLimits
44
{
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace Refresh.Core.RateLimits.Contests;
2+
3+
// treat getting one and getting a list as the same for now
4+
public static class ContestGetEndpointLimits
5+
{
6+
public const int TimeoutDuration = 420;
7+
public const int RequestAmount = 10;
8+
public const int BlockDuration = 300;
9+
public const string RequestBucket = "contests";
10+
}

0 commit comments

Comments
 (0)