Buckets:

AnonymousSpottedToad/securityPatternsRecovery / ground_truth /java /limit_request_rate__XSailboat_XSailboat.json
download
raw
7.54 kB
{
"role_mappings": [
{
"patternRole": "Entity",
"entity": "",
"file": "",
"lines": "",
"notes": "The login request to /login (AppConsts.sApiPath_login) comes from a browser outside the repo; no in-repo HTML/JS/SDK client posting the login form was found (web-ac has no resources/front-end sources).",
"status": "missing",
"nodeId": null
},
{
"patternRole": "Enforcer",
"entity": "doFilter",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/filter/PasswordDecorderFilter.java",
"lines": "42",
"notes": "doFilter in PasswordDecorderFilter, registered before UsernamePasswordAuthenticationFilter in SecurityConfig.java:147 for /login. It takes the client IP (line 48), asks LoginFailStore.isLoginFailTooMore (line 49) and, if blocked, records the attempt and redirects to the login-failure page with a LockedException; otherwise forwards down the chain (line 75).",
"status": "present",
"nodeId": null
},
{
"patternRole": "Limiter",
"entity": "isLoginFailTooMore",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/utils/LoginFailStore.java",
"lines": "62",
"notes": "Called from PasswordDecorderFilter.doFilter (PasswordDecorderFilter.java:49). Blocks the IP when its circular buffer of failure timestamps is full (size = fail-times limit) and the oldest is within the 30-minute window (sTimeGapMs).",
"status": "present",
"nodeId": null
},
{
"patternRole": "HistoryProvider",
"entity": "mFailLoginMap",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/utils/LoginFailStore.java",
"lines": "15",
"notes": "Maintains per-IP failure timestamps in mFailLoginMap (auto-cleaning map, LoginFailStore.java:15), read by isLoginFailTooMore. Updated by PasswordDecorderFilter.java:51 (blocked attempts) and CustomAuthenticationFailureHandler.java:54 (bad credentials); cleared by clearLoginFail on success (CustomAuthenticationSuccessHandler.java:31).",
"status": "present",
"nodeId": null
},
{
"patternRole": "PolicyProvider",
"entity": "isFull",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/utils/LoginFailStore.java",
"lines": "65",
"notes": "Bean method that builds the LoginFailStore with the limit from AppConfig.loginRetryTimes (@Value login.retry.times:5, AppConfig.java:46); the 30-minute window is the constant sTimeGapMi (LoginFailStore.java:12). The Limiter reads the policy as the buffer capacity mFailTimesLimit; no separate per-id policy lookup exists.",
"status": "present",
"nodeId": null
},
{
"patternRole": "System",
"entity": "onAuthenticationSuccess",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/frame/CustomAuthenticationSuccessHandler.java",
"lines": "25",
"notes": "After doFilter forwards (PasswordDecorderFilter.java:75), Spring's formLogin UsernamePasswordAuthenticationFilter authenticates and, on success, calls this handler (configured SecurityConfig.java:199), which establishes the login redirect and clears the IP's failure history.",
"status": "present",
"nodeId": null
}
],
"interaction_order": {
"available": true,
"language": "java",
"repo": "XSailboat_XSailboat",
"reason": "",
"entryRole": "Enforcer",
"entryRule": "behaviour",
"interactions": [
{
"rank": 1,
"interaction": "Enforcer \u2192 Limiter",
"from": "Enforcer",
"to": "Limiter",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/filter/PasswordDecorderFilter.java",
"line": 49,
"via": [],
"mechanism": "call",
"path": [
{
"caller": "team.sailboat.ms.ac.filter.PasswordDecorderFilter.doFilter:void(jakarta.servlet.ServletRequest,jakarta.servlet.ServletResponse,jakarta.servlet.FilterChain)",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/filter/PasswordDecorderFilter.java",
"line": 49,
"code": "this.mLoginFailStore.isLoginFailTooMore(ip)",
"callee": "team.sailboat.ms.ac.utils.LoginFailStore.isLoginFailTooMore:boolean(java.lang.String)",
"mechanism": "call"
}
],
"parent": ""
},
{
"rank": 2,
"interaction": "Limiter \u2192 HistoryProvider",
"from": "Limiter",
"to": "HistoryProvider",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/utils/LoginFailStore.java",
"line": 64,
"via": [],
"mechanism": "data",
"path": [
{
"caller": "team.sailboat.ms.ac.utils.LoginFailStore.isLoginFailTooMore:boolean(java.lang.String)",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/utils/LoginFailStore.java",
"line": 64,
"code": "",
"callee": "mFailLoginMap",
"mechanism": "data"
}
],
"parent": "Enforcer \u2192 Limiter"
},
{
"rank": 3,
"interaction": "Limiter \u2192 PolicyProvider",
"from": "Limiter",
"to": "PolicyProvider",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/utils/LoginFailStore.java",
"line": 65,
"via": [],
"mechanism": "call",
"path": [
{
"caller": "team.sailboat.ms.ac.utils.LoginFailStore.isLoginFailTooMore:boolean(java.lang.String)",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/utils/LoginFailStore.java",
"line": 65,
"code": "fails.isFull()",
"callee": "team.sailboat.commons.fan.collection.CircularArrayList.isFull:boolean()",
"mechanism": "call"
}
],
"parent": "Enforcer \u2192 Limiter"
},
{
"rank": 4,
"interaction": "Enforcer \u2192 HistoryProvider",
"from": "Enforcer",
"to": "HistoryProvider",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/utils/LoginFailStore.java",
"line": 35,
"via": [
"team.sailboat.ms.ac.utils.LoginFailStore.recordLoginFail:int(java.lang.String)"
],
"mechanism": "data",
"path": [
{
"caller": "team.sailboat.ms.ac.filter.PasswordDecorderFilter.doFilter:void(jakarta.servlet.ServletRequest,jakarta.servlet.ServletResponse,jakarta.servlet.FilterChain)",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/filter/PasswordDecorderFilter.java",
"line": 51,
"code": "this.mLoginFailStore.recordLoginFail(ip)",
"callee": "team.sailboat.ms.ac.utils.LoginFailStore.recordLoginFail:int(java.lang.String)",
"mechanism": "call"
},
{
"caller": "team.sailboat.ms.ac.utils.LoginFailStore.recordLoginFail:int(java.lang.String)",
"file": "web-ac/src/main/java/team/sailboat/ms/ac/utils/LoginFailStore.java",
"line": 35,
"code": "",
"callee": "mFailLoginMap",
"mechanism": "data"
}
],
"parent": ""
}
],
"anchoredRoles": [
{
"role": "Enforcer",
"kind": "METHOD"
},
{
"role": "HistoryProvider",
"kind": "MEMBER"
},
{
"role": "Limiter",
"kind": "METHOD"
},
{
"role": "PolicyProvider",
"kind": "METHOD"
}
],
"skippedRoles": [
"Entity",
"System"
]
}
}

Xet Storage Details

Size:
7.54 kB
·
Xet hash:
c00fd4cea41476b0773ccded9acd3af73bd572e42aee93f58186706b1a779761

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