Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /java /limit_request_rate /admin4j_admin4j-framework.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Entity", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "The HTTP caller is outside the repo; admin4j-framework is a starter/library collection with no in-repo client that calls endpoints guarded by RateLimitInterceptor.preHandle (admin4j-limiter/limiter-core/.../RateLimitInterceptor.java:38)." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "preHandle", | |
| "file": "admin4j-limiter/limiter-core/src/main/java/com/admin4j/limiter/core/interceptor/RateLimitInterceptor.java", | |
| "lines": "38", | |
| "notes": "preHandle in RateLimitInterceptor (registered for /** in LimiterWebMvcConfigurer.addInterceptors, limiter-spring-boot-starter/.../LimiterWebMvcConfigurer.java:30; bean at LimiterAutoConfiguration.java:37) reads the @RateLimiter annotation, builds the entity key (URI via DefaultRateLimiterKeyGenerate.generateKey, optional user/tenant/IP), calls tryAcquire at line 70 and throws RateLimiterException (mapped to HTTP 429 by LimiterGlobalExceptionHandler) when denied." | |
| }, | |
| { | |
| "role": "Limiter", | |
| "status": "present", | |
| "symbol": "tryAcquire", | |
| "file": "admin4j-limiter/limiter-redis/src/main/java/com/admin4j/limiter/redis/AbstractRedisRateLimiter.java", | |
| "lines": "58", | |
| "notes": "Reached from preHandle (RateLimitInterceptor.java:70) via rateLimiterService -> DefaultRateLimiterContext.getByLimiterType; default limiterType SLIDING_WINDOW resolves to SlidingWindowRedisRateLimiter, which inherits tryAcquire from AbstractRedisRateLimiter. It runs a Redis Lua script with maxAttempts/interval and returns allow iff the result is 1; caveat: the Lua scripts (rateLimiter/SlidingWindow.lua) and a bean registration of the Redis providers are not present in the repo." | |
| }, | |
| { | |
| "role": "HistoryProvider", | |
| "status": "external", | |
| "symbol": "execute", | |
| "file": "admin4j-limiter/limiter-redis/src/main/java/com/admin4j/limiter/redis/AbstractRedisRateLimiter.java", | |
| "lines": "60", | |
| "notes": "tryAcquire (AbstractRedisRateLimiter.java:58) calls Spring Data Redis StringRedisTemplate.execute with the key 'RL:'+key; request history/counters are read and updated atomically inside Redis by the Lua script loaded in init (line 35). Redis and the script (not shipped in repo) hold the history, so the role is external." | |
| }, | |
| { | |
| "role": "PolicyProvider", | |
| "status": "present", | |
| "symbol": "RateLimiter", | |
| "file": "admin4j-limiter/limiter-core/src/main/java/com/admin4j/limiter/core/anno/RateLimiter.java", | |
| "lines": "18", | |
| "notes": "preHandle (RateLimitInterceptor.java:44-53) obtains the policy from the @RateLimiter annotation on the handler method/class: limiterType (default SLIDING_WINDOW), maxAttempts (default 2), interval/timeUnit (default 2s), keyGenerate and ip flag; these are passed to tryAcquire at line 70. No retrieving method exists beyond the annotation itself, so the annotation type is cited." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "Library/starter repo: no production controller in the repo is annotated with @RateLimiter, so no protected handler is reached after RateLimitInterceptor.preHandle (RateLimitInterceptor.java:74 returns true to the downstream handler)." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 3.44 kB
- Xet hash:
- f3129a8cd7b9f797862170e6d09499a5f10b60a08691a5ac97a88b16e61de665
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.