Buckets:

download
raw
5.68 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No in-repo client (web UI/SDK/CLI) sends the u_token cookie/header to the CarpTokenFilter; the repo contains only backend Java modules. The caller is outside the repo."
},
{
"role": "Authentication enforcer",
"status": "present",
"symbol": "doFilterInternal",
"file": "carp-modules/carp-module-security/carp-module-security-spring/src/main/java/cn/sliew/carp/module/security/spring/web/CarpTokenFilter.java",
"lines": "53",
"notes": "doFilterInternal in CarpTokenFilter (OncePerRequestFilter) is installed before UsernamePasswordAuthenticationFilter by CarpTokenConfigurer.configure (carp-modules/carp-module-security/carp-module-security-spring/src/main/java/cn/sliew/carp/module/security/spring/config/CarpTokenConfigurer.java:43), applied in CarpSecurityConfig.filterChain (carp-modules/carp-module-security/carp-module-security-spring/src/main/java/cn/sliew/carp/module/security/spring/config/CarpSecurityConfig.java:70). It resolves the session token (cookie/header/param via SecurityUtil.resolveToken, line 54), looks it up and sets the SecurityContext; unauthenticated requests are then rejected downstream by the authorization filter + CarpAuthenticationEntryPoint."
},
{
"role": "Verifier",
"status": "present",
"symbol": "doFilterInternal",
"file": "carp-modules/carp-module-security/carp-module-security-spring/src/main/java/cn/sliew/carp/module/security/spring/web/CarpTokenFilter.java",
"lines": "53",
"notes": "Verification is inline in the Authentication enforcer's doFilterInternal (same method as Enforcer): line 56 fetches the userId for the token from Redis and line 57 accepts only if non-null, then builds the principal via secUserService.get and CarpUserDetailsServiceImpl.fillUserDetails. No smaller helper performs the accept/reject decision (SecurityUtil.buildRedisToken only builds the key)."
},
{
"role": "Session manager",
"status": "external",
"symbol": "get",
"file": "carp-modules/carp-module-security/carp-module-security-spring/src/main/java/cn/sliew/carp/module/security/spring/web/CarpTokenFilter.java",
"lines": "56",
"notes": "Reached from the Verifier in doFilterInternal: redisUtil.get(SecurityUtil.buildRedisToken(token)) on RedissonUtil (cn.sliew.carp.framework.redis, not in this repo) backed by Redis. Sessions are opened in SecAuthenticationServiceImpl.login via redisUtil.set with 12h TTL (carp-modules/carp-module-security/carp-module-security-spring/src/main/java/cn/sliew/carp/module/security/spring/service/impl/SecAuthenticationServiceImpl.java:99) and removed in logout (line 127)."
},
{
"role": "Authorisation enforcer",
"status": "external",
"symbol": "doFilter",
"file": "carp-modules/carp-module-security/carp-module-security-spring/src/main/java/cn/sliew/carp/module/security/spring/config/CarpSecurityConfig.java",
"lines": "72",
"notes": "After the Authentication enforcer passes the request down the chain (CarpTokenFilter.java:74), Spring Security's AuthorizationFilter.doFilter enforces the URL rules; it is installed by http.authorizeHttpRequests(this::authorizeRequests) in filterChain. Denials go to CarpAuthenticationEntryPoint/CarpAccessDeniedHandler (line 135-136). No @PreAuthorize usage exists in the repo."
},
{
"role": "Decider",
"status": "external",
"symbol": "check",
"file": "carp-modules/carp-module-security/carp-module-security-spring/src/main/java/cn/sliew/carp/module/security/spring/config/CarpSecurityConfig.java",
"lines": "126",
"notes": "Called by the Authorisation enforcer (AuthorizationFilter): Spring's RequestMatcherDelegatingAuthorizationManager/AuthenticatedAuthorizationManager.check decides permitAll vs authenticated(), configured at anyRequest().authenticated() line 126. The in-repo CarpSecurityValidateService.validate (carp-modules/carp-module-security/carp-module-security-spring/src/main/java/cn/sliew/carp/module/security/spring/authorization/CarpSecurityValidateService.java:58) checks roles/privileges but is never referenced (no @PreAuthorize(\"@carpSecurity...\")), so it is off-path."
},
{
"role": "Policy provider",
"status": "present",
"symbol": "authorizeRequests",
"file": "carp-modules/carp-module-security/carp-module-security-spring/src/main/java/cn/sliew/carp/module/security/spring/config/CarpSecurityConfig.java",
"lines": "95",
"notes": "The Decider evaluates the rules registered by authorizeRequests in CarpSecurityConfig: @AnonymousAccess handler URLs, actuator endpoints, static resources, swagger paths and OPTIONS are permitAll, everything else requires authentication. User roles/resource authorities are loaded via fillUserDetails/getOnlineUser but are not used by any wired decision."
},
{
"role": "System",
"status": "present",
"symbol": "getOnlineUser",
"file": "carp-modules/carp-module-security/carp-module-security-core/src/main/java/cn/sliew/carp/module/security/core/controller/SecAuthenticationController.java",
"lines": "70",
"notes": "A protected handler (not @AnonymousAccess, so anyRequest().authenticated() at CarpSecurityConfig.java:126 applies) reached after both enforcers pass; it returns the online user built from CarpSecurityContext set by doFilterInternal (CarpTokenFilter.java:71). Other controllers (e.g. SecUserController) are protected the same way."
}
]
}

Xet Storage Details

Size:
5.68 kB
·
Xet hash:
3ee0e637f380ad15806207b1b893bce42dbc7729c8199161a7fb89f6b4f56a14

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