Documentation ¶
Index ¶
- type APIEndpoint
- type CommonAuth
- func (c *CommonAuth) AuthNew(ctx context.Context, perms []permission.Permission) ([]byte, error)
- func (c *CommonAuth) AuthVerify(ctx context.Context, token string) ([]permission.Permission, error)
- func (c *CommonAuth) LogList(ctx context.Context) ([]string, error)
- func (c *CommonAuth) LogSetLevel(ctx context.Context, group, level string) error
- func (c *CommonAuth) Version(ctx context.Context) (common.Version, error)
- type FullAPI
- type IFullAPI
- type ServiceAuth
- type StrategyAuth
- func (o *StrategyAuth) ContainWallet(ctx context.Context, address core.Address) bool
- func (o *StrategyAuth) GetGroupByName(ctx context.Context, name string) (*storage.Group, error)
- func (o *StrategyAuth) GetKeyBindByName(ctx context.Context, name string) (*storage.KeyBind, error)
- func (o *StrategyAuth) GetKeyBinds(ctx context.Context, address string) ([]*storage.KeyBind, error)
- func (o *StrategyAuth) GetMethodTemplateByName(ctx context.Context, name string) (*storage.MethodTemplate, error)
- func (o *StrategyAuth) GetMsgTypeTemplate(ctx context.Context, name string) (*storage.MsgTypeTemplate, error)
- func (o *StrategyAuth) GetWalletTokenInfo(ctx context.Context, token string) (*storage.GroupAuth, error)
- func (o *StrategyAuth) GetWalletTokensByGroup(ctx context.Context, groupName string) ([]string, error)
- func (o *StrategyAuth) ListGroups(ctx context.Context, fromIndex, toIndex int) ([]*storage.Group, error)
- func (o *StrategyAuth) ListKeyBinds(ctx context.Context, fromIndex, toIndex int) ([]*storage.KeyBind, error)
- func (o *StrategyAuth) ListMethodTemplates(ctx context.Context, fromIndex, toIndex int) ([]*storage.MethodTemplate, error)
- func (o *StrategyAuth) ListMsgTypeTemplates(ctx context.Context, fromIndex, toIndex int) ([]*storage.MsgTypeTemplate, error)
- func (o *StrategyAuth) NewGroup(ctx context.Context, name string, keyBindNames []string) error
- func (o *StrategyAuth) NewKeyBindCustom(ctx context.Context, name, address string, codes []int, ...) error
- func (o *StrategyAuth) NewKeyBindFromTemplate(ctx context.Context, name, address, mttName, mtName string) error
- func (o *StrategyAuth) NewMethodTemplate(ctx context.Context, name string, methods []string) error
- func (o *StrategyAuth) NewMsgTypeTemplate(ctx context.Context, name string, codes []int) error
- func (o *StrategyAuth) NewWalletToken(ctx context.Context, groupName string) (token string, err error)
- func (o *StrategyAuth) PullMethodFromKeyBind(ctx context.Context, name string, methods []string) (*storage.KeyBind, error)
- func (o *StrategyAuth) PullMsgTypeFromKeyBind(ctx context.Context, name string, codes []int) (*storage.KeyBind, error)
- func (o *StrategyAuth) PushMethodIntoKeyBind(ctx context.Context, name string, methods []string) (*storage.KeyBind, error)
- func (o *StrategyAuth) PushMsgTypeIntoKeyBind(ctx context.Context, name string, codes []int) (*storage.KeyBind, error)
- func (o *StrategyAuth) RemoveGroup(ctx context.Context, name string) error
- func (o *StrategyAuth) RemoveKeyBind(ctx context.Context, name string) error
- func (o *StrategyAuth) RemoveKeyBindByAddress(ctx context.Context, address string) (int64, error)
- func (o *StrategyAuth) RemoveMethodTemplate(ctx context.Context, name string) error
- func (o *StrategyAuth) RemoveMsgTypeTemplate(ctx context.Context, name string) error
- func (o *StrategyAuth) RemoveToken(ctx context.Context, token string) error
- func (o *StrategyAuth) ScopeWallet(ctx context.Context) (*core.AddressScope, error)
- func (o *StrategyAuth) Verify(ctx context.Context, address core.Address, msgType core.MsgType, ...) error
- type WalletAuth
- func (c *WalletAuth) WalletDelete(ctx context.Context, addr core.Address) error
- func (c *WalletAuth) WalletExport(ctx context.Context, a core.Address) (*core.KeyInfo, error)
- func (c *WalletAuth) WalletHas(ctx context.Context, addr core.Address) (bool, error)
- func (c *WalletAuth) WalletImport(ctx context.Context, ki *core.KeyInfo) (core.Address, error)
- func (c *WalletAuth) WalletList(ctx context.Context) ([]core.Address, error)
- func (c *WalletAuth) WalletNew(ctx context.Context, keyType core.KeyType) (core.Address, error)
- func (c *WalletAuth) WalletSign(ctx context.Context, signer core.Address, toSign []byte, meta core.MsgMeta) (*core.Signature, error)
- type WalletLockAuth
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonAuth ¶
type CommonAuth struct { Internal struct { AuthVerify func(ctx context.Context, token string) ([]permission.Permission, error) `perm:"read"` AuthNew func(ctx context.Context, perms []permission.Permission) ([]byte, error) `perm:"admin"` Version func(context.Context) (common.Version, error) `perm:"read"` LogList func(context.Context) ([]string, error) `perm:"write"` LogSetLevel func(context.Context, string, string) error `perm:"write"` } }
common API permissions constraints
func (*CommonAuth) AuthNew ¶
func (c *CommonAuth) AuthNew(ctx context.Context, perms []permission.Permission) ([]byte, error)
func (*CommonAuth) AuthVerify ¶
func (c *CommonAuth) AuthVerify(ctx context.Context, token string) ([]permission.Permission, error)
func (*CommonAuth) LogSetLevel ¶
func (c *CommonAuth) LogSetLevel(ctx context.Context, group, level string) error
type FullAPI ¶
type FullAPI struct { strategy.ILocalStrategy wallet.ILocalWallet common.ICommon }
type IFullAPI ¶
type IFullAPI interface { strategy.ILocalStrategy wallet.ILocalWallet common.ICommon }
func PermissionedFullAPI ¶
type ServiceAuth ¶
type ServiceAuth struct { CommonAuth WalletAuth WalletLockAuth StrategyAuth }
full service API permissions constraints
type StrategyAuth ¶
type StrategyAuth struct { Internal struct { NewMsgTypeTemplate func(ctx context.Context, name string, codes []int) error `perm:"admin" local:"required"` NewMethodTemplate func(ctx context.Context, name string, methods []string) error `perm:"admin" local:"required"` NewKeyBindCustom func(ctx context.Context, name, address string, codes []int, methods []core.MethodName) error `perm:"admin" local:"required"` NewKeyBindFromTemplate func(ctx context.Context, name, address, mttName, mtName string) error `perm:"admin" local:"required"` NewGroup func(ctx context.Context, name string, keyBindNames []string) error `perm:"admin" local:"required"` NewWalletToken func(ctx context.Context, groupName string) (token string, err error) `perm:"admin" local:"required"` GetMsgTypeTemplate func(ctx context.Context, name string) (*storage.MsgTypeTemplate, error) `perm:"admin" local:"required"` GetMethodTemplateByName func(ctx context.Context, name string) (*storage.MethodTemplate, error) `perm:"admin" local:"required"` GetKeyBindByName func(ctx context.Context, name string) (*storage.KeyBind, error) `perm:"admin" local:"required"` GetKeyBinds func(ctx context.Context, address string) ([]*storage.KeyBind, error) `perm:"admin" local:"required"` GetGroupByName func(ctx context.Context, name string) (*storage.Group, error) `perm:"admin" local:"required"` GetWalletTokensByGroup func(ctx context.Context, groupName string) ([]string, error) `perm:"admin" local:"required"` GetWalletTokenInfo func(ctx context.Context, token string) (*storage.GroupAuth, error) `perm:"admin" local:"required"` ListGroups func(ctx context.Context, fromIndex, toIndex int) ([]*storage.Group, error) `perm:"admin" local:"required"` ListKeyBinds func(ctx context.Context, fromIndex, toIndex int) ([]*storage.KeyBind, error) `perm:"admin" local:"required"` ListMethodTemplates func(ctx context.Context, fromIndex, toIndex int) ([]*storage.MethodTemplate, error) `perm:"admin" local:"required"` ListMsgTypeTemplates func(ctx context.Context, fromIndex, toIndex int) ([]*storage.MsgTypeTemplate, error) `perm:"admin" local:"required"` PushMsgTypeIntoKeyBind func(ctx context.Context, name string, codes []int) (*storage.KeyBind, error) `perm:"admin" local:"required"` PushMethodIntoKeyBind func(ctx context.Context, name string, methods []string) (*storage.KeyBind, error) `perm:"admin" local:"required"` PullMsgTypeFromKeyBind func(ctx context.Context, name string, codes []int) (*storage.KeyBind, error) `perm:"admin" local:"required"` PullMethodFromKeyBind func(ctx context.Context, name string, methods []string) (*storage.KeyBind, error) `perm:"admin" local:"required"` RemoveToken func(ctx context.Context, token string) error `perm:"admin" local:"required"` RemoveKeyBind func(ctx context.Context, name string) error `perm:"admin" local:"required"` RemoveKeyBindByAddress func(ctx context.Context, address string) (int64, error) `perm:"admin" local:"required"` RemoveGroup func(ctx context.Context, name string) error `perm:"admin" local:"required"` RemoveMethodTemplate func(ctx context.Context, name string) error `perm:"admin" local:"required"` RemoveMsgTypeTemplate func(ctx context.Context, name string) error `perm:"admin" local:"required"` ScopeWallet func(ctx context.Context) (*core.AddressScope, error) `perm:"admin" local:"required"` ContainWallet func(ctx context.Context, address core.Address) bool `perm:"admin" local:"required"` Verify func(ctx context.Context, address core.Address, msgType core.MsgType, msg *core.Message) error `perm:"admin" local:"required"` } }
func (*StrategyAuth) ContainWallet ¶
func (*StrategyAuth) GetGroupByName ¶
func (*StrategyAuth) GetKeyBindByName ¶
func (*StrategyAuth) GetKeyBinds ¶
func (*StrategyAuth) GetMethodTemplateByName ¶
func (o *StrategyAuth) GetMethodTemplateByName(ctx context.Context, name string) (*storage.MethodTemplate, error)
func (*StrategyAuth) GetMsgTypeTemplate ¶
func (o *StrategyAuth) GetMsgTypeTemplate(ctx context.Context, name string) (*storage.MsgTypeTemplate, error)
func (*StrategyAuth) GetWalletTokenInfo ¶
func (*StrategyAuth) GetWalletTokensByGroup ¶
func (*StrategyAuth) ListGroups ¶
func (*StrategyAuth) ListKeyBinds ¶
func (*StrategyAuth) ListMethodTemplates ¶
func (o *StrategyAuth) ListMethodTemplates(ctx context.Context, fromIndex, toIndex int) ([]*storage.MethodTemplate, error)
func (*StrategyAuth) ListMsgTypeTemplates ¶
func (o *StrategyAuth) ListMsgTypeTemplates(ctx context.Context, fromIndex, toIndex int) ([]*storage.MsgTypeTemplate, error)
func (*StrategyAuth) NewKeyBindCustom ¶
func (o *StrategyAuth) NewKeyBindCustom(ctx context.Context, name, address string, codes []int, methods []core.MethodName) error
func (*StrategyAuth) NewKeyBindFromTemplate ¶
func (o *StrategyAuth) NewKeyBindFromTemplate(ctx context.Context, name, address, mttName, mtName string) error
func (*StrategyAuth) NewMethodTemplate ¶
func (*StrategyAuth) NewMsgTypeTemplate ¶
func (*StrategyAuth) NewWalletToken ¶
func (*StrategyAuth) PullMethodFromKeyBind ¶
func (*StrategyAuth) PullMsgTypeFromKeyBind ¶
func (*StrategyAuth) PushMethodIntoKeyBind ¶
func (*StrategyAuth) PushMsgTypeIntoKeyBind ¶
func (*StrategyAuth) RemoveGroup ¶
func (o *StrategyAuth) RemoveGroup(ctx context.Context, name string) error
func (*StrategyAuth) RemoveKeyBind ¶
func (o *StrategyAuth) RemoveKeyBind(ctx context.Context, name string) error
func (*StrategyAuth) RemoveKeyBindByAddress ¶
func (*StrategyAuth) RemoveMethodTemplate ¶
func (o *StrategyAuth) RemoveMethodTemplate(ctx context.Context, name string) error
func (*StrategyAuth) RemoveMsgTypeTemplate ¶
func (o *StrategyAuth) RemoveMsgTypeTemplate(ctx context.Context, name string) error
func (*StrategyAuth) RemoveToken ¶
func (o *StrategyAuth) RemoveToken(ctx context.Context, token string) error
func (*StrategyAuth) ScopeWallet ¶
func (o *StrategyAuth) ScopeWallet(ctx context.Context) (*core.AddressScope, error)
type WalletAuth ¶
type WalletAuth struct { Internal struct { WalletNew func(ctx context.Context, kt core.KeyType) (core.Address, error) `perm:"admin"` WalletHas func(ctx context.Context, address core.Address) (bool, error) `perm:"write"` WalletList func(ctx context.Context) ([]core.Address, error) `perm:"write"` WalletSign func(ctx context.Context, signer core.Address, toSign []byte, meta core.MsgMeta) (*core.Signature, error) `perm:"sign"` WalletExport func(ctx context.Context, addr core.Address) (*core.KeyInfo, error) `perm:"admin"` WalletImport func(ctx context.Context, ki *core.KeyInfo) (core.Address, error) `perm:"admin"` WalletDelete func(ctx context.Context, addr core.Address) error `perm:"admin"` } }
wallet API permissions constraints
func (*WalletAuth) WalletDelete ¶
func (*WalletAuth) WalletExport ¶
func (*WalletAuth) WalletImport ¶
func (*WalletAuth) WalletList ¶
type WalletLockAuth ¶
type WalletLockAuth struct { Internal struct { SetPassword func(ctx context.Context, password string) error `perm:"admin" local:"required"` Unlock func(ctx context.Context, password string) error `perm:"admin" local:"required"` Lock func(ctx context.Context, password string) error `perm:"admin" local:"required"` LockState func(ctx context.Context) bool `perm:"admin"` } }
func (*WalletLockAuth) Lock ¶
func (c *WalletLockAuth) Lock(ctx context.Context, password string) error
func (*WalletLockAuth) SetPassword ¶
func (c *WalletLockAuth) SetPassword(ctx context.Context, password string) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.