mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
refactor: remove unused code related to whitelisted assets
This commit is contained in:
@@ -27,17 +27,6 @@ func (ms msgServer) RegisterController(goCtx context.Context, msg *types.MsgRegi
|
||||
return &types.MsgRegisterControllerResponse{}, nil
|
||||
}
|
||||
|
||||
// RegisterService implements types.MsgServer.
|
||||
func (ms msgServer) RegisterService(goCtx context.Context, msg *types.MsgRegisterService) (*types.MsgRegisterServiceResponse, error) {
|
||||
// ctx := sdk.UnwrapSDKContext(goCtx)
|
||||
|
||||
// 1.Check if the service origin is valid
|
||||
// if !ms.k.IsValidServiceOrigin(ctx, msg.Service.Origin) {
|
||||
// return nil, types.ErrInvalidServiceOrigin
|
||||
// }
|
||||
return nil, errors.Wrapf(types.ErrInvalidServiceOrigin, "invalid service origin")
|
||||
}
|
||||
|
||||
// AuthorizeService implements types.MsgServer.
|
||||
func (ms msgServer) AuthorizeService(goCtx context.Context, msg *types.MsgAuthorizeService) (*types.MsgAuthorizeServiceResponse, error) {
|
||||
if ms.k.authority != msg.Controller {
|
||||
|
||||
@@ -25,7 +25,6 @@ func init() {
|
||||
func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
|
||||
cdc.RegisterConcrete(&MsgUpdateParams{}, ModuleName+"/MsgUpdateParams", nil)
|
||||
cdc.RegisterConcrete(&MsgRegisterController{}, ModuleName+"/MsgRegisterController", nil)
|
||||
cdc.RegisterConcrete(&MsgRegisterService{}, ModuleName+"/MsgRegisterService", nil)
|
||||
}
|
||||
|
||||
func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
@@ -38,7 +37,6 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
|
||||
(*sdk.Msg)(nil),
|
||||
&MsgUpdateParams{},
|
||||
&MsgRegisterController{},
|
||||
&MsgRegisterService{},
|
||||
)
|
||||
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
|
||||
type ControllerI interface {
|
||||
ChainID() string
|
||||
GetPubKey() *didv1.PubKey
|
||||
SonrAddress() string
|
||||
EthAddress() string
|
||||
BtcAddress() string
|
||||
@@ -77,6 +78,17 @@ func (c *controller) ExportUserKs() (string, error) {
|
||||
return c.userKs.Marshal()
|
||||
}
|
||||
|
||||
func (c *controller) GetPubKey() *didv1.PubKey {
|
||||
return &didv1.PubKey{
|
||||
KeyType: "ecdsa",
|
||||
RawKey: &didv1.RawKey{
|
||||
Algorithm: "secp256k1",
|
||||
Key: c.publicKey,
|
||||
},
|
||||
Role: "authentication",
|
||||
}
|
||||
}
|
||||
|
||||
func (c *controller) GetTableEntry() (*didv1.Controller, error) {
|
||||
valKs, err := c.valKs.Marshal()
|
||||
if err != nil {
|
||||
@@ -88,7 +100,7 @@ func (c *controller) GetTableEntry() (*didv1.Controller, error) {
|
||||
SonrAddress: c.address,
|
||||
EthAddress: c.ethAddr,
|
||||
BtcAddress: c.btcAddr,
|
||||
PublicKey: c.publicKey,
|
||||
PublicKey: c.GetPubKey(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
+30
-2712
File diff suppressed because it is too large
Load Diff
@@ -48,41 +48,6 @@ func (msg *MsgUpdateParams) Validate() error {
|
||||
return msg.Params.Validate()
|
||||
}
|
||||
|
||||
//
|
||||
// [RegisterService]
|
||||
//
|
||||
|
||||
// NewMsgRegisterController creates a new instance of MsgRegisterController
|
||||
func NewMsgRegisterService(
|
||||
sender sdk.Address,
|
||||
) (*MsgRegisterService, error) {
|
||||
return &MsgRegisterService{
|
||||
Controller: sender.String(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// Route returns the name of the module
|
||||
func (msg MsgRegisterService) Route() string { return ModuleName }
|
||||
|
||||
// Type returns the the action
|
||||
func (msg MsgRegisterService) Type() string { return "register_service" }
|
||||
|
||||
// GetSignBytes implements the LegacyMsg interface.
|
||||
func (msg MsgRegisterService) GetSignBytes() []byte {
|
||||
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg))
|
||||
}
|
||||
|
||||
// GetSigners returns the expected signers for a MsgUpdateParams message.
|
||||
func (msg *MsgRegisterService) GetSigners() []sdk.AccAddress {
|
||||
addr, _ := sdk.AccAddressFromBech32(msg.Controller)
|
||||
return []sdk.AccAddress{addr}
|
||||
}
|
||||
|
||||
// ValidateBasic does a sanity check on the provided data.
|
||||
func (msg *MsgRegisterService) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
//
|
||||
// [RegisterController]
|
||||
//
|
||||
|
||||
@@ -1 +1,12 @@
|
||||
package types
|
||||
|
||||
import (
|
||||
didv1 "github.com/onsonr/sonr/api/did/v1"
|
||||
)
|
||||
|
||||
type PubKeyI interface {
|
||||
GetRole() string
|
||||
GetKeyType() string
|
||||
GetRawKey() *didv1.RawKey
|
||||
GetJwk() *didv1.JSONWebKey
|
||||
}
|
||||
|
||||
+529
-24
@@ -189,39 +189,141 @@ func (m *QueryResolveResponse) GetDocument() *Document {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Document defines a DID document
|
||||
type Document struct {
|
||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||
Controller string `protobuf:"bytes,2,opt,name=controller,proto3" json:"controller,omitempty"`
|
||||
Authentication []string `protobuf:"bytes,3,rep,name=authentication,proto3" json:"authentication,omitempty"`
|
||||
AssertionMethod []string `protobuf:"bytes,4,rep,name=assertion_method,json=assertionMethod,proto3" json:"assertion_method,omitempty"`
|
||||
CapabilityDelegation []string `protobuf:"bytes,5,rep,name=capability_delegation,json=capabilityDelegation,proto3" json:"capability_delegation,omitempty"`
|
||||
CapabilityInvocation []string `protobuf:"bytes,6,rep,name=capability_invocation,json=capabilityInvocation,proto3" json:"capability_invocation,omitempty"`
|
||||
Service []string `protobuf:"bytes,7,rep,name=service,proto3" json:"service,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Document) Reset() { *m = Document{} }
|
||||
func (m *Document) String() string { return proto.CompactTextString(m) }
|
||||
func (*Document) ProtoMessage() {}
|
||||
func (*Document) Descriptor() ([]byte, []int) {
|
||||
return fileDescriptor_ae1fa9bb626e2869, []int{3}
|
||||
}
|
||||
func (m *Document) XXX_Unmarshal(b []byte) error {
|
||||
return m.Unmarshal(b)
|
||||
}
|
||||
func (m *Document) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||
if deterministic {
|
||||
return xxx_messageInfo_Document.Marshal(b, m, deterministic)
|
||||
} else {
|
||||
b = b[:cap(b)]
|
||||
n, err := m.MarshalToSizedBuffer(b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b[:n], nil
|
||||
}
|
||||
}
|
||||
func (m *Document) XXX_Merge(src proto.Message) {
|
||||
xxx_messageInfo_Document.Merge(m, src)
|
||||
}
|
||||
func (m *Document) XXX_Size() int {
|
||||
return m.Size()
|
||||
}
|
||||
func (m *Document) XXX_DiscardUnknown() {
|
||||
xxx_messageInfo_Document.DiscardUnknown(m)
|
||||
}
|
||||
|
||||
var xxx_messageInfo_Document proto.InternalMessageInfo
|
||||
|
||||
func (m *Document) GetId() string {
|
||||
if m != nil {
|
||||
return m.Id
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Document) GetController() string {
|
||||
if m != nil {
|
||||
return m.Controller
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (m *Document) GetAuthentication() []string {
|
||||
if m != nil {
|
||||
return m.Authentication
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Document) GetAssertionMethod() []string {
|
||||
if m != nil {
|
||||
return m.AssertionMethod
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Document) GetCapabilityDelegation() []string {
|
||||
if m != nil {
|
||||
return m.CapabilityDelegation
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Document) GetCapabilityInvocation() []string {
|
||||
if m != nil {
|
||||
return m.CapabilityInvocation
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Document) GetService() []string {
|
||||
if m != nil {
|
||||
return m.Service
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterType((*QueryRequest)(nil), "did.v1.QueryRequest")
|
||||
proto.RegisterType((*QueryParamsResponse)(nil), "did.v1.QueryParamsResponse")
|
||||
proto.RegisterType((*QueryResolveResponse)(nil), "did.v1.QueryResolveResponse")
|
||||
proto.RegisterType((*Document)(nil), "did.v1.Document")
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("did/v1/query.proto", fileDescriptor_ae1fa9bb626e2869) }
|
||||
|
||||
var fileDescriptor_ae1fa9bb626e2869 = []byte{
|
||||
// 362 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x51, 0xc1, 0x4e, 0xea, 0x40,
|
||||
0x14, 0xa5, 0xf0, 0x28, 0x8f, 0x79, 0xe4, 0x3d, 0x32, 0xaf, 0x31, 0x0d, 0x92, 0xc6, 0x74, 0x61,
|
||||
0x5c, 0x98, 0x4e, 0xc0, 0xad, 0x6e, 0x0c, 0x4b, 0x17, 0xd2, 0xa5, 0x2b, 0x0b, 0x73, 0x53, 0x27,
|
||||
0xc0, 0x4c, 0xe9, 0x4c, 0x89, 0x8d, 0x71, 0xe3, 0x17, 0x98, 0xf8, 0x13, 0x7e, 0x8a, 0x4b, 0x12,
|
||||
0x37, 0x2e, 0x0d, 0xf8, 0x21, 0xa6, 0xd3, 0x81, 0x88, 0x89, 0x9b, 0xa6, 0xf7, 0x9c, 0x73, 0xcf,
|
||||
0x3d, 0x77, 0x2e, 0xc2, 0x94, 0x51, 0xb2, 0xe8, 0x91, 0x79, 0x06, 0x69, 0x1e, 0x24, 0xa9, 0x50,
|
||||
0x02, 0xdb, 0x94, 0xd1, 0x60, 0xd1, 0xeb, 0x38, 0x86, 0x8b, 0x81, 0x83, 0x64, 0xb2, 0x64, 0x3b,
|
||||
0xdd, 0x58, 0x88, 0x78, 0x0a, 0x24, 0x4a, 0x18, 0x89, 0x38, 0x17, 0x2a, 0x52, 0x4c, 0x70, 0xc3,
|
||||
0xfa, 0xd7, 0xa8, 0x35, 0x2c, 0xac, 0x42, 0x98, 0x67, 0x20, 0x15, 0x6e, 0xa3, 0x1a, 0x65, 0xd4,
|
||||
0xb5, 0x0e, 0xac, 0xa3, 0x66, 0x58, 0xfc, 0xe2, 0x3d, 0x64, 0x8b, 0x94, 0xc5, 0x8c, 0xbb, 0x55,
|
||||
0x0d, 0x9a, 0xaa, 0x50, 0x4e, 0x20, 0x77, 0x6b, 0xa5, 0x72, 0x02, 0x39, 0x76, 0x50, 0x3d, 0x92,
|
||||
0x12, 0x94, 0xfb, 0x4b, 0x63, 0x65, 0xe1, 0x9f, 0xa1, 0xff, 0x7a, 0xc2, 0x65, 0x94, 0x46, 0x33,
|
||||
0x19, 0x82, 0x4c, 0x04, 0x97, 0x80, 0x0f, 0x91, 0x9d, 0x68, 0x44, 0xcf, 0xfa, 0xd3, 0xff, 0x1b,
|
||||
0x94, 0x5b, 0x04, 0x46, 0x67, 0x58, 0x7f, 0x80, 0x1c, 0x13, 0x50, 0x8a, 0xe9, 0x02, 0xb6, 0xfd,
|
||||
0xc7, 0xe8, 0x37, 0x15, 0xe3, 0x6c, 0x06, 0x5c, 0x19, 0x87, 0xf6, 0xc6, 0x61, 0x60, 0xf0, 0x70,
|
||||
0xab, 0xe8, 0x3f, 0x5b, 0xa8, 0xae, 0x6d, 0xf0, 0x05, 0xb2, 0xcb, 0x09, 0xd8, 0xd9, 0xe8, 0xbf,
|
||||
0x3e, 0x40, 0x67, 0x7f, 0x07, 0xdd, 0x0d, 0xed, 0xff, 0x7b, 0x78, 0xfd, 0x78, 0xaa, 0x36, 0x71,
|
||||
0x83, 0x94, 0xe9, 0xf0, 0x10, 0x35, 0x4c, 0xb0, 0x1f, 0xec, 0xba, 0xdf, 0xd0, 0x9d, 0x25, 0x7c,
|
||||
0xac, 0xfd, 0x5a, 0x18, 0x91, 0xe2, 0x74, 0x77, 0x94, 0xd1, 0xfb, 0xf3, 0xd3, 0x97, 0x95, 0x67,
|
||||
0x2d, 0x57, 0x9e, 0xf5, 0xbe, 0xf2, 0xac, 0xc7, 0xb5, 0x57, 0x59, 0xae, 0xbd, 0xca, 0xdb, 0xda,
|
||||
0xab, 0x5c, 0xf9, 0x31, 0x53, 0x37, 0xd9, 0x28, 0x18, 0x8b, 0x19, 0x11, 0x5c, 0x0a, 0x9e, 0x12,
|
||||
0xfd, 0xb9, 0xd5, 0xdd, 0x2a, 0x4f, 0x40, 0x8e, 0x6c, 0x7d, 0xd6, 0x93, 0xcf, 0x00, 0x00, 0x00,
|
||||
0xff, 0xff, 0x7d, 0xbe, 0x9f, 0x67, 0x28, 0x02, 0x00, 0x00,
|
||||
// 484 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xc1, 0x6e, 0xd3, 0x40,
|
||||
0x10, 0x86, 0xeb, 0xa4, 0x71, 0x9a, 0xa1, 0x4a, 0xa3, 0xc5, 0x20, 0x2b, 0x54, 0x56, 0xe5, 0x43,
|
||||
0x55, 0x24, 0x64, 0xab, 0xed, 0x15, 0x2e, 0x28, 0x17, 0x24, 0x90, 0xa8, 0x8f, 0x5c, 0x8a, 0xe3,
|
||||
0x1d, 0x39, 0xab, 0x3a, 0xbb, 0xae, 0x77, 0x6d, 0x61, 0x21, 0x2e, 0x3c, 0x01, 0x88, 0x97, 0xe0,
|
||||
0x51, 0x38, 0x56, 0xe2, 0xc2, 0x11, 0x25, 0x3c, 0x08, 0xf2, 0x7a, 0x63, 0x9a, 0x48, 0x5c, 0x2c,
|
||||
0xcf, 0xf7, 0xff, 0x33, 0xbb, 0x33, 0xb3, 0x40, 0x28, 0xa3, 0x61, 0x75, 0x1e, 0xde, 0x96, 0x58,
|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0xe7, 0xa7, 0x4c, 0x2d,
|
||||
0xca, 0x79, 0x90, 0x88, 0x65, 0x28, 0xb8, 0x14, 0xbc, 0x08, 0xf5, 0xe7, 0x83, 0xce, 0x56, 0x75,
|
||||
0x8e, 0x72, 0x6e, 0xeb, 0xa7, 0x7e, 0xf9, 0x37, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x85, 0xed, 0xe7,
|
||||
0x3c, 0x03, 0x00, 0x00,
|
||||
}
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
@@ -465,6 +567,88 @@ func (m *QueryResolveResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func (m *Document) Marshal() (dAtA []byte, err error) {
|
||||
size := m.Size()
|
||||
dAtA = make([]byte, size)
|
||||
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return dAtA[:n], nil
|
||||
}
|
||||
|
||||
func (m *Document) MarshalTo(dAtA []byte) (int, error) {
|
||||
size := m.Size()
|
||||
return m.MarshalToSizedBuffer(dAtA[:size])
|
||||
}
|
||||
|
||||
func (m *Document) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i := len(dAtA)
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Service) > 0 {
|
||||
for iNdEx := len(m.Service) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.Service[iNdEx])
|
||||
copy(dAtA[i:], m.Service[iNdEx])
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.Service[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x3a
|
||||
}
|
||||
}
|
||||
if len(m.CapabilityInvocation) > 0 {
|
||||
for iNdEx := len(m.CapabilityInvocation) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.CapabilityInvocation[iNdEx])
|
||||
copy(dAtA[i:], m.CapabilityInvocation[iNdEx])
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.CapabilityInvocation[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x32
|
||||
}
|
||||
}
|
||||
if len(m.CapabilityDelegation) > 0 {
|
||||
for iNdEx := len(m.CapabilityDelegation) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.CapabilityDelegation[iNdEx])
|
||||
copy(dAtA[i:], m.CapabilityDelegation[iNdEx])
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.CapabilityDelegation[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x2a
|
||||
}
|
||||
}
|
||||
if len(m.AssertionMethod) > 0 {
|
||||
for iNdEx := len(m.AssertionMethod) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.AssertionMethod[iNdEx])
|
||||
copy(dAtA[i:], m.AssertionMethod[iNdEx])
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.AssertionMethod[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x22
|
||||
}
|
||||
}
|
||||
if len(m.Authentication) > 0 {
|
||||
for iNdEx := len(m.Authentication) - 1; iNdEx >= 0; iNdEx-- {
|
||||
i -= len(m.Authentication[iNdEx])
|
||||
copy(dAtA[i:], m.Authentication[iNdEx])
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.Authentication[iNdEx])))
|
||||
i--
|
||||
dAtA[i] = 0x1a
|
||||
}
|
||||
}
|
||||
if len(m.Controller) > 0 {
|
||||
i -= len(m.Controller)
|
||||
copy(dAtA[i:], m.Controller)
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.Controller)))
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
if len(m.Id) > 0 {
|
||||
i -= len(m.Id)
|
||||
copy(dAtA[i:], m.Id)
|
||||
i = encodeVarintQuery(dAtA, i, uint64(len(m.Id)))
|
||||
i--
|
||||
dAtA[i] = 0xa
|
||||
}
|
||||
return len(dAtA) - i, nil
|
||||
}
|
||||
|
||||
func encodeVarintQuery(dAtA []byte, offset int, v uint64) int {
|
||||
offset -= sovQuery(v)
|
||||
base := offset
|
||||
@@ -527,6 +711,53 @@ func (m *QueryResolveResponse) Size() (n int) {
|
||||
return n
|
||||
}
|
||||
|
||||
func (m *Document) Size() (n int) {
|
||||
if m == nil {
|
||||
return 0
|
||||
}
|
||||
var l int
|
||||
_ = l
|
||||
l = len(m.Id)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
l = len(m.Controller)
|
||||
if l > 0 {
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
if len(m.Authentication) > 0 {
|
||||
for _, s := range m.Authentication {
|
||||
l = len(s)
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
}
|
||||
if len(m.AssertionMethod) > 0 {
|
||||
for _, s := range m.AssertionMethod {
|
||||
l = len(s)
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
}
|
||||
if len(m.CapabilityDelegation) > 0 {
|
||||
for _, s := range m.CapabilityDelegation {
|
||||
l = len(s)
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
}
|
||||
if len(m.CapabilityInvocation) > 0 {
|
||||
for _, s := range m.CapabilityInvocation {
|
||||
l = len(s)
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
}
|
||||
if len(m.Service) > 0 {
|
||||
for _, s := range m.Service {
|
||||
l = len(s)
|
||||
n += 1 + l + sovQuery(uint64(l))
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
func sovQuery(x uint64) (n int) {
|
||||
return (math_bits.Len64(x|1) + 6) / 7
|
||||
}
|
||||
@@ -883,6 +1114,280 @@ func (m *QueryResolveResponse) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (m *Document) Unmarshal(dAtA []byte) error {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
for iNdEx < l {
|
||||
preIndex := iNdEx
|
||||
var wire uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
wire |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
fieldNum := int32(wire >> 3)
|
||||
wireType := int(wire & 0x7)
|
||||
if wireType == 4 {
|
||||
return fmt.Errorf("proto: Document: wiretype end group for non-group")
|
||||
}
|
||||
if fieldNum <= 0 {
|
||||
return fmt.Errorf("proto: Document: illegal tag %d (wire type %d)", fieldNum, wire)
|
||||
}
|
||||
switch fieldNum {
|
||||
case 1:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Id = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 2:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Controller", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Controller = string(dAtA[iNdEx:postIndex])
|
||||
iNdEx = postIndex
|
||||
case 3:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Authentication", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Authentication = append(m.Authentication, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 4:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field AssertionMethod", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.AssertionMethod = append(m.AssertionMethod, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 5:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field CapabilityDelegation", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.CapabilityDelegation = append(m.CapabilityDelegation, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 6:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field CapabilityInvocation", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.CapabilityInvocation = append(m.CapabilityInvocation, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
case 7:
|
||||
if wireType != 2 {
|
||||
return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType)
|
||||
}
|
||||
var stringLen uint64
|
||||
for shift := uint(0); ; shift += 7 {
|
||||
if shift >= 64 {
|
||||
return ErrIntOverflowQuery
|
||||
}
|
||||
if iNdEx >= l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
stringLen |= uint64(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
}
|
||||
intStringLen := int(stringLen)
|
||||
if intStringLen < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
postIndex := iNdEx + intStringLen
|
||||
if postIndex < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Service = append(m.Service, string(dAtA[iNdEx:postIndex]))
|
||||
iNdEx = postIndex
|
||||
default:
|
||||
iNdEx = preIndex
|
||||
skippy, err := skipQuery(dAtA[iNdEx:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
||||
return ErrInvalidLengthQuery
|
||||
}
|
||||
if (iNdEx + skippy) > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
iNdEx += skippy
|
||||
}
|
||||
}
|
||||
|
||||
if iNdEx > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func skipQuery(dAtA []byte) (n int, err error) {
|
||||
l := len(dAtA)
|
||||
iNdEx := 0
|
||||
|
||||
+1276
-107
File diff suppressed because it is too large
Load Diff
+44
-1233
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user