package engine import ( "git.frostfs.info/TrueCloudLab/policy-engine/pkg/chain" "git.frostfs.info/TrueCloudLab/policy-engine/pkg/resource" ) // Engine ... type Engine interface { // IsAllowed returns status for the operation after all checks. // The second return value signifies whether a matching rule was found. IsAllowed(name chain.Name, namespace string, r resource.Request) (chain.Status, bool) } // CachedChainStorage ... type CachedChainStorage interface { Engine // Adds a policy chain used for all operations with a specific resource. AddResourceChain(name chain.Name, resource string, c *chain.Chain) // Adds a policy chain used for all operations in the namespace. AddNameSpaceChain(name chain.Name, namespace string, c *chain.Chain) // Adds a local policy chain used for all operations with this service. AddOverride(name chain.Name, c *chain.Chain) // Gets the local override with given chain id. GetOverride(name chain.Name, chainID chain.ID) (chain *chain.Chain, found bool) // Remove the local override with given chain id. RemoveOverride(name chain.Name, chainID chain.ID) (removed bool) // ListOverrides returns the list of local overrides. ListOverrides(name chain.Name) []*chain.Chain }