util

package
v0.44.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceCondition = "resourcecondition"
	RequestCondition  = "requestcondition"
)

Variables

View Source
var Cmd = &cobra.Command{
	Use:   "util",
	Short: "Utility operations",
	PersistentPreRun: func(cmd *cobra.Command, _ []string) {
		flags := cmd.Flags()

		_ = viper.BindPFlag(commonflags.GenerateKey, flags.Lookup(commonflags.GenerateKey))
		_ = viper.BindPFlag(commonflags.WalletPath, flags.Lookup(commonflags.WalletPath))
		_ = viper.BindPFlag(commonflags.Account, flags.Lookup(commonflags.Account))
	},
}

Functions

func ParseAPEChain added in v0.38.0

func ParseAPEChain(chain *apechain.Chain, rules []string) error

ParseAPEChain parses APE chain rules.

func ParseAPEChainBinaryOrJSON added in v0.38.0

func ParseAPEChainBinaryOrJSON(chain *apechain.Chain, path string) error

func ParseAPERule added in v0.38.0

func ParseAPERule(r *apechain.Rule, rule string) error

ParseAPERule parses access-policy-engine statement from the following form: <status>[:status_detail] <action>... [<condition>...] <resource>...

Examples: deny Object.Put * deny:QuotaLimitReached Object.Put * allow Object.Put * allow Object.Get ResourceCondition:Department=HR RequestCondition:Actor=ownerA * allow Object.Get any ResourceCondition:Department=HR RequestCondition:Actor=ownerA * allow Object.Get all ResourceCondition:Department=HR RequestCondition:Actor=ownerA * allow Object.* * allow Container.* *

func ParseEACLRule

func ParseEACLRule(table *eacl.Table, rule string) error

ParseEACLRule parses eACL table from the following form: <action> <operation> [<filter1> ...] [<target1> ...]

Examples: allow get req:X-Header=123 obj:Attr=value others:0xkey1,key2 system:key3 user:key4

func ParseEACLRules

func ParseEACLRules(table *eacl.Table, rules []string) error

ParseEACLRules parses eACL table. Uses ParseEACLRule.

func PrettyPrintTableBACL

func PrettyPrintTableBACL(cmd *cobra.Command, bacl *acl.Basic)

PrettyPrintTableBACL print basic ACL in table format.

func PrettyPrintTableEACL

func PrettyPrintTableEACL(cmd *cobra.Command, table *eacl.Table)

PrettyPrintTableEACL print extended ACL in table format.

func PrintHumanReadableAPEChain added in v0.38.0

func PrintHumanReadableAPEChain(cmd *cobra.Command, chain *apechain.Chain)

PrintHumanReadableAPEChain print APE chain rules.

Types

This section is empty.

Jump to

Keyboard shortcuts

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