[feature] add a Kubernetes CRD-backed persistence adapter (casbin-k8s-crd-adapter) for Go Casbin
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go, kubernetes
- Domain
- authorization, backend
Research direction
Start by reviewing Casbin’s persistence adapter contract and the Enforcer LoadPolicy entry point, then inspect the Kubernetes client APIs for listing and watching CRD instances. Done means a read-only adapter loads permission rules and role/group bindings through a standard Enforcer, with fake-client tests covering namespace and cluster scope, duplicates, and deterministic ordering.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Go
- Stars
- 20.4k
- Forks
- 1.8k
- Avg merge
- 5d 11h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/casbin
-
question
-
enhancement
-
enhancement
-
enhancement
-
enhancement
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·