Documentation ¶
Overview ¶
Package configmapadapter provides a Casbin adapter that uses a Kubernetes ConfigMap as the storage.
Index ¶
- type Adapter
- func (a *Adapter) AddPolicy(_ string, _ string, _ []string) error
- func (a *Adapter) ConfigMap(ctx context.Context) (*corev1.ConfigMap, error)
- func (a *Adapter) LoadPolicy(model model.Model) error
- func (a *Adapter) RemoveFilteredPolicy(_ string, _ string, _ int, _ ...string) error
- func (a *Adapter) RemovePolicy(_ string, _ string, _ []string) error
- func (a *Adapter) SavePolicy(_ model.Model) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter is the ConfigMap adapter for Casbin. It can load policy from ConfigMap and save policy to ConfigMap.
func New ¶
func New( l *zap.SugaredLogger, kubeClient *kubernetes.Kubernetes, namespacedName types.NamespacedName, ) *Adapter
New constructs a new adapter that manages a policy inside a ConfigMap.
func (*Adapter) LoadPolicy ¶
LoadPolicy loads all policy rules from the storage.
func (*Adapter) RemoveFilteredPolicy ¶
RemoveFilteredPolicy removes policy rules that match the filter from the storage.
func (*Adapter) RemovePolicy ¶
RemovePolicy removes a policy rule from the storage.
Click to show internal directories.
Click to hide internal directories.