Skip to content

Instantly share code, notes, and snippets.

@GaetanoPiazzolla
Created January 30, 2022 19:52
Show Gist options
  • Save GaetanoPiazzolla/7db7727152607a031e48063c1dbd5820 to your computer and use it in GitHub Desktop.
Save GaetanoPiazzolla/7db7727152607a031e48063c1dbd5820 to your computer and use it in GitHub Desktop.
A blacklisting service. Uses standard springboot annotations.
@Service
public class BlackListingService {
@CachePut(CacheConfig.BLACKLIST_CACHE_NAME)
public String blackListJwt(String jwt) {
return jwt;
}
@Cacheable(value = CacheConfig.BLACKLIST_CACHE_NAME, unless = "#result == null")
public String getJwtBlackList(String jwt) {
return null;
}
}
@GaetanoPiazzolla
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment