メインコンテンツにスキップ

概要

Casbin is a powerful and efficient open-source access control library that supports various access control models for enforcing authorization across the board.

一連のルールを強制することは、件名をリストダウンするのと同じくらい簡単です。 オブジェクトと ポリシー ファイルで許可されているアクション (または必要に応じて他の形式) を指定します。 これは、Casbinが使用されているすべてのフローで同義です。 The developer/administrator has the complete control over the layout, execution and conditions for authorization which is set via the model file. Casbin provides an Enforcer for validating an incoming request based on the policy and model files given to the Enforcer.

Casbinがサポートしている言語:

Casbin は、さまざまなプログラミング言語のサポートを提供します。 プロジェクトとワークフロー内で統合される準備ができています。

golangjavanodejsphp
CasbinjCasbinnode-CasbinPHP-Casbin
production-readyproduction-readyproduction-readyproduction-ready
pythondotnetc++rust
PyCasbinCasbin.NETCasbin-CPPCasbin-RS
production-readyproduction-readyproduction-readyproduction-ready

言語ごとの機能

We are always working our best to make Casbin have the same set of features for all languages. しかし、現実はそれほど簡単ではありません。

機能GoJavaNode.jsPHPPythonC#DelphiRustC++LuaDartElixir
実行
RBAC
ABAC
Scaling ABAC (eval())
Adapter
Management API
RBAC API
Batch API
Filtered Adapter
Watcher
Role Manager
Multi-Threading
'in' of matcher

Note- ✅ for Watcher or Role Manager only means having the interface in the core library. It is not indicative of whether there is a watcher or role manager implementation available.

Casbinとは?

Casbin は、特定の オブジェクト または特定のユーザーまたは サブジェクト によってアクセスされるようにフローで使用できる認証ライブラリです。 The type of access i.e. action can be read, write, delete or any other action as set by the developer. これは Casbin が最も広く使用され、「標準」 または { subject, object, action } というフローと呼ばれる方法です。

Casbin is capable of handling many complex authorization scenarios other than the standard flow. ロール (RBAC)属性 (ABAC) などが追加できます。

Casbinが行うこと:

  1. Enforce the policy in the classic { subject, object, action } form or a customized form as you defined. Both allow and deny authorizations are supported.
  2. アクセス制御モデルとそのポリシーの保存をハンドリングします
  3. ロール・ユーザー間のマッピングとロール・ロール間のマッピング(RBACのロール階層)を管理します。
  4. Support built-in superusers like root or administrator. スーパーユーザは明示的な権限なしに何でも行うことができます。
  5. ルールのマッチングをサポートする複数の組み込み演算子。 For example, keyMatch can map a resource key /foo/bar to the pattern /foo*.

Casbinが行うもの NOT やります:

  1. 認証 (ログイン時の ユーザー名パスワード の検証)
  2. ユーザーまたはロールのリスト管理。

プロジェクトでは、ユーザー、ロール、パスワードのリストを管理する方が便利です。 パスワードは通常ユーザが保持しており、Casbinはパスワードを保管するものとして設計されていません。 しかし、CasbinはRBACシナリオのユーザー・ロール間のマッピングについては保存を行います。