Skip to content

Commit

Permalink
Changes to address the review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
slahirucd7 committed May 6, 2024
1 parent 32ee6b6 commit e5ebf4f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion adapter/internal/discovery/xds/rate_limiter_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func (r *rateLimitPolicyCache) generateRateLimitConfig(label string) *rls_config
// domain: Default
// descriptors:
// - key: organisation
// Value: org001
// value: org001
// - key: subscription
// descriptors:
// - key: policy
Expand Down
30 changes: 26 additions & 4 deletions adapter/internal/discovery/xds/rate_limiter_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ func TestAddSubscriptionLevelRateLimitPolicy(t *testing.T) {
DefaultLimit: &types.SubscriptionDefaultLimit{
QuotaType: "requestCount",
RequestCount: &types.SubscriptionRequestCount{
RequestCount: 2147483647,
TimeUnit: "min",
RequestCount: 300,
TimeUnit: "hours",
},
},
Organization: "org1",
Expand All @@ -636,6 +636,28 @@ func TestAddSubscriptionLevelRateLimitPolicy(t *testing.T) {
},
Organization: "org2",
},
{
Name: "Unlimited",
DefaultLimit: &types.SubscriptionDefaultLimit{
QuotaType: "requestCount",
RequestCount: &types.SubscriptionRequestCount{
RequestCount: 2147483647,
TimeUnit: "min",
},
},
Organization: "carbon.super",
},
{
Name: "Unlimited",
DefaultLimit: &types.SubscriptionDefaultLimit{
QuotaType: "requestCount",
RequestCount: &types.SubscriptionRequestCount{
RequestCount: 2147483647,
TimeUnit: "min",
},
},
Organization: "org2",
},
},
}

Expand Down Expand Up @@ -668,8 +690,8 @@ func TestAddSubscriptionLevelRateLimitPolicy(t *testing.T) {
Key: "policy",
Value: "Unauthenticated",
RateLimit: &rls_config.RateLimitPolicy{
Unit: rls_config.RateLimitUnit_MINUTE,
RequestsPerUnit: 2147483647,
Unit: rls_config.RateLimitUnit_HOUR,
RequestsPerUnit: 300,
},
},
},
Expand Down

0 comments on commit e5ebf4f

Please sign in to comment.