auth

package
v0.0.0-...-ef73a9a Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: LGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PreAdmin          = []byte{0x01}
	PreRoleFunc       = []byte{0x02}
	PreRoleToken      = []byte{0x03}
	PreDelegateStatus = []byte{0x04}
)

Functions

func AssignFuncsToRole

func AssignFuncsToRole(native *native.NativeService) ([]byte, error)

func AssignOntIDsToRole

func AssignOntIDsToRole(native *native.NativeService) ([]byte, error)

func Delegate

func Delegate(native *native.NativeService) ([]byte, error)

func Init

func Init()

func InitContractAdmin

func InitContractAdmin(native *native.NativeService) ([]byte, error)

func RegisterAuthContract

func RegisterAuthContract(native *native.NativeService)

func StringsDedupAndSort

func StringsDedupAndSort(s []string) []string

remove duplicates in the slice of string and sorts the slice in increasing order.

func Transfer

func Transfer(native *native.NativeService) ([]byte, error)

func VerifyToken

func VerifyToken(native *native.NativeService) ([]byte, error)

func Withdraw

func Withdraw(native *native.NativeService) ([]byte, error)

Types

type AuthToken

type AuthToken struct {
	// contains filtered or unexported fields
}

func (*AuthToken) Deserialization

func (this *AuthToken) Deserialization(source *common.ZeroCopySource) error

func (*AuthToken) Serialization

func (this *AuthToken) Serialization(sink *common.ZeroCopySink)

type DelegateParam

type DelegateParam struct {
	ContractAddr common.Address
	From         []byte
	To           []byte
	Role         []byte
	Period       uint64
	Level        uint64
	KeyNo        uint64
}

func (*DelegateParam) Deserialization

func (this *DelegateParam) Deserialization(source *common.ZeroCopySource) error

func (*DelegateParam) Serialization

func (this *DelegateParam) Serialization(sink *common.ZeroCopySink)

type DelegateStatus

type DelegateStatus struct {
	AuthToken
	// contains filtered or unexported fields
}

func (*DelegateStatus) Deserialization

func (this *DelegateStatus) Deserialization(source *common.ZeroCopySource) error

func (*DelegateStatus) Serialization

func (this *DelegateStatus) Serialization(sink *common.ZeroCopySink)

type FuncsToRoleParam

type FuncsToRoleParam struct {
	ContractAddr common.Address
	AdminOntID   []byte
	Role         []byte
	FuncNames    []string
	KeyNo        uint64
}

**********************************************

func (*FuncsToRoleParam) Deserialization

func (this *FuncsToRoleParam) Deserialization(source *common.ZeroCopySource) error

func (*FuncsToRoleParam) Serialization

func (this *FuncsToRoleParam) Serialization(sink *common.ZeroCopySink)

type InitContractAdminParam

type InitContractAdminParam struct {
	AdminOntID []byte
}

**********************************************

func (*InitContractAdminParam) Deserialization

func (this *InitContractAdminParam) Deserialization(source *common.ZeroCopySource) error

func (*InitContractAdminParam) Serialization

func (this *InitContractAdminParam) Serialization(sink *common.ZeroCopySink)

type OntIDsToRoleParam

type OntIDsToRoleParam struct {
	ContractAddr common.Address
	AdminOntID   []byte
	Role         []byte
	Persons      [][]byte
	KeyNo        uint64
}

func (*OntIDsToRoleParam) Deserialization

func (this *OntIDsToRoleParam) Deserialization(source *common.ZeroCopySource) error

func (*OntIDsToRoleParam) Serialization

func (this *OntIDsToRoleParam) Serialization(sink *common.ZeroCopySink)

type Status

type Status struct {
	// contains filtered or unexported fields
}

func (*Status) Deserialization

func (this *Status) Deserialization(source *common.ZeroCopySource) error

func (*Status) Serialization

func (this *Status) Serialization(sink *common.ZeroCopySink)

type TransferParam

type TransferParam struct {
	ContractAddr  common.Address
	NewAdminOntID []byte
	KeyNo         uint64
}

**********************************************

func (*TransferParam) Deserialization

func (this *TransferParam) Deserialization(source *common.ZeroCopySource) error

func (*TransferParam) Serialization

func (this *TransferParam) Serialization(sink *common.ZeroCopySink)

type VerifyTokenParam

type VerifyTokenParam struct {
	ContractAddr common.Address
	Caller       []byte
	Fn           string
	KeyNo        uint64
}

func (*VerifyTokenParam) Deserialization

func (this *VerifyTokenParam) Deserialization(source *common.ZeroCopySource) error

func (*VerifyTokenParam) Serialization

func (this *VerifyTokenParam) Serialization(sink *common.ZeroCopySink)

type WithdrawParam

type WithdrawParam struct {
	ContractAddr common.Address
	Initiator    []byte
	Delegate     []byte
	Role         []byte
	KeyNo        uint64
}

func (*WithdrawParam) Deserialization

func (this *WithdrawParam) Deserialization(source *common.ZeroCopySource) error

func (*WithdrawParam) Serialization

func (this *WithdrawParam) Serialization(sink *common.ZeroCopySink)

Jump to

Keyboard shortcuts

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