Buckets:
AnonymousSpottedToad/candidate_bucket / preliminary /mappings /java /verifiable_token_based_authentication /melih-vardar_e-commerce-microservices.json
| { | |
| "role_mappings": [ | |
| { | |
| "role": "Subject", | |
| "status": "missing", | |
| "symbol": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No in-repo client sends the Bearer token to category-service (no frontend, no @FeignClient). The feignClientInterceptor in user-service/src/main/java/com/melvard/user_service/security/SecurityConfig.java:63 would relay the header but no Feign client exists; the caller is outside the repo." | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "status": "present", | |
| "symbol": "BaseJwtAuthFilter", | |
| "file": "common/src/main/java/io/github/melihvardar/security/jwt/BaseJwtAuthFilter.java", | |
| "lines": "20", | |
| "notes": "OncePerRequestFilter installed by BaseSecurityService.configureCoreSecurity (common/.../BaseSecurityService.java:42), invoked from category-service SecurityConfig.securityFilterChain (category-service/.../security/SecurityConfig.java:21) with anyRequest().authenticated(). doFilterInternal (line 28) reads the Bearer header and sets the SecurityContext only when validateToken succeeds (line 54); otherwise Spring Security rejects the request." | |
| }, | |
| { | |
| "role": "Verifier", | |
| "status": "present", | |
| "symbol": "validateToken", | |
| "file": "common/src/main/java/io/github/melihvardar/security/jwt/BaseJwtService.java", | |
| "lines": "84", | |
| "notes": "Called by the Enforcer at BaseJwtAuthFilter.java:54. Parses and signature-checks the JWT via extractAllClaims (line 76) and checks expiration; returns true/false. The principal (email, roles) is extracted by extractEmail/extractRoles (lines 61/71, called at filter lines 40/43), which also verify the signature." | |
| }, | |
| { | |
| "role": "Key manager", | |
| "status": "present", | |
| "symbol": "secretKey", | |
| "file": "common/src/main/java/io/github/melihvardar/security/jwt/BaseJwtService.java", | |
| "lines": "23", | |
| "notes": "Field populated from @Value(\"${jwt.secret:...}\") (line 22); no jwt.secret is set in any config, so the hard-coded default HMAC secret is used. init (line 28) decodes it into the signingKey field (line 25) via Keys.hmacShaKeyFor, which extractAllClaims passes to setSigningKey (line 78) on the Verifier path." | |
| }, | |
| { | |
| "role": "Cryptographer", | |
| "status": "external", | |
| "symbol": "parseClaimsJws", | |
| "file": "common/src/main/java/io/github/melihvardar/security/jwt/BaseJwtService.java", | |
| "lines": "80", | |
| "notes": "jjwt (io.jsonwebtoken) Jwts.parserBuilder().setSigningKey(signingKey).build().parseClaimsJws(token) verifies the HS256 HMAC, reached from validateToken (line 87) -> extractAllClaims (line 76). Tokens are signed with signWith(signingKey, HS256) at line 57 in the issuing sub-flow." | |
| }, | |
| { | |
| "role": "System", | |
| "status": "present", | |
| "symbol": "createCategory", | |
| "file": "category-service/src/main/java/com/melvard/category_service/controller/CategoryController.java", | |
| "lines": "36", | |
| "notes": "Protected handler reached after BaseJwtAuthFilter authenticates the request (category-service SecurityConfig.java:25 anyRequest().authenticated()); it uses the token-derived ADMIN authority via @PreAuthorize (line 35) and delegates to CategoryService.createCategory. Other handlers in the same controller (getCategoryById:24, getAllCategories:30) are equally protected." | |
| } | |
| ] | |
| } | |
Xet Storage Details
- Size:
- 3.35 kB
- Xet hash:
- 1f5b7ac8de2f04f6c070816c83f710061bc4e51331f67dfafdb0f031acd9afa6
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.