utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SubModName = "$acl"
	StatusOK   = 200
)

Variables

This section is empty.

Functions

func CheckContractMethodPerm

func CheckContractMethodPerm(aclMgr base.AclManager, aksuri []string,
	contractName, methodName string) (bool, error)

func GetACLSeparator

func GetACLSeparator() string

GetACLSeparator return the acl separator string

func GetAK2AccountBucket

func GetAK2AccountBucket() string

GetAK2AccountBucket return the ak2Account bucket

func GetAKAccountSeparator

func GetAKAccountSeparator() string

GetAKAccountSeparator return the separator between address and account

func GetAccount2ContractBucket

func GetAccount2ContractBucket() string

GetAccount2ContractBucket get the bucket name of account to contract map

func GetAccountACL

func GetAccountACL(aclMgr base.AclManager, account string) (*pb.Acl, error)

GetAccountACL return account acl

func GetAccountBcnameSep

func GetAccountBcnameSep() string

GetAccountBcnameSep return the separator string for account and blockchain name

func GetAccountBucket

func GetAccountBucket() string

GetAccountBucket return the account bucket name

func GetAccountContractValue

func GetAccountContractValue() string

GetAccountContractValue return accountContractValue

func GetAccountPrefix

func GetAccountPrefix() string

GetAccountPrefix return the account prefix

func GetAccountSize

func GetAccountSize() int

GetAccountSize return the account number size

func GetAkLimit

func GetAkLimit() int

GetAkLimit return maximum AK numbers of an ACL

func GetContract2AccountBucket

func GetContract2AccountBucket() string

GetContract2AccountBucket get the bucket name of contract to account map

func GetContractBucket

func GetContractBucket() string

GetContractBucket return the contract bucket name

func GetContractMethodACL

func GetContractMethodACL(aclMgr base.AclManager, contractName, methodName string) (*pb.Acl, error)

GetContractMethodACL return contract method acl

func GetContractNameMaxSize

func GetContractNameMaxSize() int

GetContractNameMaxSize return the contract name max size

func GetContractNameMinSize

func GetContractNameMinSize() int

GetContractNameMinSize return the contract name min size

func IdentifyAK

func IdentifyAK(akuri string, sign *pb.SignatureInfo, msg []byte) (bool, error)

func IdentifyAccount

func IdentifyAccount(aclMgr base.AclManager, account string, aksuri []string) (bool, error)

func IsAccount

func IsAccount(name string) int

func MakeAK2AccountKey

func MakeAK2AccountKey(ak string, accountName string) string

MakeAK2AccountKey generate key mixed ak with account as prefix key

func MakeAccountContractKey

func MakeAccountContractKey(accountName string, contractName string) string

MakeAccountContractKey generate account and contract mapping key

func MakeAccountKey

func MakeAccountKey(bcname string, accountName string) string

MakeAccountKey generate account key using blockchain name and account number

func MakeContractMethodKey

func MakeContractMethodKey(contractName string, methodName string) string

MakeContractMethodKey generate contract and account mapping key

func SplitAccountURI

func SplitAccountURI(akuri string) []string

func ValidRawAccount

func ValidRawAccount(accountName string) error

ValidRawAccount validate account number

func VerifySign

func VerifySign(ak string, si *pb.SignatureInfo, data []byte) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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