You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feature] add a Kubernetes CRD-backed persistence adapter (casbin-k8s-crd-adapter) for Go Casbin #1674
add a Kubernetes CRD-backed persistence adapter for Go Casbin
Implement a Go adapter that loads Casbin policies from Kubernetes Custom Resources instead of a database. The adapter should satisfy Casbin’s persistence adapter contract and focus on read-only behavior: it must support loading policy into the model and should treat write operations as unsupported to keep CRDs as the source of truth. The code should use the Kubernetes client to list/watch CR instances and translate them into Casbin policy lines, including both permission rules and role/group bindings, so that common RBAC setups work without custom glue.
This needs unit tests that exercise policy loading using a fake Kubernetes client and cover namespace-scoped and cluster-scoped usage, duplicate handling, and deterministic ordering. The adapter should be integrated in a way that callers can plug it into a standard Enforcer and call LoadPolicy without any additional runtime database dependencies.
Activity
hsluoyz commentedon Jan 9, 2026
Repo created at: apache/casbin-crd-adapter#1