Documentation ¶
Index ¶
- Variables
- func CheckAccountPermission(from common.Address, to *common.Address, value *big.Int, data []byte, ...) error
- func CheckIfAdminAccount(acctId common.Address) bool
- func GetNodeUrl(enodeId string, ip string, port uint16, raftport uint16, isRaft bool) string
- func GetSyncStatus() bool
- func IsNodePermissioned(nodename string, currentNode string, datadir string, direction string) bool
- func IsTransactionAllowed(from common.Address, to common.Address, value *big.Int, gasPrice *big.Int, ...) error
- func IsV2Permission() bool
- func PermissionsEnabled() bool
- func SetDefaults(nwRoleId, oaRoleId string, permissionV2 bool)
- func SetNetworkBootUpCompleted()
- func SetQIP714BlockReached()
- func SetSyncStatus()
- func ValidateNodeForTxn(nodeId enode.ID, from common.Address) bool
- type AccessType
- type AccountInfo
- type AccountKey
- type AcctCache
- func (a *AcctCache) GetAccount(acct common.Address) (*AccountInfo, error)
- func (a *AcctCache) GetAcctList() []AccountInfo
- func (a *AcctCache) GetAcctListOrg(orgId string) []AccountInfo
- func (a *AcctCache) GetAcctListRole(orgId, roleId string) []AccountInfo
- func (a *AcctCache) PopulateCacheFunc(cf func(common.Address) (*AccountInfo, error))
- func (a *AcctCache) UpsertAccount(orgId string, role string, acct common.Address, orgAdmin bool, ...)
- type AcctStatus
- type FileBasedPermissioning
- func (fbp *FileBasedPermissioning) IsNodePermissioned(nodename string, currentNode string, datadir string, direction string) bool
- func (fbp *FileBasedPermissioning) IsNodePermissionedEnode(node *enode.Node, nodename string, currentNode string, datadir string, ...) bool
- func (fbp *FileBasedPermissioning) ParsePermissionedNodes(DataDir string) []*enode.Node
- type NodeCache
- func (n *NodeCache) GetNodeByUrl(url string) (*NodeInfo, error)
- func (n *NodeCache) GetNodeList() []NodeInfo
- func (n *NodeCache) PopulateCacheFunc(cf func(string) (*NodeInfo, error))
- func (n *NodeCache) PopulateValidateFunc(cf func(string, string) bool)
- func (n *NodeCache) UpsertNode(orgId string, url string, status NodeStatus)
- type NodeInfo
- type NodeKey
- type NodeStatus
- type OrgCache
- func (o *OrgCache) GetOrg(orgId string) (*OrgInfo, error)
- func (o *OrgCache) GetOrgList() []OrgInfo
- func (o *OrgCache) PopulateCacheFunc(cf func(string) (*OrgInfo, error))
- func (o *OrgCache) UpsertOrg(orgId, parentOrg, ultimateParent string, level *big.Int, status OrgStatus)
- func (o *OrgCache) UpsertOrgWithSubOrgList(orgRec *OrgInfo)
- type OrgDetailInfo
- type OrgInfo
- type OrgKey
- type OrgStatus
- type PermissionModelType
- type RoleCache
- func (r *RoleCache) GetRole(orgId string, roleId string) (*RoleInfo, error)
- func (r *RoleCache) GetRoleList() []RoleInfo
- func (r *RoleCache) PopulateCacheFunc(cf func(*RoleKey) (*RoleInfo, error))
- func (r *RoleCache) UpsertRole(orgId string, role string, voter bool, admin bool, access AccessType, ...)
- type RoleInfo
- type RoleKey
- type TransactionType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OrgInfoMap *OrgCache NodeInfoMap *NodeCache RoleInfoMap *RoleCache AcctInfoMap *AcctCache )
View Source
var PermissionModel = Default
Functions ¶
func CheckAccountPermission ¶
func CheckAccountPermission(from common.Address, to *common.Address, value *big.Int, data []byte, gas uint64, gasPrice *big.Int) error
function checks for account access to execute the transaction
func CheckIfAdminAccount ¶
checks if the passed account is linked to a org admin or network admin role
func GetNodeUrl ¶
func GetSyncStatus ¶
func GetSyncStatus() bool
func IsNodePermissioned ¶
func IsTransactionAllowed ¶
func IsTransactionAllowed(from common.Address, to common.Address, value *big.Int, gasPrice *big.Int, gasLimit *big.Int, payload []byte, transactionType TransactionType) error
checks if the account permission allows the transaction to be executed
func IsV2Permission ¶
func IsV2Permission() bool
func PermissionsEnabled ¶
func PermissionsEnabled() bool
return bool to indicate if permissions is enabled
func SetDefaults ¶
sets default access to readonly and initializes the values for network admin role and org admin role
func SetNetworkBootUpCompleted ¶
func SetNetworkBootUpCompleted()
sets the network boot completed as true
func SetSyncStatus ¶
func SetSyncStatus()
Types ¶
type AccessType ¶
type AccessType uint8
const ( // common access type list for both V1 and V2 model. // the first 4 are used by both models // last 3 are used by V2 in alignment with EEA specs ReadOnly AccessType = iota Transact ContractDeploy FullAccess // below access types are only used by V2 model ContractCall TransactAndContractCall TransactAndContractDeploy ContractCallAndDeploy )
func GetAcctAccess ¶
func GetAcctAccess(acctId common.Address) AccessType
Returns the access type for an account. If not found returns default access
func GetDefaults ¶
func GetDefaults() (string, string, AccessType)
type AccountInfo ¶
type AccountKey ¶
type AcctCache ¶
type AcctCache struct {
// contains filtered or unexported fields
}
func NewAcctCache ¶
func (*AcctCache) GetAccount ¶
func (a *AcctCache) GetAccount(acct common.Address) (*AccountInfo, error)
func (*AcctCache) GetAcctList ¶
func (a *AcctCache) GetAcctList() []AccountInfo
func (*AcctCache) GetAcctListOrg ¶
func (a *AcctCache) GetAcctListOrg(orgId string) []AccountInfo
func (*AcctCache) GetAcctListRole ¶
func (a *AcctCache) GetAcctListRole(orgId, roleId string) []AccountInfo
func (*AcctCache) PopulateCacheFunc ¶
func (a *AcctCache) PopulateCacheFunc(cf func(common.Address) (*AccountInfo, error))
func (*AcctCache) UpsertAccount ¶
type AcctStatus ¶
type AcctStatus uint8
const ( AcctPendingApproval AcctStatus = iota + 1 AcctActive AcctInactive AcctSuspended AcctBlacklisted AdminRevoked AcctRecoveryInitiated AcctRecoveryCompleted )
type FileBasedPermissioning ¶
func NewFileBasedPermissoningWithPrefix ¶
func NewFileBasedPermissoningWithPrefix(prefix string) FileBasedPermissioning
func (*FileBasedPermissioning) IsNodePermissioned ¶
func (fbp *FileBasedPermissioning) IsNodePermissioned(nodename string, currentNode string, datadir string, direction string) bool
check if a given node is permissioned to connect to the change
func (*FileBasedPermissioning) IsNodePermissionedEnode ¶
func (*FileBasedPermissioning) ParsePermissionedNodes ¶
func (fbp *FileBasedPermissioning) ParsePermissionedNodes(DataDir string) []*enode.Node
type NodeCache ¶
type NodeCache struct {
// contains filtered or unexported fields
}
func NewNodeCache ¶
func (*NodeCache) GetNodeList ¶
func (*NodeCache) PopulateCacheFunc ¶
func (*NodeCache) PopulateValidateFunc ¶
func (*NodeCache) UpsertNode ¶
func (n *NodeCache) UpsertNode(orgId string, url string, status NodeStatus)
type NodeInfo ¶
type NodeInfo struct { OrgId string `json:"orgId"` Url string `json:"url"` Status NodeStatus `json:"status"` // contains filtered or unexported fields }
type NodeStatus ¶
type NodeStatus uint8
const ( NodePendingApproval NodeStatus = iota + 1 NodeApproved NodeDeactivated NodeBlackListed NodeRecoveryInitiated )
type OrgCache ¶
type OrgCache struct {
// contains filtered or unexported fields
}
func NewOrgCache ¶
func (*OrgCache) GetOrgList ¶
func (*OrgCache) PopulateCacheFunc ¶
func (*OrgCache) UpsertOrgWithSubOrgList ¶
type OrgDetailInfo ¶
type OrgDetailInfo struct { NodeList []NodeInfo `json:"nodeList"` RoleList []RoleInfo `json:"roleList"` AcctList []AccountInfo `json:"acctList"` SubOrgList []string `json:"subOrgList"` }
type PermissionModelType ¶
type PermissionModelType uint8
const ( V1 PermissionModelType = iota V2 Default )
type RoleCache ¶
type RoleCache struct {
// contains filtered or unexported fields
}
func NewRoleCache ¶
func (*RoleCache) GetRoleList ¶
func (*RoleCache) PopulateCacheFunc ¶
func (*RoleCache) UpsertRole ¶
type TransactionType ¶
type TransactionType uint8
const ( ValueTransferTxn TransactionType = iota ContractCallTxn ContractDeployTxn )
Click to show internal directories.
Click to hide internal directories.