Documentation
¶
Overview ¶
Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
- Variables
- func ConstructDBEntriesForClusterAdmins(oldAdmins, newAdmins []*types.Admin, version *types.Version) (*worldstate.DBUpdates, error)
- func ConstructDBEntriesForNodes(oldNodes, newNodes []*types.NodeConfig, version *types.Version) (*worldstate.DBUpdates, error)
- func ConstructDBEntriesForUserAdminTx(tx *types.UserAdministrationTx, version *types.Version) (*worldstate.DBUpdates, error)
- func ConstructProvenanceEntriesForClusterAdmins(userID, txID string, adminUpdates *worldstate.DBUpdates, db worldstate.DB) (*provenance.TxDataForProvenance, error)
- func ConstructProvenanceEntriesForNodes(userID, txID string, nodeUpdates *worldstate.DBUpdates, db worldstate.DB) (*provenance.TxDataForProvenance, error)
- func ConstructProvenanceEntriesForUserAdminTx(tx *types.UserAdministrationTx, version *types.Version, db worldstate.DB) (*provenance.TxDataForProvenance, error)
- type NotFoundErr
- type Querier
- func (q *Querier) DoesUserExist(userID string) (bool, error)
- func (q *Querier) GetAccessControl(userID string) (*types.AccessControl, error)
- func (q *Querier) GetCertificate(userID string) (*x509.Certificate, error)
- func (q *Querier) GetNode(nodeID string) (*types.NodeConfig, *types.Metadata, error)
- func (q *Querier) GetNodeVersion(nodeID string) (*types.Version, error)
- func (q *Querier) GetUser(userID string) (*types.User, *types.Metadata, error)
- func (q *Querier) GetUserVersion(userID string) (*types.Version, error)
- func (q *Querier) HasAdministrationPrivilege(userID string) (bool, error)
- func (q *Querier) HasLedgerAccess(userID string) (bool, error)
- func (q *Querier) HasReadAccessOnDataDB(userID, dbName string) (bool, error)
- func (q *Querier) HasReadWriteAccess(userID, dbName string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
var ( // UserNamespace holds the user identity information in the user db UserNamespace = []byte{0} // NodeNamespace holds the node identity information in the config db NodeNamespace = []byte{0} )
Functions ¶
func ConstructDBEntriesForClusterAdmins ¶
func ConstructDBEntriesForClusterAdmins(oldAdmins, newAdmins []*types.Admin, version *types.Version) (*worldstate.DBUpdates, error)
ConstructDBEntriesForClusterAdmins constructs database entries for the cluster admins
func ConstructDBEntriesForNodes ¶
func ConstructDBEntriesForNodes(oldNodes, newNodes []*types.NodeConfig, version *types.Version) (*worldstate.DBUpdates, error)
ConstructDBEntriesForNodes constructs database entries for the nodes present in the clusterr
func ConstructDBEntriesForUserAdminTx ¶
func ConstructDBEntriesForUserAdminTx(tx *types.UserAdministrationTx, version *types.Version) (*worldstate.DBUpdates, error)
ConstructDBEntriesForUserAdminTx constructs database entries for the transaction that manipulates user information
func ConstructProvenanceEntriesForClusterAdmins ¶
func ConstructProvenanceEntriesForClusterAdmins( userID, txID string, adminUpdates *worldstate.DBUpdates, db worldstate.DB, ) (*provenance.TxDataForProvenance, error)
ConstructProvenanceEntriesForClusterAdmins constructs provenance entries for the transaction that manipulates cluster admins
func ConstructProvenanceEntriesForNodes ¶
func ConstructProvenanceEntriesForNodes( userID, txID string, nodeUpdates *worldstate.DBUpdates, db worldstate.DB, ) (*provenance.TxDataForProvenance, error)
ConstructProvenanceEntriesForNodes constructs provenance entries for the transaction that manipulates nodes present in the cluster configuration
func ConstructProvenanceEntriesForUserAdminTx ¶
func ConstructProvenanceEntriesForUserAdminTx( tx *types.UserAdministrationTx, version *types.Version, db worldstate.DB, ) (*provenance.TxDataForProvenance, error)
ConstructProvenanceEntriesForUserAdminTx constructs provenance entries for the transaction that manipulates
Types ¶
type NotFoundErr ¶
type NotFoundErr struct {
// contains filtered or unexported fields
}
NotFoundErr denotes that the id does not exist in the worldstate
func (*NotFoundErr) Error ¶
func (e *NotFoundErr) Error() string
type Querier ¶
type Querier struct {
// contains filtered or unexported fields
}
Querier provides method to query both user and admin information
func NewQuerier ¶
func NewQuerier(db worldstate.DB) *Querier
NewQuerier returns a querier to fetch identity and related credentials
func (*Querier) DoesUserExist ¶
DoesUserExist returns true if the given user exist. Otherwise, it return false
func (*Querier) GetAccessControl ¶
func (q *Querier) GetAccessControl(userID string) (*types.AccessControl, error)
GetAccessControl returns the ACL defined on the userID
func (*Querier) GetCertificate ¶
func (q *Querier) GetCertificate(userID string) (*x509.Certificate, error)
GetCertificate returns the current certificate associated with a given userID
func (*Querier) GetNodeVersion ¶
GetNodeVersion returns the current version of a given nodeID
func (*Querier) GetUser ¶
GetUser returns the credentials associated with the given non-admin userID
func (*Querier) GetUserVersion ¶
GetUserVersion returns the current version of a given userID
func (*Querier) HasAdministrationPrivilege ¶
HasAdministrationPrivilege returns true if the given userID has privilege to perform administrative tasks
func (*Querier) HasLedgerAccess ¶
HasLedgerAccess check is user has access to ledger data For now, all users has this access, so only user existence validated
func (*Querier) HasReadAccessOnDataDB ¶
HasReadAccessOnDataDB returns true if the given userID has read access on the given dbName. Otherwise, it returns false