AnonymousSpottedToad/securityPatternsRecovery / ground_truth /java /limit_request_rate__spring-cloud_spring-cloud-gateway.json
| { | |
| "role_mappings": [ | |
| { | |
| "patternRole": "Entity", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Requests come from external HTTP clients outside the repo; no in-repo client targets the RequestRateLimiter filter (spring-cloud-gateway-sample has no rate-limit usage; tests excluded).", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Enforcer", | |
| "entity": "apply", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/factory/RequestRateLimiterGatewayFilterFactory.java", | |
| "lines": "111", | |
| "notes": "apply in RequestRateLimiterGatewayFilterFactory returns the GatewayFilter lambda that resolves the entity key via KeyResolver.resolve (default PrincipalNameKeyResolver, line 119), calls limiter.isAllowed(routeId, key) at line 132, and either continues chain.filter (line 139) or sets 429 / throws (lines 142-148). Registered as bean in GatewayAutoConfiguration.java:679.", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Limiter", | |
| "entity": "isAllowed", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java", | |
| "lines": "245", | |
| "notes": "Reached from the Enforcer at RequestRateLimiterGatewayFilterFactory.java:132; RedisRateLimiter is the default RateLimiter bean (GatewayRedisAutoConfiguration.java:68). It loads the route policy, runs the token-bucket Lua script in Redis and builds Response(allowed) from the result (line 278); fails open on Redis errors. Alternative Bucket4jRateLimiter (GatewayAutoConfiguration.java:833) only when bucket4j is configured.", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "HistoryProvider", | |
| "entity": "execute", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java", | |
| "lines": "269", | |
| "notes": "Called from isAllowed (RedisRateLimiter.java:245); ReactiveStringRedisTemplate.execute runs the request_rate_limiter.lua script atomically in Redis, which reads and updates the per-entity tokens/timestamp keys built by getKeys (line 160). History is kept in the external Redis service; the Lua script resource (META-INF/scripts/request_rate_limiter.lua, bean at GatewayRedisAutoConfiguration.java:58) is not present in this clone.", | |
| "status": "external", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "PolicyProvider", | |
| "entity": "loadConfiguration", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java", | |
| "lines": "301", | |
| "notes": "Called from isAllowed at RedisRateLimiter.java:250; returns the per-route Config (replenishRate, burstCapacity, requestedTokens) from the map populated by AbstractRateLimiter.onApplicationEvent from route filter args, falling back to defaultConfig or default-filters config.", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "System", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Library repo: allowed requests continue via chain.filter(exchange) at RequestRateLimiterGatewayFilterFactory.java:139 to the proxied downstream service, which is outside the repo; no in-repo handler/sample is wired to this filter.", | |
| "status": "missing", | |
| "nodeId": null | |
| } | |
| ], | |
| "interaction_order": { | |
| "available": true, | |
| "language": "java", | |
| "repo": "spring-cloud_spring-cloud-gateway", | |
| "reason": "", | |
| "entryRole": "Enforcer", | |
| "entryRule": "behaviour", | |
| "interactions": [ | |
| { | |
| "rank": 1, | |
| "interaction": "Enforcer \u2192 Limiter", | |
| "from": "Enforcer", | |
| "to": "Limiter", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/factory/RequestRateLimiterGatewayFilterFactory.java", | |
| "line": 132, | |
| "via": [ | |
| "org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory.<lambda>0:org.springframework.cloud.gateway.filter.GatewayFilter(ANY,org.springframework.cloud.gateway.filter.GatewayFilterChain)", | |
| "org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory.<lambda>1:<unresolvedSignature>(1)" | |
| ], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory.apply:org.springframework.cloud.gateway.filter.GatewayFilter(org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory$Config)", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/factory/RequestRateLimiterGatewayFilterFactory.java", | |
| "line": 119, | |
| "code": "", | |
| "callee": "org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory.<lambda>0:org.springframework.cloud.gateway.filter.GatewayFilter(ANY,org.springframework.cloud.gateway.filter.GatewayFilterChain)", | |
| "mechanism": "nested-definition" | |
| }, | |
| { | |
| "caller": "org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory.<lambda>0:org.springframework.cloud.gateway.filter.GatewayFilter(ANY,org.springframework.cloud.gateway.filter.GatewayFilterChain)", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/factory/RequestRateLimiterGatewayFilterFactory.java", | |
| "line": 119, | |
| "code": "", | |
| "callee": "org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory.<lambda>1:<unresolvedSignature>(1)", | |
| "mechanism": "route-registration" | |
| }, | |
| { | |
| "caller": "org.springframework.cloud.gateway.filter.factory.RequestRateLimiterGatewayFilterFactory.<lambda>1:<unresolvedSignature>(1)", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/factory/RequestRateLimiterGatewayFilterFactory.java", | |
| "line": 132, | |
| "code": "isAllowed(routeId, key)", | |
| "callee": "org.springframework.cloud.gateway.filter.ratelimit.RedisRateLimiter.isAllowed:reactor.core.publisher.Mono(java.lang.String,java.lang.String)", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "" | |
| }, | |
| { | |
| "rank": 2, | |
| "interaction": "Limiter \u2192 PolicyProvider", | |
| "from": "Limiter", | |
| "to": "PolicyProvider", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java", | |
| "line": 250, | |
| "via": [], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "org.springframework.cloud.gateway.filter.ratelimit.RedisRateLimiter.isAllowed:reactor.core.publisher.Mono(java.lang.String,java.lang.String)", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java", | |
| "line": 250, | |
| "code": "loadConfiguration(routeId)", | |
| "callee": "org.springframework.cloud.gateway.filter.ratelimit.RedisRateLimiter.loadConfiguration:org.springframework.cloud.gateway.filter.ratelimit.RedisRateLimiter$Config(java.lang.String)", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "Enforcer \u2192 Limiter" | |
| }, | |
| { | |
| "rank": 3, | |
| "interaction": "Limiter \u2192 HistoryProvider", | |
| "from": "Limiter", | |
| "to": "HistoryProvider", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java", | |
| "line": 269, | |
| "via": [], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "org.springframework.cloud.gateway.filter.ratelimit.RedisRateLimiter.isAllowed:reactor.core.publisher.Mono(java.lang.String,java.lang.String)", | |
| "file": "spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiter.java", | |
| "line": 269, | |
| "code": "this.redisTemplate.execute(this.script, keys, scriptArgs)", | |
| "callee": "org.springframework.data.redis.core.ReactiveStringRedisTemplate.execute:<unresolvedSignature>(3)", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "Enforcer \u2192 Limiter" | |
| } | |
| ], | |
| "anchoredRoles": [ | |
| { | |
| "role": "Enforcer", | |
| "kind": "METHOD" | |
| }, | |
| { | |
| "role": "HistoryProvider", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Limiter", | |
| "kind": "METHOD" | |
| }, | |
| { | |
| "role": "PolicyProvider", | |
| "kind": "METHOD" | |
| } | |
| ], | |
| "skippedRoles": [ | |
| "Entity", | |
| "System" | |
| ] | |
| } | |
| } |
Xet Storage Details
- Size:
- 9.13 kB
- Xet hash:
- 5c8e02c8b98756d977f91401e65076e46a3bb0f96469e1b75e633c7f0a470bf8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.