Documentation ¶
Index ¶
- Constants
- func CheckContractMethodPerm(aclMgr base.AclManager, akURIs []string, contractName, methodName string) (bool, error)
- func ExtractAddrFromAkURI(akURI string) string
- func ExtractAkFromAuthRequire(authRequire string) string
- func GetACLSeparator() string
- func GetAK2AccountBucket() string
- func GetAKAccountSeparator() string
- func GetAccount2ContractBucket() string
- func GetAccountBcNameSep() string
- func GetAccountBucket() string
- func GetAccountContractValue() string
- func GetAccountNumberSize() int
- func GetAccountPrefix() string
- func GetAkLimit() int
- func GetContract2AccountBucket() string
- func GetContractBucket() string
- func GetContractNameMaxSize() int
- func GetContractNameMinSize() int
- func IdentifyAK(akURI string, sign *pb.SignatureInfo, msg []byte) (bool, error)
- func IdentifyAccount(aclMgr base.AclManager, account string, akURIs []string) (bool, error)
- func IsAK(address string) bool
- func IsAccount(address string) bool
- func MakeAK2AccountKey(ak string, accountName string) string
- func MakeAccountContractKey(accountName string, contractName string) string
- func MakeAccountKey(bcname string, accountName string) string
- func MakeContractMethodKey(contractName string, methodName string) string
- func ValidAccountNumber(number string) error
- func ValidRawAccount(number string) error
- func VerifySign(ak string, si *pb.SignatureInfo, data []byte) (bool, error)
- type AddressType
Constants ¶
const ( SubModName = "$acl" StatusOK = 200 )
Variables ¶
This section is empty.
Functions ¶
func CheckContractMethodPerm ¶
func ExtractAddrFromAkURI ¶
ExtractAddrFromAkURI extracts target address from input for AK, return AK itself for Account, return Account itself for auth requirement `Account/AK`, return AK
func ExtractAkFromAuthRequire ¶
ExtractAkFromAuthRequire extracts required AK from auth requirement return AK in `Account/AK`
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 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 GetAccountNumberSize ¶
func GetAccountNumberSize() int
GetAccountNumberSize return the account number size
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 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 IdentifyAccount ¶
func MakeAK2AccountKey ¶
MakeAK2AccountKey generate key mixed ak with account as prefix key
func MakeAccountContractKey ¶
MakeAccountContractKey generate account and contract mapping key
func MakeAccountKey ¶
MakeAccountKey generate account key using blockchain name and account number
func MakeContractMethodKey ¶
MakeContractMethodKey generate contract and account mapping key
func ValidAccountNumber ¶
ValidAccountNumber validate account number a valid account number pattern is `[0-9]{16}`
func ValidRawAccount ¶
Deprecating, use ValidAccountNumber instead
func VerifySign ¶
Types ¶
type AddressType ¶
type AddressType int
const ( AddressAK AddressType = iota AddressAccount )
func ParseAddressType ¶
func ParseAddressType(address string) (addressType AddressType, isValid bool)
ParseAddressType returns address type when address is valid A valid address is not empty which is AK or Account. A valid Account pattern is `<AccountPrefix><AccountNumber>[@<BlockChainName>]`