policy

package
v0.0.0-...-614d85d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	Evaluate(r authz.Request) authz.DecisionType
}

Engine defines API for the ACL evaluation engine

func NewEngine

func NewEngine(bw watcher.BucketsWatcher) (Engine, error)

NewEngine creates a policy engine backed by latest ACLs in buckets at the given path

type Store

type Store interface {
	// Get returns list of ACLs of the bucket, nil if no policy is found
	Get(bucketName string) authz.ACLList
	// Set replaces old ACLs of the bucket (if existed) with the new list
	Set(bucketName string, acls authz.ACLList) error
	// Add appends new ACLs to the existing ACLs of the bucket
	Add(bucketName string, acls authz.ACLList) error
	// Delete removes ACLs of the specific bucket
	Delete(bucketName string)

	// SerializePolicies returns the serialized string of policies
	SerializePolicies() (string, error)
}

Store defines APIs for the policy store

func NewStore

func NewStore(policies authz.PoliciesType) Store

TODO remove when no usage

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL