Permify は Go で書かれた認可サービスである。ドキュメントは Permify を “an open-source authorization service for creating fine-grained and scalable authorization systems” (きめ細かくスケーラブルな認可システムを構築するためのオープンソースの認可サービス) であり、“inspired by Google’s consistent, global authorization system, Google Zanzibar” (Google の一貫性を備えたグローバル認可システムである Google Zanzibar に着想を得た) ものと説明している (Permify docs)。Permify Schema でエンティティ型とその関係を記述し、関係をタプルとして書き込み、主体が権限を持つかどうかを gRPC または HTTP でサーバーに問い合わせる。
FusionAuth による Permify の買収は 2025-11-20 に発表された (Permify の発表、FusionAuth の発表)。FusionAuth は現在この製品を “FusionAuth FGA by Permify” と呼んでおり (FusionAuth のサポート記事)、ドキュメントは fusionauth.io/permify-docs にある。Permify の記事は “The core Permify project remains open source and will continue to live on GitHub.” (中核の Permify プロジェクトはオープンソースのままであり、今後も GitHub 上で存続する) と述べている。
論文と Permify の対応
各行は、論文の概念と、Permify が文書化している最も近いものを並べたものである。Permify に相当するものがない場合はその旨を記す。
| 論文 | Permify |
|---|---|
| 名前空間設定 (§2.3) | Permify Schema の entity ブロック。relation、permission (またはその同義語の action)、attribute、rule を持つ (modeling) |
リレーションタプル object#relation@user (§2.1) |
リレーショナルタプル entity#relation@subject。例: doc:readme#owner@user:anne (storing data) |
_this |
relation に格納されたタプル。permission はその関係の名前を書くことでそれらを含める |
computed_userset |
同じエンティティの別の relation または permission の名前を書く。view = viewer or edit の中の edit がその例 |
tuple_to_userset |
関係をたどるドット記法。parent.view など |
| 和集合、積集合、除外 | or、and、not |
| zookie (§2.2, §2.4) | snap token、すなわち snap_token フィールド (snap tokens) |
| Check (§2.4.4) | Permission.Check、および BulkCheck (service.proto) |
| Read (§2.4.1) | Data.ReadRelationships、および ReadAttributes |
| Write (§2.4.2) | Data.Write、WriteRelationships、Delete、DeleteRelationships |
| Watch (§2.4.3) | Watch.Watch。サーバーストリーム (Watch operations) |
| Expand (§2.4.5) | Permission.Expand |
| Leopard (§3.2.4) | 相当するものは文書化されていない |
| Spanner (§3.1) | PostgreSQL、またはインメモリエンジン (設定のデフォルト) (configuration) |
Permify には、論文に記述のない検索系の呼び出し LookupEntity、LookupSubject、SubjectPermission もある。
Permify Schema で書いた共通の例
論文の図 1 は、ドキュメントに同心円状の 3 つの関係を与える。所有者は編集者であり、編集者は閲覧者であり、親フォルダの閲覧者はそのドキュメントの閲覧者である (§2.3.1)。以下は、そのモデルを共通の例の型を使って Permify Schema で書いたものである。
entity user {}
entity group {
relation member @user
}
entity folder {
relation viewer @user @group#member
permission view = viewer
}
entity doc {
relation parent @folder
relation owner @user
relation editor @user @group#member
relation viewer @user @group#member
permission edit = owner or editor
permission view = viewer or edit or parent.view
}
@group#member により、関係はユーザーセット、すなわち「このグループのメンバー全員」を保持できる。parent.view は parent 関係をたどってフォルダに移り、そこでフォルダの view 権限を評価する。ドキュメントには “The same traversal rule applies to both relation.userset and relation.permission” (同じたどり方の規則が relation.userset と relation.permission の両方に適用される) とある (modeling)。
共通の例は 5 つのタプルから成る。
doc:readme#owner@user:anne
group:eng#member@user:beto
doc:readme#viewer@group:eng#member
doc:readme#parent@folder:A
folder:A#viewer@user:chen
3 人がそれぞれ readme にアクセスできるのは、どの格納済みタプルとどの規則によるのか。
folder:A から readme への矢印は格納されたタプル (doc:readme#parent@folder:A) である一方、Chen のフォルダへのアクセスから readme へ至る一歩はどこにも格納されていない点に注意されたい。スキーマの parent.view が、論文の tuple_to_userset と同じように、チェック時にそれを計算する。
アーキテクチャ
Permify のサーバー群はどのように作業を分担し、タプルはどこに置かれるのか。
構成要素は以下のとおりで、いずれもドキュメントによる。
- サーバーはデフォルトで HTTP のポート 3476 と gRPC のポート 3478 で待ち受ける (configuration)。データベースの設定項目では、
writerとreaderの URI を別々に指定できる。 - 各 Pod は、チェック結果をプロセスローカルな Ristretto キャッシュに保持する。“there is no shared cache layer” (共有キャッシュ層はない) (cache)。
distributed.enabledを指定すると、Pod は各リクエストをコンシステントハッシュリング上にハッシュする。そのため “subsequent API calls with the same hash will retrieve the response from the instance 2, regardless of which instance that API called from” (同じハッシュを持つ後続の API 呼び出しは、どのインスタンスから呼ばれたかにかかわらず、インスタンス 2 から応答を取得する)。サーキットブレーカーは、データベースが停止している間、データベースへの呼び出しを止める。- PostgreSQL は MVCC でタプルを格納する。Permify は “a separate database snapshot for each write and delete operation” (書き込みと削除の操作ごとに別のデータベーススナップショット) を作成し、任意のガベージコレクタが古いバージョンを削除する。
- 各 Watch ストリームは “opens a long-lived connection with a continuous polling loop against the database” (データベースに対して継続的なポーリングループを回す長寿命の接続を開く) (Watch operations)。
一貫性
Permify の snap token は zookie の役割を果たす。Write がそれを返し、クライアントはそれをリソースとともに保存し、後のチェックで snap_token として送り返す。ドキュメントはこれを “a token that consists of an encoded timestamp” (エンコードされたタイムスタンプから成るトークン) と説明し、アクセスチェックにおいて “to ensure that the snapshot of the access control is at least as fresh as the resource timestamp” (アクセス制御のスナップショットが少なくともリソースのタイムスタンプと同じだけ新しいことを保証するために) 比較されるとしている (snap tokens)。これは、zookie を伴うチェックに対する論文の保証、すなわち “a consistent snapshot no earlier than” the given zookie (与えられた zookie より前でない一貫したスナップショット) と同じものである (§2.4.4)。
共有設定の変更後に行うチェックは、どのようにしてその変更を観測するのか。
トークンがない場合の挙動に注意されたい。論文では、Zanzibar は “choose a reasonably recent snapshot, possibly offering a lower-latency response” (適度に新しいスナップショットを選択し、より低レイテンシな応答を返せる可能性がある) (§2.4.1)。Permify はそうせず、transactions テーブルから最新のトランザクションの ID を読み、そのスナップショットで評価する。結果はその ID を含むキーでキャッシュされる (snap tokens)。キャッシュキーは check_{tenant_id}_{schema_version}:{snapshot_token}:{check_request} である (cache)。したがって新しい書き込みは、古いキーを無効化するのではなく新しいキーを生む。
論文との違い
- 属性と規則。 Permify Schema は属性ベースのチェックのために
attributeとruleを追加している。例:permission view = check_ip_range(ip_range) or admin(modeling)。Zanzibar の書き換えはタプルだけを対象とする (§2.3.1)。 - contextual tuple。 “dynamically added to permission request operations” (権限リクエストの操作に動的に追加される) 関係は、格納済みの関係とともに評価され、書き込まれることはない (contextual tuples)。
- テナント。
Tenancyサービスがテナントを作成、一覧、削除する (service.proto)。論文にはテナントの概念はない。 - ストレージ。 Spanner ではなく、MVCC スナップショットを伴う PostgreSQL を使う。Spanner では TrueTime 機構がすべての ACL 書き込みにタイムスタンプを付ける (§2.2, §3.1)。分散キャッシュは “across availability zones (within an AWS region)” (アベイラビリティゾーンをまたいで (1 つの AWS リージョン内で)) 動作する (cache)。
- 非正規化インデックスがない。 論文は深く入れ子になったグループのチェックに Leopard で応える (§3.2.4)。Permify が文書化しているのは結果のキャッシュとコンシステントハッシュであり、集合インデックスではない。
- Lookup。
LookupEntityとLookupSubjectは「どのリソースか」「どの主体か」という問いに答える。論文の API はこれを扱わない。
現状
- 最初のリリースは 2022-08-03 の v0.0.0-alpha1。最新は 2026-11-05 の v1.7.6。デフォルトブランチへの最後のコミットは 2026-11-10。スター数は約 6.0k (releases、GitHub API、2026-11-13)。
- ライセンス: LICENSE ファイルは 2023-02-14 に Apache-2.0 の本文に置き換えられ (commit 97285f9)、2025-05-12 に “docs: update license” という題のコミットで AGPL-3.0 の本文に置き換えられた (commit 26912d9)。それ以前の 2022 年には、このファイルは Apache-2.0 の本文 (2022-07-14)、次に GPL-3.0 (2022-08-25)、次に AGPL-3.0 (2022-08-26) だった (LICENSE の履歴)。
- 所有者: FusionAuth が買収し、2025-11-20 に Permify のブログで発表された (記事)。FusionAuth の発表ページには日付が記されていない (記事)。どちらもベンダー自身が書いたものである。
- ドキュメントは docs.permify.co から fusionauth.io/permify-docs に移った。
出典
- Permify リポジトリ: https://github.com/Permify/permify
- Permify ドキュメント (FusionAuth): https://fusionauth.io/permify-docs
- Modeling: https://fusionauth.io/permify-docs/getting-started/modeling
- Storing data: https://fusionauth.io/permify-docs/getting-started/sync-data
- Snap tokens: https://fusionauth.io/permify-docs/operations/snap-tokens
- Cache mechanisms: https://fusionauth.io/permify-docs/operations/cache
- Watch operations: https://fusionauth.io/permify-docs/operations/watch
- Contextual tuples: https://fusionauth.io/permify-docs/operations/contextual-tuples
- Configuration: https://fusionauth.io/permify-docs/setting-up/configuration
- gRPC サービス: https://github.com/Permify/permify/blob/master/proto/base/v1/service.proto
- サンプルスキーマ: https://github.com/Permify/permify/blob/master/assets/example-shapes/google-docs-simplified.yaml
- ライセンスの履歴: https://github.com/Permify/permify/commits/master/LICENSE
- ライセンスのコミット: https://github.com/Permify/permify/commit/97285f94d5e40d3f29f22fd01dc972655af122d7、https://github.com/Permify/permify/commit/26912d91f5a8c2ed3298bd29fdefd00f55da17b5
- 買収: https://permify.co/post/fusionauth-acquires-permify/、https://fusionauth.io/blog/fusionauth-acquires-permify
- 製品名: https://fusionauth.io/blog/how-to-get-support-for-fusionauth-fga-permify