Buckets:

download
raw
4.72 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No in-repo client sends the Bearer token to JwtRequestFilter; callers are external HTTP clients. Only test code (excluded) and samples' server-side controllers exist."
},
{
"role": "Authentication enforcer",
"status": "present",
"symbol": "doFilterInternal",
"file": "structure-security-jwt-starter/src/main/java/cn/structure/starter/jwt/filter/JwtRequestFilter.java",
"lines": "40",
"notes": "doFilterInternal in JwtRequestFilter, registered by filterChain in JwtWebSecurityConfig.java:116-117 (addFilterBefore). It extracts the Bearer token (getToken, JwtDefaultServiceImpl.java:90), resolves it via tokenStore.getUser (line 62) and only sets the SecurityContext authentication when an open session exists; otherwise the request stays anonymous and is rejected by anyRequest().authenticated() (JwtWebSecurityConfig.java:107) through the entry point."
},
{
"role": "Verifier",
"status": "present",
"symbol": "doFilterInternal",
"file": "structure-security-jwt-starter/src/main/java/cn/structure/starter/jwt/filter/JwtRequestFilter.java",
"lines": "40",
"notes": "Decision is inline in the Enforcer's method (same as Authentication enforcer): lines 62-71 look up the user for the token in the server-side store and check isTokenExpired (JwtDefaultServiceImpl.java:50), accepting only if both pass. No smaller helper makes the final accept/reject decision; the token is a JWT but the principal is resolved from server-side state, not from the claims."
},
{
"role": "Session manager",
"status": "present",
"symbol": "getUser",
"file": "structure-security-jwt-starter/src/main/java/cn/structure/starter/jwt/service/InnerTokenStore.java",
"lines": "32",
"notes": "Reached from JwtRequestFilter.java:62 (tokenStore.getUser); InnerTokenStore is the default ITokenStore bean (AutoJwtConfiguration.java:83-84). It keeps open sessions in an in-memory ConcurrentHashMap token->StructureAuthUser (line 23), filled at login by setUser/generateToken and removed by clearStore on logout."
},
{
"role": "Authorisation enforcer",
"status": "present",
"symbol": "filterChain",
"file": "structure-security-jwt-starter/src/main/java/cn/structure/starter/jwt/configuration/JwtWebSecurityConfig.java",
"lines": "70",
"notes": "After JwtRequestFilter sets the principal (with user.getAuthorities(), JwtRequestFilter.java:73), Spring's AuthorizationFilter installed by authorizeHttpRequests (line 76) in this @Bean enforces per-URL hasRole/hasAuthority rules and anyRequest().authenticated(); denials go to accessDeniedHandler (line 110). @EnableMethodSecurity (line 40) additionally enables @PreAuthorize in the sample controller."
},
{
"role": "Decider",
"status": "external",
"symbol": "hasAuthority",
"file": "structure-security-jwt-starter/src/main/java/cn/structure/starter/jwt/configuration/JwtWebSecurityConfig.java",
"lines": "101",
"notes": "Configured by filterChain (JwtWebSecurityConfig.java:97 hasRole / 101 hasAuthority); the decision is made by Spring Security's AuthorityAuthorizationManager comparing the principal's granted authorities with the rule. The jwt-example also uses @PreAuthorize(\"hasAuthority('ROLE_ADMIN')\") (Test.java:18), evaluated by Spring's method security."
},
{
"role": "Policy provider",
"status": "present",
"symbol": "antMatchers",
"file": "structure-security-jwt-starter/src/main/java/cn/structure/starter/jwt/properties/SecurityConfig.java",
"lines": "51",
"notes": "Read by filterChain at JwtWebSecurityConfig.java:71 (securityConfig.getAntMatchers()); the @ConfigurationProperties(\"structure.security\") map URL rules ROLE-x/AUTH-x -> paths. Field cited because the getter is Lombok-generated; the principal's privileges themselves come from StructureAuthUser.getAuthorities() stored in the session."
},
{
"role": "System",
"status": "present",
"symbol": "hello2",
"file": "structure-security-samples/structure-security-jwt-example/src/main/java/cn/structure/example/jwt/endpoint/Test.java",
"lines": "19",
"notes": "The repo is a starter library; the jwt-example app is wired to the same jwt starter (JwtConfiguration registers its LoginEndpoint). hello2 runs only after JwtRequestFilter authenticates the session and authorization (anyRequest().authenticated() plus @PreAuthorize hasAuthority('ROLE_ADMIN')) passes."
}
]
}

Xet Storage Details

Size:
4.72 kB
·
Xet hash:
4e653096f4d0567881961efe17feefed73a040a2f30168c23919e045976d221c

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