jcasbin / casbin-spring-boot-starter

Spring Boot 2.x & 3.x Starter for Casbin, see example at: https://github.com/jcasbin/casbin-spring-boot-example

Home Page:https://mvnrepository.com/artifact/org.casbin/casbin-spring-boot-starter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace built-in adapter and watcher with official jdbc-adapter and redis-watcher

tangyang9464 opened this issue · comments

Due to historical reasons, casbin-spring-boot-starter has written its own adapter and watcher, which is not unified with the official one, which increases the difficulty of maintenance and confuses users. So we need to use the official adapter and watcher to replace.
see official adapter and watcher:
redis-watcher
jdbc-adapter
Related bug:jcasbin#271

@tangyang9464 Roger that. I will compare the differences between the starter and the official adapter and watcher ASAP.

Hi,

Official JdbcAdapater implement BatchAdapater,but casbin-spring-boot-starter not.

So if I want to batch, do I have to wait until release?

Sorry for the delay. I compared the differences between the starter and the official adapter and recorded the features that need to be added in jdbc-adapter.

  • JDBCAdapter Constructor
    • JdbcTemplate jdbcTemplate. The SQL execution of casbin-spring-boot-starter depends on JdbcTemplate which is a class of springframework, however, we don't use it in jdbc-adapter.
    • CasbinExceptionProperties casbinExceptionProperties. Whether to throw an exception when the delete strategy fails.
    • boolean autoCreateTable. Whether to create the table automatically.
    • String tableName. The table name of casbin rule.
  • Filtered Policy
    • removeFilteredPolicy. Delete the matching data after the index specified by the current policy from the storage.

In addition, jdbc-adapter needs to improve code quality such as invariants, comments, etc.

I'm working on this, some PR will be opened for this issue.

@seriouszyx sounds good!

@imp2002 plz absorb any valuable parts in PR: #65 and make a new PR to fix this issue