acl

package
v0.0.0-...-bda353b Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LIMIT_DELIMITER  = "/"
	PARAM_CERTS      = "certs"
	PARAM_CERTHASHES = "cert_hashes"
	PARAM_ALIASES    = "aliases"
	PARAM_ALIAS      = "alias"
	PUBLIC_KEYS      = "pubkey"
)

Special characters allowed to define customized access rules

View Source
const (
	//AdminPublicKey admin trust orgId
	AdminPublicKey = "public"
	//DposOrgId chainconfig the DPoS of orgId
	DposOrgId = "dpos_org_id"

	//PermissionConsensusOrgId chainconfig orgId for permission consensus, such as tbft
	PermissionConsensusOrgId = "public"
)
View Source
const CONSENSUS = "consensus"
View Source
const ModuleNameAccessControl = "Access Control"

ModuleNameAccessControl "Access Control"

Variables

This section is empty.

Functions

func InitCertSigningParticipant

func InitCertSigningParticipant(chainConfig *config.ChainConfig, localOrgId,
	localPrivKeyFile, localPrivKeyPwd, localCertFile string) (
	protocol.SigningParticipant, error)

InitCertSigningParticipant 初始化一个证书签名的用户 @param chainConfig @param localOrgId @param localPrivKeyFile @param localPrivKeyPwd @param localCertFile @return protocol.SigningParticipant @return error

func InitPKSigningParticipant

func InitPKSigningParticipant(hashType,
	localOrgId, localPrivKeyFile, localPrivKeyPwd string) (protocol.SigningParticipant, error)

InitPKSigningParticipant 初始化一个公钥模式的用户 @param hashType @param localOrgId @param localPrivKeyFile @param localPrivKeyPwd @return protocol.SigningParticipant @return error

func NewCertSigningParticipant

func NewCertSigningParticipant(hashType string, participant *pbac.Participant, privateKeyPem,
	password string) (protocol.SigningParticipant, error)

NewCertSigningParticipant 基于传入的参数新建一个SigningParticipant @param hashType @param participant @param privateKeyPem @param password @return protocol.SigningParticipant @return error

func RegisterACProvider

func RegisterACProvider(authType string, acp ACProvider)

RegisterACProvider registers a ACProvider to global ac registry

Types

type ACProvider

type ACProvider interface {
	NewACProvider(chainConf protocol.ChainConf, localOrgId string,
		store protocol.BlockchainStore, log protocol.Logger, msgBus msgbus.MessageBus) (protocol.AccessControlProvider, error)
}

ACProvider is an interface of ac initialize for different ac implementation

func NewACProviderByParticipantType

func NewACProviderByParticipantType(authType string) ACProvider

NewACProviderByParticipantType returns a ACProvider by authType

type AcFactory

type AcFactory struct {
}

AcFactory 构造AC模块的工厂

func ACFactory

func ACFactory() *AcFactory

ACFactory is a singleton to init ac instance

func (*AcFactory) NewACProvider

func (af *AcFactory) NewACProvider(chainConf protocol.ChainConf, localOrgId string,
	store protocol.BlockchainStore, log protocol.Logger, msgBus msgbus.MessageBus) (
	protocol.AccessControlProvider, error)

NewACProvider return a AccessControlProvider accord to specific AuthType and ConsensusType

Jump to

Keyboard shortcuts

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