FastAC

Test Coverage Go Report Card

FastAC is a drop in replacement for Casbin. In some cases, FastAC can improve the performance significantly.

Please refer to the Casbin Docs for explanation of terms.

Performance Comparison

RBAC Benchmark

ABAC Benchmark

New Features

Policy Indexing

Matchers can be divided into multiple stages. As a result FastAC will index all policy rules, which reduces the search space for access requests. This feature brings the most performance gain.

All you have to do, to take advantage of this is new feature, is to split your matcher definition.

#Before
[matchers]
m = g(r.sub, p.sub) && r.dom == p.dom && r.obj == p.obj && r.act == p.act

#After
[matchers]
m.0 = r.dom == p.dom
m.1 = g(r.sub, p.sub)
m.2 = r.obj == p.obj && r.act == p.act

Advanced Policy Filtering

FastAC can filter policy with matchers.

//examples

//get all policy rules belonging to domain1
e.FilterWithMatcher("p.dom == \"domain1\"")

//get all policy rules which grant alice read access
e.FilterWithMatcher("g(\"alice\", p.sub) && p.act == \"read\"")

Feature Overview

  • Enforcement
  • RBAC
  • ABAC
  • Adapter
  • Default Role Manager
  • Third Party Role Managers
  • Filtered Adapter
  • Watcher
  • Dispatcher

Adapter List

GitHub

View Github