Buckets:

download
raw
3.56 kB
{
"role_mappings": [
{
"role": "Entity",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "The requesting client is outside the repo (this is a Spring Boot library); no in-repo UI/SDK/CLI sends requests to the endpoints guarded by FilterRateLimiting. Tests ignored."
},
{
"role": "Enforcer",
"status": "present",
"symbol": "doFilterInternal",
"file": "src/main/java/dev/forgepack/library/internal/configuration/filter/FilterRateLimiting.java",
"lines": "104",
"notes": "doFilterInternal in FilterRateLimiting (OncePerRequestFilter, @Component picked up by @ComponentScan in ConfigurationJPAAuto.java:28 and auto-registered as a servlet filter) derives the client id (IP:URI:method via getClientIdentifier, line 124), asks the bucket (line 111) and forwards via chain.doFilter (line 115) or rejects with 429 via handleRateLimitExceeded (line 116/155). Fails open on exceptions (line 120)."
},
{
"role": "Limiter",
"status": "external",
"symbol": "tryConsumeAndReturnRemaining",
"file": "src/main/java/dev/forgepack/library/internal/configuration/filter/FilterRateLimiting.java",
"lines": "193",
"notes": "Reached from Enforcer doFilterInternal (FilterRateLimiting.java:111) via the thin wrapper BucketEntry.consume (line 191), which calls Bucket4j Bucket.tryConsumeAndReturnRemaining(1); the library's token-bucket decides allow/deny and returns a ConsumptionProbe, whose isConsumed() is branched on inline in doFilterInternal (line 115)."
},
{
"role": "HistoryProvider",
"status": "present",
"symbol": "cache",
"file": "src/main/java/dev/forgepack/library/internal/configuration/filter/FilterRateLimiting.java",
"lines": "62",
"notes": "The Limiter's per-client state is the in-memory ConcurrentMap<String, BucketEntry> cache, looked up/created by computeIfAbsent in doFilterInternal (line 110); each BucketEntry (line 182) wraps a Bucket4j Bucket whose remaining tokens are the request history and is updated on every tryConsumeAndReturnRemaining call (line 193). No method of its own carries the role, so the field is cited; stale entries are evicted by cleanupCache (line 167)."
},
{
"role": "PolicyProvider",
"status": "present",
"symbol": "createBucket",
"file": "src/main/java/dev/forgepack/library/internal/configuration/filter/FilterRateLimiting.java",
"lines": "136",
"notes": "Called from doFilterInternal (FilterRateLimiting.java:110) when a client's bucket is created; builds the Bucket4j Bandwidth policy (capacity = requestsPerMinute x burstMultiplier, greedy refill per minute) from PropertiesRateLimit (PropertiesRateLimit.java:26, prefix forgepack.rate-limit, defaults 100/min, burst 2). One global policy for all clients."
},
{
"role": "System",
"status": "present",
"symbol": "login",
"file": "src/main/java/dev/forgepack/library/internal/controller/ControllerAuthentication.java",
"lines": "61",
"notes": "FilterRateLimiting.doFilterInternal (FilterRateLimiting.java:115) forwards allowed requests via chain.doFilter to the library's in-repo controllers registered by the same @ComponentScan (ConfigurationJPAAuto.java:28); POST /auth/login (ControllerAuthentication.login) is cited as the representative brute-force-relevant handler. The filter applies to all URIs, so other controllers (ControllerUser, ControllerRole, ...) are equally guarded."
}
]
}

Xet Storage Details

Size:
3.56 kB
·
Xet hash:
988252d6c46600d3c8a08aab479ce1150c4974393be60c60059661d6a408183a

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.