Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func GetBucketPolicyForAccountKey(resourceID math.Uint, addr sdk.AccAddress) []byte
- func GetBucketPolicyForGroupKey(resourceID math.Uint) []byte
- func GetGroupPolicyForAccountKey(resourceID math.Uint, addr sdk.AccAddress) []byte
- func GetObjectPolicyForAccountKey(resourceID math.Uint, addr sdk.AccAddress) []byte
- func GetObjectPolicyForGroupKey(resourceID math.Uint) []byte
- func GetPolicyByIDKey(policyID math.Uint) []byte
- func GetPolicyForAccountKey(resourceID math.Uint, resourceType resource.ResourceType, addr sdk.AccAddress) []byte
- func GetPolicyForGroupKey(resourceID math.Uint, resourceType resource.ResourceType) []byte
- func KeyPrefix(p string) []byte
- func ParamKeyTable() paramtypes.KeyTable
- func RegisterCodec(cdc *codec.LegacyAmino)
- func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- type AccountKeeper
- type ActionType
- type BankKeeper
- type Effect
- type EventDeletePolicy
- func (*EventDeletePolicy) Descriptor() ([]byte, []int)
- func (m *EventDeletePolicy) Marshal() (dAtA []byte, err error)
- func (m *EventDeletePolicy) MarshalTo(dAtA []byte) (int, error)
- func (m *EventDeletePolicy) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EventDeletePolicy) ProtoMessage()
- func (m *EventDeletePolicy) Reset()
- func (m *EventDeletePolicy) Size() (n int)
- func (m *EventDeletePolicy) String() string
- func (m *EventDeletePolicy) Unmarshal(dAtA []byte) error
- func (m *EventDeletePolicy) XXX_DiscardUnknown()
- func (m *EventDeletePolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventDeletePolicy) XXX_Merge(src proto.Message)
- func (m *EventDeletePolicy) XXX_Size() int
- func (m *EventDeletePolicy) XXX_Unmarshal(b []byte) error
- type EventPutPolicy
- func (*EventPutPolicy) Descriptor() ([]byte, []int)
- func (m *EventPutPolicy) GetPrincipal() *Principal
- func (m *EventPutPolicy) GetResourceType() resource.ResourceType
- func (m *EventPutPolicy) GetStatements() []*Statement
- func (m *EventPutPolicy) Marshal() (dAtA []byte, err error)
- func (m *EventPutPolicy) MarshalTo(dAtA []byte) (int, error)
- func (m *EventPutPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EventPutPolicy) ProtoMessage()
- func (m *EventPutPolicy) Reset()
- func (m *EventPutPolicy) Size() (n int)
- func (m *EventPutPolicy) String() string
- func (m *EventPutPolicy) Unmarshal(dAtA []byte) error
- func (m *EventPutPolicy) XXX_DiscardUnknown()
- func (m *EventPutPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventPutPolicy) XXX_Merge(src proto.Message)
- func (m *EventPutPolicy) XXX_Size() int
- func (m *EventPutPolicy) XXX_Unmarshal(b []byte) error
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetParams() Params
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (gs GenesisState) Validate() error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type Int
- type MsgClient
- type MsgServer
- type Params
- func (*Params) Descriptor() ([]byte, []int)
- func (m *Params) GetMaximumGroupNum() uint64
- func (m *Params) GetMaximumStatementsNum() uint64
- func (m *Params) Marshal() (dAtA []byte, err error)
- func (m *Params) MarshalTo(dAtA []byte) (int, error)
- func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
- func (*Params) ProtoMessage()
- func (m *Params) Reset()
- func (m *Params) Size() (n int)
- func (p Params) String() string
- func (m *Params) Unmarshal(dAtA []byte) error
- func (p Params) Validate() error
- func (m *Params) XXX_DiscardUnknown()
- func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Params) XXX_Merge(src proto.Message)
- func (m *Params) XXX_Size() int
- func (m *Params) XXX_Unmarshal(b []byte) error
- type Policy
- func (*Policy) Descriptor() ([]byte, []int)
- func (p *Policy) Eval(action ActionType, resource *string) Effect
- func (p *Policy) GetGroupMemberStatement() (*Statement, bool)
- func (m *Policy) GetMemberStatement() *Statement
- func (m *Policy) GetPrincipal() *Principal
- func (m *Policy) GetResourceType() resource.ResourceType
- func (m *Policy) GetStatements() []*Statement
- func (m *Policy) Marshal() (dAtA []byte, err error)
- func (m *Policy) MarshalTo(dAtA []byte) (int, error)
- func (m *Policy) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Policy) ProtoMessage()
- func (m *Policy) Reset()
- func (m *Policy) Size() (n int)
- func (m *Policy) String() string
- func (m *Policy) Unmarshal(dAtA []byte) error
- func (m *Policy) XXX_DiscardUnknown()
- func (m *Policy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Policy) XXX_Merge(src proto.Message)
- func (m *Policy) XXX_Size() int
- func (m *Policy) XXX_Unmarshal(b []byte) error
- type PolicyGroup
- func (*PolicyGroup) Descriptor() ([]byte, []int)
- func (m *PolicyGroup) GetItems() []*PolicyGroup_Item
- func (m *PolicyGroup) Marshal() (dAtA []byte, err error)
- func (m *PolicyGroup) MarshalTo(dAtA []byte) (int, error)
- func (m *PolicyGroup) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PolicyGroup) ProtoMessage()
- func (m *PolicyGroup) Reset()
- func (m *PolicyGroup) Size() (n int)
- func (m *PolicyGroup) String() string
- func (m *PolicyGroup) Unmarshal(dAtA []byte) error
- func (m *PolicyGroup) XXX_DiscardUnknown()
- func (m *PolicyGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PolicyGroup) XXX_Merge(src proto.Message)
- func (m *PolicyGroup) XXX_Size() int
- func (m *PolicyGroup) XXX_Unmarshal(b []byte) error
- type PolicyGroup_Item
- func (*PolicyGroup_Item) Descriptor() ([]byte, []int)
- func (m *PolicyGroup_Item) Marshal() (dAtA []byte, err error)
- func (m *PolicyGroup_Item) MarshalTo(dAtA []byte) (int, error)
- func (m *PolicyGroup_Item) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PolicyGroup_Item) ProtoMessage()
- func (m *PolicyGroup_Item) Reset()
- func (m *PolicyGroup_Item) Size() (n int)
- func (m *PolicyGroup_Item) String() string
- func (m *PolicyGroup_Item) Unmarshal(dAtA []byte) error
- func (m *PolicyGroup_Item) XXX_DiscardUnknown()
- func (m *PolicyGroup_Item) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PolicyGroup_Item) XXX_Merge(src proto.Message)
- func (m *PolicyGroup_Item) XXX_Size() int
- func (m *PolicyGroup_Item) XXX_Unmarshal(b []byte) error
- type Principal
- func (*Principal) Descriptor() ([]byte, []int)
- func (p *Principal) GetAccountAddress() (sdk.AccAddress, error)
- func (p *Principal) GetGroupID() (sdkmath.Uint, error)
- func (m *Principal) GetType() PrincipalType
- func (m *Principal) GetValue() string
- func (m *Principal) Marshal() (dAtA []byte, err error)
- func (m *Principal) MarshalTo(dAtA []byte) (int, error)
- func (m *Principal) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (p *Principal) MustGetAccountAddress() sdk.AccAddress
- func (p *Principal) MustGetGroupID() sdkmath.Uint
- func (*Principal) ProtoMessage()
- func (m *Principal) Reset()
- func (m *Principal) Size() (n int)
- func (m *Principal) String() string
- func (m *Principal) Unmarshal(dAtA []byte) error
- func (p *Principal) ValidateBasic() error
- func (m *Principal) XXX_DiscardUnknown()
- func (m *Principal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Principal) XXX_Merge(src proto.Message)
- func (m *Principal) XXX_Size() int
- func (m *Principal) XXX_Unmarshal(b []byte) error
- type PrincipalType
- type QueryClient
- type QueryParamsRequest
- func (*QueryParamsRequest) Descriptor() ([]byte, []int)
- func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryParamsRequest) ProtoMessage()
- func (m *QueryParamsRequest) Reset()
- func (m *QueryParamsRequest) Size() (n int)
- func (m *QueryParamsRequest) String() string
- func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error
- func (m *QueryParamsRequest) XXX_DiscardUnknown()
- func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryParamsRequest) XXX_Merge(src proto.Message)
- func (m *QueryParamsRequest) XXX_Size() int
- func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error
- type QueryParamsResponse
- func (*QueryParamsResponse) Descriptor() ([]byte, []int)
- func (m *QueryParamsResponse) GetParams() Params
- func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryParamsResponse) ProtoMessage()
- func (m *QueryParamsResponse) Reset()
- func (m *QueryParamsResponse) Size() (n int)
- func (m *QueryParamsResponse) String() string
- func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error
- func (m *QueryParamsResponse) XXX_DiscardUnknown()
- func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryParamsResponse) XXX_Merge(src proto.Message)
- func (m *QueryParamsResponse) XXX_Size() int
- func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error
- type QueryServer
- type Statement
- func (*Statement) Descriptor() ([]byte, []int)
- func (s *Statement) Eval(action ActionType, resource *string) Effect
- func (m *Statement) GetActions() []ActionType
- func (m *Statement) GetEffect() Effect
- func (m *Statement) GetResources() []string
- func (m *Statement) Marshal() (dAtA []byte, err error)
- func (m *Statement) MarshalTo(dAtA []byte) (int, error)
- func (m *Statement) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Statement) ProtoMessage()
- func (m *Statement) Reset()
- func (m *Statement) Size() (n int)
- func (m *Statement) String() string
- func (m *Statement) Unmarshal(dAtA []byte) error
- func (s *Statement) ValidateBasic() error
- func (m *Statement) XXX_DiscardUnknown()
- func (m *Statement) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Statement) XXX_Merge(src proto.Message)
- func (m *Statement) XXX_Size() int
- func (m *Statement) XXX_Unmarshal(b []byte) error
- type Uint
- type UnimplementedMsgServer
- type UnimplementedQueryServer
Constants ¶
const ( // ModuleName defines the module name ModuleName = "permission" // StoreKey defines the primary module store key StoreKey = ModuleName // RouterKey defines the module's message routing key RouterKey = ModuleName // MemStoreKey defines the in-memory store key MemStoreKey = "mem_permission" )
const ( DefaultMaxStatementsNum uint64 = 10 DefaultMaxPolicyGroupNum uint64 = 10 )
const DefaultIndex uint64 = 1
DefaultIndex is the default global index
Variables ¶
var ( Amino = codec.NewLegacyAmino() ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) )
var ( ErrInvalidLengthCommon = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCommon = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupCommon = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidPrincipal = errors.Register(ModuleName, 1100, "Invalid principal") ErrInvalidStatement = errors.Register(ModuleName, 1101, "Invalid statement") ErrInvalidPolicy = errors.Register(ModuleName, 1102, "Invalid policy") ErrInvalidResourceType = errors.Register(ModuleName, 1103, "Invalid resource type") ErrLimitExceeded = errors.Register(ModuleName, 1105, "Num limit exceeded") )
x/permission module sentinel errors
var ( ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( BucketPolicyForAccountPrefix = []byte{0x11} ObjectPolicyForAccountPrefix = []byte{0x12} GroupPolicyForAccountPrefix = []byte{0x13} BucketPolicyForGroupPrefix = []byte{0x21} ObjectPolicyForGroupPrefix = []byte{0x22} PolicyByIDPrefix = []byte{0x31} PolicySequencePrefix = []byte{0x41} )
var ( KeyMaxStatementsNum = []byte("MaxStatementsNum") KeyMaxPolicyGroupNum = []byte("MaxPolicyGroupNum") )
var ( ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )
var ActionType_name = map[int32]string{
0: "ACTION_UPDATE_BUCKET_INFO",
1: "ACTION_DELETE_BUCKET",
2: "ACTION_CREATE_OBJECT",
3: "ACTION_DELETE_OBJECT",
4: "ACTION_COPY_OBJECT",
5: "ACTION_GET_OBJECT",
6: "ACTION_EXECUTE_OBJECT",
7: "ACTION_LIST_OBJECT",
8: "ACTION_UPDATE_GROUP_MEMBER",
9: "ACTION_DELETE_GROUP",
10: "ACTION_GROUP_MEMBER",
99: "ACTION_TYPE_ALL",
}
var ActionType_value = map[string]int32{
"ACTION_UPDATE_BUCKET_INFO": 0,
"ACTION_DELETE_BUCKET": 1,
"ACTION_CREATE_OBJECT": 2,
"ACTION_DELETE_OBJECT": 3,
"ACTION_COPY_OBJECT": 4,
"ACTION_GET_OBJECT": 5,
"ACTION_EXECUTE_OBJECT": 6,
"ACTION_LIST_OBJECT": 7,
"ACTION_UPDATE_GROUP_MEMBER": 8,
"ACTION_DELETE_GROUP": 9,
"ACTION_GROUP_MEMBER": 10,
"ACTION_TYPE_ALL": 99,
}
var Effect_name = map[int32]string{
0: "EFFECT_ALLOW",
1: "EFFECT_DENY",
2: "EFFECT_PASS",
}
var Effect_value = map[string]int32{
"EFFECT_ALLOW": 0,
"EFFECT_DENY": 1,
"EFFECT_PASS": 2,
}
var PrincipalType_name = map[int32]string{
0: "TYPE_GNFD_ACCOUNT",
1: "TYPE_GNFD_GROUP",
}
var PrincipalType_value = map[string]int32{
"TYPE_GNFD_ACCOUNT": 0,
"TYPE_GNFD_GROUP": 1,
}
Functions ¶
func GetBucketPolicyForAccountKey ¶ added in v0.0.8
func GetBucketPolicyForAccountKey(resourceID math.Uint, addr sdk.AccAddress) []byte
func GetBucketPolicyForGroupKey ¶ added in v0.0.8
func GetGroupPolicyForAccountKey ¶ added in v0.0.8
func GetGroupPolicyForAccountKey(resourceID math.Uint, addr sdk.AccAddress) []byte
func GetObjectPolicyForAccountKey ¶ added in v0.0.8
func GetObjectPolicyForAccountKey(resourceID math.Uint, addr sdk.AccAddress) []byte
func GetObjectPolicyForGroupKey ¶ added in v0.0.8
func GetPolicyByIDKey ¶
func GetPolicyForAccountKey ¶ added in v0.0.8
func GetPolicyForAccountKey(resourceID math.Uint, resourceType resource.ResourceType, addr sdk.AccAddress) []byte
func GetPolicyForGroupKey ¶ added in v0.0.8
func GetPolicyForGroupKey(resourceID math.Uint, resourceType resource.ResourceType) []byte
func ParamKeyTable ¶
func ParamKeyTable() paramtypes.KeyTable
ParamKeyTable the param key table for launch module
func RegisterCodec ¶
func RegisterCodec(cdc *codec.LegacyAmino)
func RegisterInterfaces ¶
func RegisterInterfaces(registry cdctypes.InterfaceRegistry)
func RegisterMsgServer ¶
func RegisterQueryHandler ¶
RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQueryHandlerClient ¶
func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.
func RegisterQueryHandlerFromEndpoint ¶
func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQueryHandlerServer ¶
func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
Types ¶
type AccountKeeper ¶
AccountKeeper defines the expected account keeper used for simulations (noalias)
type ActionType ¶
type ActionType int32
ActionType defines the operations you can execute in greenfield storage network
const ( ACTION_UPDATE_BUCKET_INFO ActionType = 0 ACTION_DELETE_BUCKET ActionType = 1 ACTION_CREATE_OBJECT ActionType = 2 ACTION_DELETE_OBJECT ActionType = 3 ACTION_COPY_OBJECT ActionType = 4 ACTION_GET_OBJECT ActionType = 5 ACTION_EXECUTE_OBJECT ActionType = 6 ACTION_LIST_OBJECT ActionType = 7 ACTION_UPDATE_GROUP_MEMBER ActionType = 8 ACTION_DELETE_GROUP ActionType = 9 ACTION_GROUP_MEMBER ActionType = 10 ACTION_TYPE_ALL ActionType = 99 )
func (ActionType) EnumDescriptor ¶
func (ActionType) EnumDescriptor() ([]byte, []int)
func (ActionType) String ¶
func (x ActionType) String() string
type BankKeeper ¶
BankKeeper defines the expected interface needed to retrieve account balances.
type Effect ¶
type Effect int32
Effect define the effect of the operation permission, include Allow or deny
func (Effect) EnumDescriptor ¶
type EventDeletePolicy ¶ added in v0.0.9
type EventDeletePolicy struct { // policy_id is an unique u256 sequence for each policy. It also be used as NFT tokenID PolicyId Uint `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3,customtype=Uint" json:"policy_id"` }
func (*EventDeletePolicy) Descriptor ¶ added in v0.0.9
func (*EventDeletePolicy) Descriptor() ([]byte, []int)
func (*EventDeletePolicy) Marshal ¶ added in v0.0.9
func (m *EventDeletePolicy) Marshal() (dAtA []byte, err error)
func (*EventDeletePolicy) MarshalTo ¶ added in v0.0.9
func (m *EventDeletePolicy) MarshalTo(dAtA []byte) (int, error)
func (*EventDeletePolicy) MarshalToSizedBuffer ¶ added in v0.0.9
func (m *EventDeletePolicy) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EventDeletePolicy) ProtoMessage ¶ added in v0.0.9
func (*EventDeletePolicy) ProtoMessage()
func (*EventDeletePolicy) Reset ¶ added in v0.0.9
func (m *EventDeletePolicy) Reset()
func (*EventDeletePolicy) Size ¶ added in v0.0.9
func (m *EventDeletePolicy) Size() (n int)
func (*EventDeletePolicy) String ¶ added in v0.0.9
func (m *EventDeletePolicy) String() string
func (*EventDeletePolicy) Unmarshal ¶ added in v0.0.9
func (m *EventDeletePolicy) Unmarshal(dAtA []byte) error
func (*EventDeletePolicy) XXX_DiscardUnknown ¶ added in v0.0.9
func (m *EventDeletePolicy) XXX_DiscardUnknown()
func (*EventDeletePolicy) XXX_Marshal ¶ added in v0.0.9
func (m *EventDeletePolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventDeletePolicy) XXX_Merge ¶ added in v0.0.9
func (m *EventDeletePolicy) XXX_Merge(src proto.Message)
func (*EventDeletePolicy) XXX_Size ¶ added in v0.0.9
func (m *EventDeletePolicy) XXX_Size() int
func (*EventDeletePolicy) XXX_Unmarshal ¶ added in v0.0.9
func (m *EventDeletePolicy) XXX_Unmarshal(b []byte) error
type EventPutPolicy ¶ added in v0.0.9
type EventPutPolicy struct { // policy_id is an unique u256 sequence for each policy. It also be used as NFT tokenID PolicyId Uint `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3,customtype=Uint" json:"policy_id"` // principal defines the accounts/group which the permission grants to Principal *Principal `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"` // resource_type defines the type of resource that grants permission for ResourceType resource.ResourceType `` /* 145-byte string literal not displayed */ // resource_id defines the bucket/object/group id of the resource that grants permission for ResourceId Uint `protobuf:"bytes,4,opt,name=resource_id,json=resourceId,proto3,customtype=Uint" json:"resource_id"` // statements defines the details content of the permission, include effect/actions/sub-resources Statements []*Statement `protobuf:"bytes,5,rep,name=statements,proto3" json:"statements,omitempty"` }
func (*EventPutPolicy) Descriptor ¶ added in v0.0.9
func (*EventPutPolicy) Descriptor() ([]byte, []int)
func (*EventPutPolicy) GetPrincipal ¶ added in v0.0.9
func (m *EventPutPolicy) GetPrincipal() *Principal
func (*EventPutPolicy) GetResourceType ¶ added in v0.0.9
func (m *EventPutPolicy) GetResourceType() resource.ResourceType
func (*EventPutPolicy) GetStatements ¶ added in v0.0.9
func (m *EventPutPolicy) GetStatements() []*Statement
func (*EventPutPolicy) Marshal ¶ added in v0.0.9
func (m *EventPutPolicy) Marshal() (dAtA []byte, err error)
func (*EventPutPolicy) MarshalTo ¶ added in v0.0.9
func (m *EventPutPolicy) MarshalTo(dAtA []byte) (int, error)
func (*EventPutPolicy) MarshalToSizedBuffer ¶ added in v0.0.9
func (m *EventPutPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EventPutPolicy) ProtoMessage ¶ added in v0.0.9
func (*EventPutPolicy) ProtoMessage()
func (*EventPutPolicy) Reset ¶ added in v0.0.9
func (m *EventPutPolicy) Reset()
func (*EventPutPolicy) Size ¶ added in v0.0.9
func (m *EventPutPolicy) Size() (n int)
func (*EventPutPolicy) String ¶ added in v0.0.9
func (m *EventPutPolicy) String() string
func (*EventPutPolicy) Unmarshal ¶ added in v0.0.9
func (m *EventPutPolicy) Unmarshal(dAtA []byte) error
func (*EventPutPolicy) XXX_DiscardUnknown ¶ added in v0.0.9
func (m *EventPutPolicy) XXX_DiscardUnknown()
func (*EventPutPolicy) XXX_Marshal ¶ added in v0.0.9
func (m *EventPutPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventPutPolicy) XXX_Merge ¶ added in v0.0.9
func (m *EventPutPolicy) XXX_Merge(src proto.Message)
func (*EventPutPolicy) XXX_Size ¶ added in v0.0.9
func (m *EventPutPolicy) XXX_Size() int
func (*EventPutPolicy) XXX_Unmarshal ¶ added in v0.0.9
func (m *EventPutPolicy) XXX_Unmarshal(b []byte) error
type GenesisState ¶
type GenesisState struct {
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}
GenesisState defines the permission module's genesis state.
func DefaultGenesis ¶
func DefaultGenesis() *GenesisState
DefaultGenesis returns the default genesis state
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetParams ¶
func (m *GenesisState) GetParams() Params
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err error)
func (*GenesisState) MarshalToSizedBuffer ¶
func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*GenesisState) ProtoMessage ¶
func (*GenesisState) ProtoMessage()
func (*GenesisState) Reset ¶
func (m *GenesisState) Reset()
func (*GenesisState) Size ¶
func (m *GenesisState) Size() (n int)
func (*GenesisState) String ¶
func (m *GenesisState) String() string
func (*GenesisState) Unmarshal ¶
func (m *GenesisState) Unmarshal(dAtA []byte) error
func (GenesisState) Validate ¶
func (gs GenesisState) Validate() error
Validate performs basic genesis state validation returning an error upon any failure.
func (*GenesisState) XXX_DiscardUnknown ¶
func (m *GenesisState) XXX_DiscardUnknown()
func (*GenesisState) XXX_Marshal ¶
func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GenesisState) XXX_Merge ¶
func (m *GenesisState) XXX_Merge(src proto.Message)
func (*GenesisState) XXX_Size ¶
func (m *GenesisState) XXX_Size() int
func (*GenesisState) XXX_Unmarshal ¶
func (m *GenesisState) XXX_Unmarshal(b []byte) error
type MsgClient ¶
type MsgClient interface { }
MsgClient is the client API for Msg service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewMsgClient ¶
func NewMsgClient(cc grpc1.ClientConn) MsgClient
type Params ¶
type Params struct { MaximumStatementsNum uint64 `protobuf:"varint,1,opt,name=maximum_statements_num,json=maximumStatementsNum,proto3" json:"maximum_statements_num,omitempty"` MaximumGroupNum uint64 `protobuf:"varint,2,opt,name=maximum_group_num,json=maximumGroupNum,proto3" json:"maximum_group_num,omitempty"` }
Params defines the parameters for the module.
func (*Params) Descriptor ¶
func (*Params) GetMaximumGroupNum ¶
func (*Params) GetMaximumStatementsNum ¶
func (*Params) MarshalToSizedBuffer ¶
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs
ParamSetPairs get the params.ParamSet
func (*Params) ProtoMessage ¶
func (*Params) ProtoMessage()
func (*Params) XXX_DiscardUnknown ¶
func (m *Params) XXX_DiscardUnknown()
func (*Params) XXX_Marshal ¶
func (*Params) XXX_Unmarshal ¶
type Policy ¶
type Policy struct { Id Uint `protobuf:"bytes,1,opt,name=id,proto3,customtype=Uint" json:"id"` Principal *Principal `protobuf:"bytes,2,opt,name=principal,proto3" json:"principal,omitempty"` ResourceType resource.ResourceType `` /* 145-byte string literal not displayed */ ResourceId Uint `protobuf:"bytes,4,opt,name=resource_id,json=resourceId,proto3,customtype=Uint" json:"resource_id"` Statements []*Statement `protobuf:"bytes,5,rep,name=statements,proto3" json:"statements,omitempty"` MemberStatement *Statement `protobuf:"bytes,6,opt,name=member_statement,json=memberStatement,proto3" json:"member_statement,omitempty"` }
func NewDefaultPolicyForGroupMember ¶
func NewDefaultPolicyForGroupMember(groupID math.Uint, member sdk.AccAddress) *Policy
func (*Policy) Descriptor ¶
func (*Policy) GetGroupMemberStatement ¶
func (*Policy) GetMemberStatement ¶
func (*Policy) GetPrincipal ¶
func (*Policy) GetResourceType ¶
func (m *Policy) GetResourceType() resource.ResourceType
func (*Policy) GetStatements ¶
func (*Policy) MarshalToSizedBuffer ¶
func (*Policy) ProtoMessage ¶
func (*Policy) ProtoMessage()
func (*Policy) XXX_DiscardUnknown ¶
func (m *Policy) XXX_DiscardUnknown()
func (*Policy) XXX_Marshal ¶
func (*Policy) XXX_Unmarshal ¶
type PolicyGroup ¶
type PolicyGroup struct {
Items []*PolicyGroup_Item `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"`
}
func (*PolicyGroup) Descriptor ¶
func (*PolicyGroup) Descriptor() ([]byte, []int)
func (*PolicyGroup) GetItems ¶
func (m *PolicyGroup) GetItems() []*PolicyGroup_Item
func (*PolicyGroup) Marshal ¶
func (m *PolicyGroup) Marshal() (dAtA []byte, err error)
func (*PolicyGroup) MarshalToSizedBuffer ¶
func (m *PolicyGroup) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PolicyGroup) ProtoMessage ¶
func (*PolicyGroup) ProtoMessage()
func (*PolicyGroup) Reset ¶
func (m *PolicyGroup) Reset()
func (*PolicyGroup) Size ¶
func (m *PolicyGroup) Size() (n int)
func (*PolicyGroup) String ¶
func (m *PolicyGroup) String() string
func (*PolicyGroup) Unmarshal ¶
func (m *PolicyGroup) Unmarshal(dAtA []byte) error
func (*PolicyGroup) XXX_DiscardUnknown ¶
func (m *PolicyGroup) XXX_DiscardUnknown()
func (*PolicyGroup) XXX_Marshal ¶
func (m *PolicyGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PolicyGroup) XXX_Merge ¶
func (m *PolicyGroup) XXX_Merge(src proto.Message)
func (*PolicyGroup) XXX_Size ¶
func (m *PolicyGroup) XXX_Size() int
func (*PolicyGroup) XXX_Unmarshal ¶
func (m *PolicyGroup) XXX_Unmarshal(b []byte) error
type PolicyGroup_Item ¶
type PolicyGroup_Item struct { PolicyId Uint `protobuf:"bytes,1,opt,name=policy_id,json=policyId,proto3,customtype=Uint" json:"policy_id"` GroupId Uint `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3,customtype=Uint" json:"group_id"` }
func (*PolicyGroup_Item) Descriptor ¶
func (*PolicyGroup_Item) Descriptor() ([]byte, []int)
func (*PolicyGroup_Item) Marshal ¶
func (m *PolicyGroup_Item) Marshal() (dAtA []byte, err error)
func (*PolicyGroup_Item) MarshalToSizedBuffer ¶
func (m *PolicyGroup_Item) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PolicyGroup_Item) ProtoMessage ¶
func (*PolicyGroup_Item) ProtoMessage()
func (*PolicyGroup_Item) Reset ¶
func (m *PolicyGroup_Item) Reset()
func (*PolicyGroup_Item) Size ¶
func (m *PolicyGroup_Item) Size() (n int)
func (*PolicyGroup_Item) String ¶
func (m *PolicyGroup_Item) String() string
func (*PolicyGroup_Item) Unmarshal ¶
func (m *PolicyGroup_Item) Unmarshal(dAtA []byte) error
func (*PolicyGroup_Item) XXX_DiscardUnknown ¶
func (m *PolicyGroup_Item) XXX_DiscardUnknown()
func (*PolicyGroup_Item) XXX_Marshal ¶
func (m *PolicyGroup_Item) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PolicyGroup_Item) XXX_Merge ¶
func (m *PolicyGroup_Item) XXX_Merge(src proto.Message)
func (*PolicyGroup_Item) XXX_Size ¶
func (m *PolicyGroup_Item) XXX_Size() int
func (*PolicyGroup_Item) XXX_Unmarshal ¶
func (m *PolicyGroup_Item) XXX_Unmarshal(b []byte) error
type Principal ¶
type Principal struct { Type PrincipalType `protobuf:"varint,1,opt,name=type,proto3,enum=bnbchain.greenfield.permission.PrincipalType" json:"type,omitempty"` Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` }
Principal define the roles that can grant permissions. Currently, it can be account or group.
func NewPrincipalWithAccount ¶
func NewPrincipalWithAccount(addr sdk.AccAddress) *Principal
func NewPrincipalWithGroup ¶ added in v0.0.8
func (*Principal) Descriptor ¶
func (*Principal) GetAccountAddress ¶
func (p *Principal) GetAccountAddress() (sdk.AccAddress, error)
func (*Principal) GetType ¶
func (m *Principal) GetType() PrincipalType
func (*Principal) MarshalToSizedBuffer ¶
func (*Principal) MustGetAccountAddress ¶
func (p *Principal) MustGetAccountAddress() sdk.AccAddress
func (*Principal) MustGetGroupID ¶
func (*Principal) ProtoMessage ¶
func (*Principal) ProtoMessage()
func (*Principal) ValidateBasic ¶
func (*Principal) XXX_DiscardUnknown ¶
func (m *Principal) XXX_DiscardUnknown()
func (*Principal) XXX_Marshal ¶
func (*Principal) XXX_Unmarshal ¶
type PrincipalType ¶
type PrincipalType int32
const ( // Reserved for extended use TYPE_GNFD_ACCOUNT PrincipalType = 0 TYPE_GNFD_GROUP PrincipalType = 1 )
func (PrincipalType) EnumDescriptor ¶
func (PrincipalType) EnumDescriptor() ([]byte, []int)
func (PrincipalType) String ¶
func (x PrincipalType) String() string
type QueryClient ¶
type QueryClient interface { // Parameters queries the parameters of the module. Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) }
QueryClient is the client API for Query service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewQueryClient ¶
func NewQueryClient(cc grpc1.ClientConn) QueryClient
type QueryParamsRequest ¶
type QueryParamsRequest struct { }
QueryParamsRequest is request type for the Query/Params RPC method.
func (*QueryParamsRequest) Descriptor ¶
func (*QueryParamsRequest) Descriptor() ([]byte, []int)
func (*QueryParamsRequest) Marshal ¶
func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)
func (*QueryParamsRequest) MarshalTo ¶
func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryParamsRequest) MarshalToSizedBuffer ¶
func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryParamsRequest) ProtoMessage ¶
func (*QueryParamsRequest) ProtoMessage()
func (*QueryParamsRequest) Reset ¶
func (m *QueryParamsRequest) Reset()
func (*QueryParamsRequest) Size ¶
func (m *QueryParamsRequest) Size() (n int)
func (*QueryParamsRequest) String ¶
func (m *QueryParamsRequest) String() string
func (*QueryParamsRequest) Unmarshal ¶
func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error
func (*QueryParamsRequest) XXX_DiscardUnknown ¶
func (m *QueryParamsRequest) XXX_DiscardUnknown()
func (*QueryParamsRequest) XXX_Marshal ¶
func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryParamsRequest) XXX_Merge ¶
func (m *QueryParamsRequest) XXX_Merge(src proto.Message)
func (*QueryParamsRequest) XXX_Size ¶
func (m *QueryParamsRequest) XXX_Size() int
func (*QueryParamsRequest) XXX_Unmarshal ¶
func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error
type QueryParamsResponse ¶
type QueryParamsResponse struct { // params holds all the parameters of this module. Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` }
QueryParamsResponse is response type for the Query/Params RPC method.
func (*QueryParamsResponse) Descriptor ¶
func (*QueryParamsResponse) Descriptor() ([]byte, []int)
func (*QueryParamsResponse) GetParams ¶
func (m *QueryParamsResponse) GetParams() Params
func (*QueryParamsResponse) Marshal ¶
func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)
func (*QueryParamsResponse) MarshalTo ¶
func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryParamsResponse) MarshalToSizedBuffer ¶
func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryParamsResponse) ProtoMessage ¶
func (*QueryParamsResponse) ProtoMessage()
func (*QueryParamsResponse) Reset ¶
func (m *QueryParamsResponse) Reset()
func (*QueryParamsResponse) Size ¶
func (m *QueryParamsResponse) Size() (n int)
func (*QueryParamsResponse) String ¶
func (m *QueryParamsResponse) String() string
func (*QueryParamsResponse) Unmarshal ¶
func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error
func (*QueryParamsResponse) XXX_DiscardUnknown ¶
func (m *QueryParamsResponse) XXX_DiscardUnknown()
func (*QueryParamsResponse) XXX_Marshal ¶
func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryParamsResponse) XXX_Merge ¶
func (m *QueryParamsResponse) XXX_Merge(src proto.Message)
func (*QueryParamsResponse) XXX_Size ¶
func (m *QueryParamsResponse) XXX_Size() int
func (*QueryParamsResponse) XXX_Unmarshal ¶
func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error
type QueryServer ¶
type QueryServer interface { // Parameters queries the parameters of the module. Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) }
QueryServer is the server API for Query service.
type Statement ¶
type Statement struct { // effect define the impact of permissions, which can be Allow/Deny Effect Effect `protobuf:"varint,1,opt,name=effect,proto3,enum=bnbchain.greenfield.permission.Effect" json:"effect,omitempty"` // action_type define the operation type you can act. greenfield defines a set of permission // that you can specify in a permissionInfo. see ActionType enum for detail. Actions []ActionType `protobuf:"varint,2,rep,packed,name=actions,proto3,enum=bnbchain.greenfield.permission.ActionType" json:"actions,omitempty"` // resources define the resource list you can operate. // CAN ONLY USED IN bucket level. Support fuzzy match and limit to 5 Resources []string `protobuf:"bytes,3,rep,name=resources,proto3" json:"resources,omitempty"` }
TODO: add expiration time.
func NewMemberStatement ¶
func NewMemberStatement() *Statement
func (*Statement) Descriptor ¶
func (*Statement) GetActions ¶
func (m *Statement) GetActions() []ActionType
func (*Statement) GetResources ¶
func (*Statement) MarshalToSizedBuffer ¶
func (*Statement) ProtoMessage ¶
func (*Statement) ProtoMessage()
func (*Statement) ValidateBasic ¶
func (*Statement) XXX_DiscardUnknown ¶
func (m *Statement) XXX_DiscardUnknown()
func (*Statement) XXX_Marshal ¶
func (*Statement) XXX_Unmarshal ¶
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) Params ¶
func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error)