policy

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contract

type Contract interface {
	GetChain(entity policycontract.Kind, entityName string, name []byte) ([]byte, error)
	ListChains(entity policycontract.Kind, entityName string, prefix []byte) ([][]byte, error)

	StartTx() MultiTransaction
	SendTx(transaction MultiTransaction) error
}

type MorphRuleChainStorage

type MorphRuleChainStorage struct {
	// contains filtered or unexported fields
}

func NewMorphRuleChainStorage

func NewMorphRuleChainStorage(config *MorphRuleChainStorageConfig) *MorphRuleChainStorage

func (*MorphRuleChainStorage) DeleteBucketPolicy

func (c *MorphRuleChainStorage) DeleteBucketPolicy(ns string, cnrID cid.ID, chainIDs []chain.ID) error

func (*MorphRuleChainStorage) GetAdmin

func (c *MorphRuleChainStorage) GetAdmin() (util.Uint160, error)

func (*MorphRuleChainStorage) GetBucketPolicy

func (c *MorphRuleChainStorage) GetBucketPolicy(ns string, cnrID cid.ID) ([]byte, error)

func (*MorphRuleChainStorage) ListMorphRuleChains

func (c *MorphRuleChainStorage) ListMorphRuleChains(name chain.Name, target engine.Target) ([]*chain.Chain, error)

func (*MorphRuleChainStorage) ListTargetsIterator

func (c *MorphRuleChainStorage) ListTargetsIterator(engine.TargetType) (uuid.UUID, result.Iterator, error)

func (*MorphRuleChainStorage) PutBucketPolicy

func (c *MorphRuleChainStorage) PutBucketPolicy(ns string, cnrID cid.ID, policy []byte, chains []*chain.Chain) error

func (*MorphRuleChainStorage) SaveACLChains

func (c *MorphRuleChainStorage) SaveACLChains(cid string, chains []*chain.Chain) error

type MorphRuleChainStorageConfig

type MorphRuleChainStorageConfig struct {
	Contract Contract
	Cache    *cache.MorphPolicyCache
	Log      *zap.Logger
}

type MultiTransaction

type MultiTransaction interface {
	AddChain(entity policycontract.Kind, entityName string, name []byte, chain []byte)
	RemoveChain(entity policycontract.Kind, entityName string, name []byte)
	Scripts() ([][]byte, error)
}

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(cfg StorageConfig) *Storage

func (*Storage) DeleteBucketPolicy

func (s *Storage) DeleteBucketPolicy(ns string, cnrID cid.ID, chainIDs []chain.ID) error

func (*Storage) GetBucketPolicy

func (s *Storage) GetBucketPolicy(ns string, cnrID cid.ID) ([]byte, error)

func (*Storage) IsAllowed

func (s *Storage) IsAllowed(name chain.Name, target engine.RequestTarget, r resource.Request) (status chain.Status, found bool, err error)

func (*Storage) LocalStorage

func (s *Storage) LocalStorage() engine.LocalOverrideStorage

func (*Storage) PutBucketPolicy

func (s *Storage) PutBucketPolicy(ns string, cnrID cid.ID, policy []byte, policyChains []*chain.Chain) error

func (*Storage) SaveACLChains

func (s *Storage) SaveACLChains(ns string, chains []*chain.Chain) error

type StorageConfig

type StorageConfig struct {
	Contract Contract
	Cache    *cache.MorphPolicyCache
	Log      *zap.Logger
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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