Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Lettuce Redis watcher #89

Merged
merged 4 commits into from
Sep 21, 2023

Conversation

ShingmoYeung
Copy link
Contributor

  1. Add Lettuce Redis watcher: retain the Redis Watcher based on Jedis implementation and as an optional, default Lettuce Redis Watcher, adapt to the subsequent SpringBoot.
  2. Update dependencies version: update dependent versions: e.g. jCasin, jdbc-adapter, etc.

- Update `org.casbin:jcasbin` from version 1.30.1 to 1.35.0
- Update `org.casbin:jcasbin-redis-watcher` from version 1.4.1 to 1.4.2
- Update `org.casbin:jdbc-adapter` from version 2.3.3 to 2.4.1
- Update `mysql:mysql-connector-java` from version 8.0.30 to 8.0.33

Add new configuration properties for Lettuce Redis Type in `CasbinProperties.java`:
- Add `watcherLettuceRedisType` property with the default value of NONE

Update getter and setter methods for `watcherLettuceRedisType` in `CasbinProperties.java`

Add new class `CasbinWatcherLettuceRedisType.java`

Update `CasbinRedisWatcherAutoConfiguration.java`:
- Add import statement for `org.casbin.watcher.lettuce.LettuceRedisWatcher`
- Add new conditional bean configuration for Lettuce Redis Watcher
The LettuceRedisWatcher class is imported, and a conditional statement is added to check the watcher type. If the type is "standalone", a new LettuceRedisWatcher instance is created and set as the watcher. If the type is "cluster", a new LettuceRedisWatcher instance is created with the cluster nodes and set as the watcher. If the watcher type is unsupported, a CasbinWatcherLettuceTypeUnsupportedException is thrown.
…n in CasbinRedisWatcherAutoConfiguration.java.
@casbin-bot
Copy link

@tangyang9464 @imp2002 please review

@hsluoyz hsluoyz merged commit c24ff1b into jcasbin:master Sep 21, 2023
2 of 3 checks passed
@github-actions
Copy link

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants