{"repo":"apache/casbin-ent-adapter","free":true,"listed":false,"github":"https://github.com/apache/casbin-ent-adapter","clone":"git clone https://github.com/apache/casbin-ent-adapter.git","description":"Ent adapter for Casbin","language":"Go","stars":62,"topics":["adapter","orm","acl","auth","authorization","rbac","ent","access-control","abac","storage-driver"],"license":"Apache-2.0","category":"auth-billing-email","readme_excerpt":"Ent Adapter ==== Ent Adapter is the Ent adapter for Casbin. With this library, Casbin can load policy from Ent-supported databases or save policy to them. Based on Ent Supported Drivers, the current supported databases are: - MySQL - PostgreSQL - SQLite - Gremlin Installation Simple MySQL Example Simple PostgreSQL Example Use NewAdapterWithClient You can also create an adapter with an existing Ent client instance: Database Configuration The database used in the adapter should be created manually before calling NewAdapter . The adapter will automatically create the casbin rule table if it doesn't exist. Upgrading an existing database A policy rule is now unique on (ptype, v0, v1, v2, v3, v4, v5) , and the seven columns are varchar(100) so that the index fits within the 3072-byte key limit InnoDB enforces. Both are enforced by the automatic migration that runs inside NewAdapter and NewAdapterWithClient , so a database written by an earlier version needs a look before the first start on this version. A fresh database needs nothing. Check for rules that no longer fit. The adapter runs this check itself and refuses to migrate while it returns anything, because a MySQL server running without strict mode would truncate the values rather than reject them: Check for rules stored more than once. Nothing enforced uniqueness before, so duplicates may have accumulated, and the index cannot be built while they exist: Duplicates are redundant by definition — casbin evaluates a rule the same","default_branch":null,"files":null,"tree":[],"storefront":"/r/apache","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/apache/casbin-ent-adapter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}