| | |
| | | import java.security.Principal; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @author sean.zhou |
| | |
| | | if (!StringUtils.hasText(token)) { |
| | | return false; |
| | | } |
| | | |
| | | log.debug("token:" + token); |
| | | Optional<CustomClaim> customClaim = JwtUtil.parseToken(token); |
| | | if (customClaim.isEmpty()) { |
| | | return false; |
| | |
| | | CustomClaim claim = (CustomClaim) ((ServletServerHttpRequest) request).getServletRequest() |
| | | .getAttribute(AuthInterceptor.TOKEN_CLAIM); |
| | | |
| | | return () -> claim.getWorkspaceId() + "/" + claim.getUserType() + "/" + claim.getId(); |
| | | return () -> UUID.randomUUID().toString() + "/" + claim.getUserType() + "/" + claim.getId(); |
| | | } |
| | | return () -> null; |
| | | } |