AnonymousSpottedToad/securityPatternsRecovery / ground_truth /java /limit_request_rate__eozoo_zoo.json
| { | |
| "role_mappings": [ | |
| { | |
| "patternRole": "Entity", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client sends requests to @AccessLimit-annotated endpoints; callers are outside the repo. Archetype HelloClient/HelloController templates do not use @AccessLimit, and tests are excluded.", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Enforcer", | |
| "entity": "limitRequest", | |
| "file": "zoo-framework/src/main/java/com/cowave/zoo/framework/access/limit/AccessLimitAcpect.java", | |
| "lines": "71", | |
| "notes": "@Before advice in AspectJ aspect AccessLimitAcpect (pointcut limitPoint, line 60) intercepts @AccessLimit controller methods, builds the limit key from app name + URI (+ IP/user/SpEL key), calls accessLimiter.throughLimit at line 107 and on rejection sets Retry-After and throws HttpHintException TOO_MANY_REQUESTS (lines 112-119).", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Limiter", | |
| "entity": "throughLimit", | |
| "file": "zoo-framework/src/main/java/com/cowave/zoo/framework/access/limit/RedisAccessLimiter.java", | |
| "lines": "50", | |
| "notes": "Reached from limitRequest AccessLimitAcpect.java:107; RedisAccessLimiter.throughLimit runs a sliding-window Lua script (LUA_SCRIPT, line 29) and returns allow if the result > 0. Chosen as the bean created by RedisAccessLimiterConfiguration.java:36 whenever Redis is on the classpath (no property needed); fallback GuavaAccessLimiter.throughLimit (GuavaAccessLimiter.java:30, Guava RateLimiter.tryAcquire token bucket) is used only when no StringRedisHelper bean exists.", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "HistoryProvider", | |
| "entity": "luaExec", | |
| "file": "zoo-framework/src/main/java/com/cowave/zoo/framework/helper/redis/StringRedisHelper.java", | |
| "lines": "187", | |
| "notes": "Called from throughLimit RedisAccessLimiter.java:51; luaExec executes the repo's LUA_SCRIPT (RedisAccessLimiter.java:29) via StringRedisTemplate.execute (line 191), which reads the per-key Redis sorted set of request timestamps (ZREMRANGEBYSCORE/ZCARD = get history) and records the allowed request (ZADD/PEXPIRE = update). Storage itself is the external Redis server; the history logic is declared in-repo.", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "PolicyProvider", | |
| "entity": "AccessLimit", | |
| "file": "zoo-framework/src/main/java/com/cowave/zoo/framework/access/limit/AccessLimit.java", | |
| "lines": "31", | |
| "notes": "Policy comes from the @AccessLimit annotation read by limitRequest via method.getAnnotation (AccessLimitAcpect.java:74) and passed as period()/limits() (AccessLimit.java:36/41) to throughLimit at AccessLimitAcpect.java:107. Cited the annotation type because the policy is split across its elements (period, limits, keying flags) and no single method retrieves it.", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "System", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "zoo-framework is a library/starter: no production controller in the repo carries @AccessLimit (grep over the whole repo, including archetype HelloController templates), so no protected handler is reached after limitRequest.", | |
| "status": "missing", | |
| "nodeId": null | |
| } | |
| ], | |
| "interaction_order": { | |
| "available": true, | |
| "language": "java", | |
| "repo": "eozoo_zoo", | |
| "reason": "", | |
| "entryRole": "Enforcer", | |
| "entryRule": "behaviour", | |
| "interactions": [ | |
| { | |
| "rank": 1, | |
| "interaction": "Enforcer \u2192 PolicyProvider", | |
| "from": "Enforcer", | |
| "to": "PolicyProvider", | |
| "file": "zoo-framework/src/main/java/com/cowave/zoo/framework/access/limit/AccessLimitAcpect.java", | |
| "line": 81, | |
| "via": [], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "com.cowave.zoo.framework.access.limit.AccessLimitAcpect.limitRequest:void(org.aspectj.lang.JoinPoint)", | |
| "file": "zoo-framework/src/main/java/com/cowave/zoo/framework/access/limit/AccessLimitAcpect.java", | |
| "line": 81, | |
| "code": "limitWithIp()", | |
| "callee": "com.cowave.zoo.framework.access.limit.AccessLimit.limitWithIp:<unresolvedSignature>(0)", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "" | |
| }, | |
| { | |
| "rank": 2, | |
| "interaction": "Enforcer \u2192 Limiter", | |
| "from": "Enforcer", | |
| "to": "Limiter", | |
| "file": "zoo-framework/src/main/java/com/cowave/zoo/framework/access/limit/AccessLimitAcpect.java", | |
| "line": 107, | |
| "via": [], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "com.cowave.zoo.framework.access.limit.AccessLimitAcpect.limitRequest:void(org.aspectj.lang.JoinPoint)", | |
| "file": "zoo-framework/src/main/java/com/cowave/zoo/framework/access/limit/AccessLimitAcpect.java", | |
| "line": 107, | |
| "code": "this.accessLimiter.throughLimit(limitKey, accessLimit.period(), accessLimit.limits())", | |
| "callee": "com.cowave.zoo.framework.access.limit.RedisAccessLimiter.throughLimit:boolean(java.lang.String,long,long)", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "" | |
| }, | |
| { | |
| "rank": 3, | |
| "interaction": "Limiter \u2192 HistoryProvider", | |
| "from": "Limiter", | |
| "to": "HistoryProvider", | |
| "file": "zoo-framework/src/main/java/com/cowave/zoo/framework/access/limit/RedisAccessLimiter.java", | |
| "line": 51, | |
| "via": [], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "com.cowave.zoo.framework.access.limit.RedisAccessLimiter.throughLimit:boolean(java.lang.String,long,long)", | |
| "file": "zoo-framework/src/main/java/com/cowave/zoo/framework/access/limit/RedisAccessLimiter.java", | |
| "line": 51, | |
| "code": "this.stringRedisHelper.luaExec(LUA_SCRIPT, Long.class, Collections.singletonList(limitKey), String.valueOf(limits), Str\u2026", | |
| "callee": "com.cowave.zoo.framework.helper.redis.StringRedisHelper.luaExec:java.lang.Object(java.lang.String,java.lang.Class,java.util.List,java.lang.Object[])", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "Enforcer \u2192 Limiter" | |
| } | |
| ], | |
| "anchoredRoles": [ | |
| { | |
| "role": "Enforcer", | |
| "kind": "METHOD" | |
| }, | |
| { | |
| "role": "HistoryProvider", | |
| "kind": "METHOD" | |
| }, | |
| { | |
| "role": "Limiter", | |
| "kind": "METHOD" | |
| }, | |
| { | |
| "role": "PolicyProvider", | |
| "kind": "TYPE_DECL" | |
| } | |
| ], | |
| "skippedRoles": [ | |
| "Entity", | |
| "System" | |
| ] | |
| } | |
| } |
Xet Storage Details
- Size:
- 6.86 kB
- Xet hash:
- 0d8e8a77905ecd9830ae272ed92c80185a156906cda126b877064bd5e874abff
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.