Buckets:

download
raw
3.53 kB
{
"role_mappings": [
{
"role": "Entity",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "The caller of the pesitwizard-server REST API (e.g. /api/v1/transfers) is outside the repo; no in-repo UI/SDK sends requests to the server's REST API (pesitwizard-client is a separate app with its own API and speaks PeSIT to the server). Tests ignored."
},
{
"role": "Enforcer",
"status": "present",
"symbol": "doFilterInternal",
"file": "pesitwizard-server/src/main/java/com/pesitwizard/server/security/RateLimitingFilter.java",
"lines": "61",
"notes": "doFilterInternal in RateLimitingFilter (OncePerRequestFilter, @Component @Order(1)) intercepts every non-whitelisted request, derives the client id (API key at :72 or IP via getClientIp at :86) and calls checkIpRateLimit (:87) / checkApiKeyRateLimit (:77); on block it returns without calling filterChain.doFilter. Caveat: bean is @ConditionalOnProperty pesit.security.rate-limiting.enabled=true with matchIfMissing=false, so it is opt-in (only rate-limit feature in repo)."
},
{
"role": "Limiter",
"status": "present",
"symbol": "tryConsume",
"file": "pesitwizard-server/src/main/java/com/pesitwizard/server/security/RateLimitingFilter.java",
"lines": "179",
"notes": "Reached from Enforcer via checkIpRateLimit (RateLimitingFilter.java:87 -> :136). tryConsume calls Bucket4j bucket.tryConsumeAndReturnRemaining(1) (:182) and returns true (allow) or writes HTTP 429 with Retry-After and returns false (block). The token-bucket arithmetic itself is Bucket4j library logic."
},
{
"role": "HistoryProvider",
"status": "present",
"symbol": "checkIpRateLimit",
"file": "pesitwizard-server/src/main/java/com/pesitwizard/server/security/RateLimitingFilter.java",
"lines": "124",
"notes": "Called by doFilterInternal (RateLimitingFilter.java:87); looks up/creates the per-IP Bucket4j bucket in the in-memory ConcurrentHashMap ipBuckets (field :53) via compute (:128), refreshing lastAccess and evicting stale entries (evictStaleEntries :158). The bucket's remaining tokens are the request history; it is updated by the consume call in tryConsume (:182). API-key branch uses checkApiKeyRateLimit (:139) / apiKeyBuckets (:54); Redis options in RateLimitingProperties are unused."
},
{
"role": "PolicyProvider",
"status": "present",
"symbol": "createIpBucket",
"file": "pesitwizard-server/src/main/java/com/pesitwizard/server/security/RateLimitingFilter.java",
"lines": "210",
"notes": "Invoked from checkIpRateLimit (RateLimitingFilter.java:134) when an IP has no bucket; builds the Bandwidth policy (capacity = requestsPerMinute*burstMultiplier, greedy refill per minute) from RateLimitingProperties (RateLimitingProperties.java:18,24; defaults 100/min, x2). For API keys createApiKeyBucket (:223) uses ApiKey.rateLimit per key."
},
{
"role": "System",
"status": "present",
"symbol": "listTransfers",
"file": "pesitwizard-server/src/main/java/com/pesitwizard/server/controller/TransferController.java",
"lines": "57",
"notes": "After the Enforcer allows the request it calls filterChain.doFilter (RateLimitingFilter.java:91), reaching Spring MVC controllers; the filter is global (all non-whitelisted paths), so listTransfers (GET /api/v1/transfers) is cited as a representative protected handler."
}
]
}

Xet Storage Details

Size:
3.53 kB
·
Xet hash:
0c256890d73e46d79aaf4f9f607e078af35a9e604c3173553333aa779e116c73

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