feat: add enums.pulsar.go file for PermissionScope enum (#4)

* feat: add enums.pulsar.go file for PermissionScope enum

* refactor: remove PERMISSION_SCOPE_IDENTIFIERS_ENS enum value

* feat: Add MsgRegisterService to handle service registration

The commit message for these changes would be:

feat: Add MsgRegisterService to handle service registration

This commit adds a new message type `MsgRegisterService` to the DID module's transaction proto file. This message allows users to register a new service with a given permission scope and origin URI. The domain must have a valid TXT record containing the public key.

The changes include:

- Adding the `MsgRegisterService` message type with fields for authority, origin URI, and scopes
- Adding the `MsgRegisterServiceResponse` message type to handle the response
- Updating the Msg service to include a new `RegisterService` RPC method
- Implementing the `RegisterService` method in the keeper

This feature allows users to register new services on the DID chain, which is an important part of the overall DID functionality.

* (no commit message provided)

* fix: Add ProveWitness and SyncVault RPCs

The commit message should be:

feat: Add ProveWitness and SyncVault RPCs

This change adds two new RPCs to the DID module:

1. ProveWitness: An operation to prove the controller has a valid property using ZK Accumulators.
2. SyncVault: Synchronizes the controller with the Vault Motr DWN WASM Wallet.

These new RPCs allow for more advanced DID management functionality.

* fix: Remove unused `Meta` message from `genesis.proto`

* refactor: Simplify the types and properties to keep a consistent structure for the blockchain

* (no commit message provided)

* {}

* feat: add Equal methods for AssetInfo and ChainInfo types
This commit is contained in:
Prad Nukala 2024-08-10 18:27:11 -04:00 committed by GitHub
parent 5b1aeabc4e
commit 1810ee1c7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
38 changed files with 25776 additions and 10264 deletions

View File

@ -1,17 +0,0 @@
version: "3"
tasks:
dev:
cmd: air
install:
cmd: make install
testnet:
cmd: make sh-testnet
proto:
cmd: devbox -q run proto
build:sonrd:
cmd: go build -o ./bin/sonrd ./cmd/sonrd

View File

@ -0,0 +1,70 @@
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
package didv1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc (unknown)
// source: did/v1/accounts.proto
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
var File_did_v1_accounts_proto protoreflect.FileDescriptor
var file_did_v1_accounts_proto_rawDesc = []byte{
0x0a, 0x15, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42,
0x7d, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0d, 0x41,
0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e,
0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76,
0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06,
0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2,
0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var file_did_v1_accounts_proto_goTypes = []interface{}{}
var file_did_v1_accounts_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_did_v1_accounts_proto_init() }
func file_did_v1_accounts_proto_init() {
if File_did_v1_accounts_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_did_v1_accounts_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_did_v1_accounts_proto_goTypes,
DependencyIndexes: file_did_v1_accounts_proto_depIdxs,
}.Build()
File_did_v1_accounts_proto = out.File
file_did_v1_accounts_proto_rawDesc = nil
file_did_v1_accounts_proto_goTypes = nil
file_did_v1_accounts_proto_depIdxs = nil
}

209
api/did/v1/enums.pulsar.go Normal file
View File

@ -0,0 +1,209 @@
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
package didv1
import (
_ "cosmossdk.io/api/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc (unknown)
// source: did/v1/enums.proto
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// PermissionScope define the Capabilities Controllers can grant for Services
type PermissionScope int32
const (
PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0
PermissionScope_PERMISSION_SCOPE_PROFILE_NAME PermissionScope = 1
PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_EMAIL PermissionScope = 2
PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_PHONE PermissionScope = 3
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ PermissionScope = 4
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE PermissionScope = 5
PermissionScope_PERMISSION_SCOPE_WALLETS_READ PermissionScope = 6
PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE PermissionScope = 7
PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE PermissionScope = 8
PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE PermissionScope = 9
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY PermissionScope = 10
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST PermissionScope = 11
PermissionScope_PERMISSION_SCOPE_ADMIN_USER PermissionScope = 12
PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR PermissionScope = 13
)
// Enum value maps for PermissionScope.
var (
PermissionScope_name = map[int32]string{
0: "PERMISSION_SCOPE_UNSPECIFIED",
1: "PERMISSION_SCOPE_PROFILE_NAME",
2: "PERMISSION_SCOPE_IDENTIFIERS_EMAIL",
3: "PERMISSION_SCOPE_IDENTIFIERS_PHONE",
4: "PERMISSION_SCOPE_TRANSACTIONS_READ",
5: "PERMISSION_SCOPE_TRANSACTIONS_WRITE",
6: "PERMISSION_SCOPE_WALLETS_READ",
7: "PERMISSION_SCOPE_WALLETS_CREATE",
8: "PERMISSION_SCOPE_WALLETS_SUBSCRIBE",
9: "PERMISSION_SCOPE_WALLETS_UPDATE",
10: "PERMISSION_SCOPE_TRANSACTIONS_VERIFY",
11: "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST",
12: "PERMISSION_SCOPE_ADMIN_USER",
13: "PERMISSION_SCOPE_ADMIN_VALIDATOR",
}
PermissionScope_value = map[string]int32{
"PERMISSION_SCOPE_UNSPECIFIED": 0,
"PERMISSION_SCOPE_PROFILE_NAME": 1,
"PERMISSION_SCOPE_IDENTIFIERS_EMAIL": 2,
"PERMISSION_SCOPE_IDENTIFIERS_PHONE": 3,
"PERMISSION_SCOPE_TRANSACTIONS_READ": 4,
"PERMISSION_SCOPE_TRANSACTIONS_WRITE": 5,
"PERMISSION_SCOPE_WALLETS_READ": 6,
"PERMISSION_SCOPE_WALLETS_CREATE": 7,
"PERMISSION_SCOPE_WALLETS_SUBSCRIBE": 8,
"PERMISSION_SCOPE_WALLETS_UPDATE": 9,
"PERMISSION_SCOPE_TRANSACTIONS_VERIFY": 10,
"PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": 11,
"PERMISSION_SCOPE_ADMIN_USER": 12,
"PERMISSION_SCOPE_ADMIN_VALIDATOR": 13,
}
)
func (x PermissionScope) Enum() *PermissionScope {
p := new(PermissionScope)
*p = x
return p
}
func (x PermissionScope) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PermissionScope) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_enums_proto_enumTypes[0].Descriptor()
}
func (PermissionScope) Type() protoreflect.EnumType {
return &file_did_v1_enums_proto_enumTypes[0]
}
func (x PermissionScope) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PermissionScope.Descriptor instead.
func (PermissionScope) EnumDescriptor() ([]byte, []int) {
return file_did_v1_enums_proto_rawDescGZIP(), []int{0}
}
var File_did_v1_enums_proto protoreflect.FileDescriptor
var file_did_v1_enums_proto_rawDesc = []byte{
0x0a, 0x12, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x67, 0x6f,
0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0xaa, 0x04, 0x0a, 0x0f, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x53, 0x63, 0x6f, 0x70, 0x65, 0x12, 0x20, 0x0a, 0x1c, 0x50, 0x45, 0x52,
0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x55, 0x4e,
0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x21, 0x0a, 0x1d, 0x50,
0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f,
0x50, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x45, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x26,
0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f,
0x50, 0x45, 0x5f, 0x49, 0x44, 0x45, 0x4e, 0x54, 0x49, 0x46, 0x49, 0x45, 0x52, 0x53, 0x5f, 0x45,
0x4d, 0x41, 0x49, 0x4c, 0x10, 0x02, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53,
0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x49, 0x44, 0x45, 0x4e, 0x54,
0x49, 0x46, 0x49, 0x45, 0x52, 0x53, 0x5f, 0x50, 0x48, 0x4f, 0x4e, 0x45, 0x10, 0x03, 0x12, 0x26,
0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f,
0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f,
0x52, 0x45, 0x41, 0x44, 0x10, 0x04, 0x12, 0x27, 0x0a, 0x23, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53,
0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53,
0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x05, 0x12,
0x21, 0x0a, 0x1d, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43,
0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x52, 0x45, 0x41, 0x44,
0x10, 0x06, 0x12, 0x23, 0x0a, 0x1f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e,
0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x43,
0x52, 0x45, 0x41, 0x54, 0x45, 0x10, 0x07, 0x12, 0x26, 0x0a, 0x22, 0x50, 0x45, 0x52, 0x4d, 0x49,
0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c,
0x45, 0x54, 0x53, 0x5f, 0x53, 0x55, 0x42, 0x53, 0x43, 0x52, 0x49, 0x42, 0x45, 0x10, 0x08, 0x12,
0x23, 0x0a, 0x1f, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43,
0x4f, 0x50, 0x45, 0x5f, 0x57, 0x41, 0x4c, 0x4c, 0x45, 0x54, 0x53, 0x5f, 0x55, 0x50, 0x44, 0x41,
0x54, 0x45, 0x10, 0x09, 0x12, 0x28, 0x0a, 0x24, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49,
0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43,
0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x0a, 0x12, 0x2b,
0x0a, 0x27, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f,
0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x5f,
0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x10, 0x0b, 0x12, 0x1f, 0x0a, 0x1b, 0x50,
0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f,
0x41, 0x44, 0x4d, 0x49, 0x4e, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x10, 0x0c, 0x12, 0x24, 0x0a, 0x20,
0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45,
0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52,
0x10, 0x0d, 0x42, 0x7a, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31,
0x42, 0x0a, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e,
0x72, 0x2f, 0x68, 0x77, 0x61, 0x79, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76,
0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06,
0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2,
0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_did_v1_enums_proto_rawDescOnce sync.Once
file_did_v1_enums_proto_rawDescData = file_did_v1_enums_proto_rawDesc
)
func file_did_v1_enums_proto_rawDescGZIP() []byte {
file_did_v1_enums_proto_rawDescOnce.Do(func() {
file_did_v1_enums_proto_rawDescData = protoimpl.X.CompressGZIP(file_did_v1_enums_proto_rawDescData)
})
return file_did_v1_enums_proto_rawDescData
}
var file_did_v1_enums_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_did_v1_enums_proto_goTypes = []interface{}{
(PermissionScope)(0), // 0: did.v1.PermissionScope
}
var file_did_v1_enums_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_did_v1_enums_proto_init() }
func file_did_v1_enums_proto_init() {
if File_did_v1_enums_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_did_v1_enums_proto_rawDesc,
NumEnums: 1,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_did_v1_enums_proto_goTypes,
DependencyIndexes: file_did_v1_enums_proto_depIdxs,
EnumInfos: file_did_v1_enums_proto_enumTypes,
}.Build()
File_did_v1_enums_proto = out.File
file_did_v1_enums_proto_rawDesc = nil
file_did_v1_enums_proto_goTypes = nil
file_did_v1_enums_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,8 +20,11 @@ const _ = grpc.SupportPackageIsVersion7
const ( const (
Query_Params_FullMethodName = "/did.v1.Query/Params" Query_Params_FullMethodName = "/did.v1.Query/Params"
Query_ResolveIdentifier_FullMethodName = "/did.v1.Query/ResolveIdentifier" Query_Accounts_FullMethodName = "/did.v1.Query/Accounts"
Query_WitnessCredential_FullMethodName = "/did.v1.Query/WitnessCredential" Query_Credentials_FullMethodName = "/did.v1.Query/Credentials"
Query_Identities_FullMethodName = "/did.v1.Query/Identities"
Query_Resolve_FullMethodName = "/did.v1.Query/Resolve"
Query_Service_FullMethodName = "/did.v1.Query/Service"
) )
// QueryClient is the client API for Query service. // QueryClient is the client API for Query service.
@ -30,10 +33,16 @@ const (
type QueryClient interface { type QueryClient interface {
// Params queries all parameters of the module. // Params queries all parameters of the module.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// Accounts returns associated wallet accounts with the DID.
Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error)
// Credentials returns associated credentials with the DID and Service Origin.
Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error)
// Identities returns associated identity with the DID.
Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error)
// Resolve queries the DID document by its id. // Resolve queries the DID document by its id.
ResolveIdentifier(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error)
// LoginOptions queries the PublicKeyCredentialAttestationOptions for starting a login flow. // Service returns associated ServiceInfo for a given Origin
WitnessCredential(ctx context.Context, in *QueryWitnessCredentialRequest, opts ...grpc.CallOption) (*QueryWitnessCredentialResponse, error) Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error)
} }
type queryClient struct { type queryClient struct {
@ -53,18 +62,45 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
return out, nil return out, nil
} }
func (c *queryClient) ResolveIdentifier(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) { func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) {
out := new(QueryResolveResponse) out := new(QueryAccountsResponse)
err := c.cc.Invoke(ctx, Query_ResolveIdentifier_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *queryClient) WitnessCredential(ctx context.Context, in *QueryWitnessCredentialRequest, opts ...grpc.CallOption) (*QueryWitnessCredentialResponse, error) { func (c *queryClient) Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) {
out := new(QueryWitnessCredentialResponse) out := new(QueryCredentialsResponse)
err := c.cc.Invoke(ctx, Query_WitnessCredential_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Query_Credentials_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Identities(ctx context.Context, in *QueryIdentitiesRequest, opts ...grpc.CallOption) (*QueryIdentitiesResponse, error) {
out := new(QueryIdentitiesResponse)
err := c.cc.Invoke(ctx, Query_Identities_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) {
out := new(QueryResolveResponse)
err := c.cc.Invoke(ctx, Query_Resolve_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) {
out := new(QueryServiceResponse)
err := c.cc.Invoke(ctx, Query_Service_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -77,10 +113,16 @@ func (c *queryClient) WitnessCredential(ctx context.Context, in *QueryWitnessCre
type QueryServer interface { type QueryServer interface {
// Params queries all parameters of the module. // Params queries all parameters of the module.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
// Accounts returns associated wallet accounts with the DID.
Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error)
// Credentials returns associated credentials with the DID and Service Origin.
Credentials(context.Context, *QueryCredentialsRequest) (*QueryCredentialsResponse, error)
// Identities returns associated identity with the DID.
Identities(context.Context, *QueryIdentitiesRequest) (*QueryIdentitiesResponse, error)
// Resolve queries the DID document by its id. // Resolve queries the DID document by its id.
ResolveIdentifier(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) Resolve(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error)
// LoginOptions queries the PublicKeyCredentialAttestationOptions for starting a login flow. // Service returns associated ServiceInfo for a given Origin
WitnessCredential(context.Context, *QueryWitnessCredentialRequest) (*QueryWitnessCredentialResponse, error) Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error)
mustEmbedUnimplementedQueryServer() mustEmbedUnimplementedQueryServer()
} }
@ -91,11 +133,20 @@ type UnimplementedQueryServer struct {
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) { func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
} }
func (UnimplementedQueryServer) ResolveIdentifier(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) { func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ResolveIdentifier not implemented") return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented")
} }
func (UnimplementedQueryServer) WitnessCredential(context.Context, *QueryWitnessCredentialRequest) (*QueryWitnessCredentialResponse, error) { func (UnimplementedQueryServer) Credentials(context.Context, *QueryCredentialsRequest) (*QueryCredentialsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method WitnessCredential not implemented") return nil, status.Errorf(codes.Unimplemented, "method Credentials not implemented")
}
func (UnimplementedQueryServer) Identities(context.Context, *QueryIdentitiesRequest) (*QueryIdentitiesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Identities not implemented")
}
func (UnimplementedQueryServer) Resolve(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented")
}
func (UnimplementedQueryServer) Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Service not implemented")
} }
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
@ -128,38 +179,92 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_ResolveIdentifier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryAccountsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Accounts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Accounts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Accounts(ctx, req.(*QueryAccountsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Credentials_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryCredentialsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Credentials(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Credentials_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Credentials(ctx, req.(*QueryCredentialsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Identities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryIdentitiesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Identities(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Identities_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Identities(ctx, req.(*QueryIdentitiesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryResolveRequest) in := new(QueryResolveRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(QueryServer).ResolveIdentifier(ctx, in) return srv.(QueryServer).Resolve(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Query_ResolveIdentifier_FullMethodName, FullMethod: Query_Resolve_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).ResolveIdentifier(ctx, req.(*QueryResolveRequest)) return srv.(QueryServer).Resolve(ctx, req.(*QueryResolveRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_WitnessCredential_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryWitnessCredentialRequest) in := new(QueryServiceRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(QueryServer).WitnessCredential(ctx, in) return srv.(QueryServer).Service(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Query_WitnessCredential_FullMethodName, FullMethod: Query_Service_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).WitnessCredential(ctx, req.(*QueryWitnessCredentialRequest)) return srv.(QueryServer).Service(ctx, req.(*QueryServiceRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -176,12 +281,24 @@ var Query_ServiceDesc = grpc.ServiceDesc{
Handler: _Query_Params_Handler, Handler: _Query_Params_Handler,
}, },
{ {
MethodName: "ResolveIdentifier", MethodName: "Accounts",
Handler: _Query_ResolveIdentifier_Handler, Handler: _Query_Accounts_Handler,
}, },
{ {
MethodName: "WitnessCredential", MethodName: "Credentials",
Handler: _Query_WitnessCredential_Handler, Handler: _Query_Credentials_Handler,
},
{
MethodName: "Identities",
Handler: _Query_Identities_Handler,
},
{
MethodName: "Resolve",
Handler: _Query_Resolve_Handler,
},
{
MethodName: "Service",
Handler: _Query_Service_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},

View File

@ -17,9 +17,9 @@ type AliasesTable interface {
Has(ctx context.Context, id string) (found bool, err error) Has(ctx context.Context, id string) (found bool, err error)
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
Get(ctx context.Context, id string) (*Aliases, error) Get(ctx context.Context, id string) (*Aliases, error)
HasByHandle(ctx context.Context, handle string) (found bool, err error) HasBySubject(ctx context.Context, subject string) (found bool, err error)
// GetByHandle returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // GetBySubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByHandle(ctx context.Context, handle string) (*Aliases, error) GetBySubject(ctx context.Context, subject string) (*Aliases, error)
List(ctx context.Context, prefixKey AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) List(ctx context.Context, prefixKey AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error)
ListRange(ctx context.Context, from, to AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error) ListRange(ctx context.Context, from, to AliasesIndexKey, opts ...ormlist.Option) (AliasesIterator, error)
DeleteBy(ctx context.Context, prefixKey AliasesIndexKey) error DeleteBy(ctx context.Context, prefixKey AliasesIndexKey) error
@ -60,16 +60,16 @@ func (this AliasesIdIndexKey) WithId(id string) AliasesIdIndexKey {
return this return this
} }
type AliasesHandleIndexKey struct { type AliasesSubjectIndexKey struct {
vs []interface{} vs []interface{}
} }
func (x AliasesHandleIndexKey) id() uint32 { return 1 } func (x AliasesSubjectIndexKey) id() uint32 { return 1 }
func (x AliasesHandleIndexKey) values() []interface{} { return x.vs } func (x AliasesSubjectIndexKey) values() []interface{} { return x.vs }
func (x AliasesHandleIndexKey) aliasesIndexKey() {} func (x AliasesSubjectIndexKey) aliasesIndexKey() {}
func (this AliasesHandleIndexKey) WithHandle(handle string) AliasesHandleIndexKey { func (this AliasesSubjectIndexKey) WithSubject(subject string) AliasesSubjectIndexKey {
this.vs = []interface{}{handle} this.vs = []interface{}{subject}
return this return this
} }
@ -109,16 +109,16 @@ func (this aliasesTable) Get(ctx context.Context, id string) (*Aliases, error) {
return &aliases, nil return &aliases, nil
} }
func (this aliasesTable) HasByHandle(ctx context.Context, handle string) (found bool, err error) { func (this aliasesTable) HasBySubject(ctx context.Context, subject string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx, return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
handle, subject,
) )
} }
func (this aliasesTable) GetByHandle(ctx context.Context, handle string) (*Aliases, error) { func (this aliasesTable) GetBySubject(ctx context.Context, subject string) (*Aliases, error) {
var aliases Aliases var aliases Aliases
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &aliases, found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &aliases,
handle, subject,
) )
if err != nil { if err != nil {
return nil, err return nil, err

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -20,8 +20,11 @@ const _ = grpc.SupportPackageIsVersion7
const ( const (
Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams" Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams"
Msg_Authenticate_FullMethodName = "/did.v1.Msg/Authenticate"
Msg_ProveWitness_FullMethodName = "/did.v1.Msg/ProveWitness"
Msg_SyncVault_FullMethodName = "/did.v1.Msg/SyncVault"
Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController" Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController"
Msg_AuthenticateController_FullMethodName = "/did.v1.Msg/AuthenticateController" Msg_RegisterService_FullMethodName = "/did.v1.Msg/RegisterService"
) )
// MsgClient is the client API for Msg service. // MsgClient is the client API for Msg service.
@ -32,10 +35,16 @@ type MsgClient interface {
// //
// Since: cosmos-sdk 0.47 // Since: cosmos-sdk 0.47
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
// Authenticate asserts the given controller is the owner of the given address.
Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error)
// ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators.
ProveWitness(ctx context.Context, in *MsgProveWitness, opts ...grpc.CallOption) (*MsgProveWitnessResponse, error)
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
SyncVault(ctx context.Context, in *MsgSyncVault, opts ...grpc.CallOption) (*MsgSyncVaultResponse, error)
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. // RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
RegisterController(ctx context.Context, in *MsgInitializeController, opts ...grpc.CallOption) (*MsgInitializeControllerResponse, error) RegisterController(ctx context.Context, in *MsgRegisterController, opts ...grpc.CallOption) (*MsgRegisterControllerResponse, error)
// AuthenticateController asserts the given controller is the owner of the given address. // RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
AuthenticateController(ctx context.Context, in *MsgAuthenticateController, opts ...grpc.CallOption) (*MsgAuthenticateControllerResponse, error) RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error)
} }
type msgClient struct { type msgClient struct {
@ -55,8 +64,35 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
return out, nil return out, nil
} }
func (c *msgClient) RegisterController(ctx context.Context, in *MsgInitializeController, opts ...grpc.CallOption) (*MsgInitializeControllerResponse, error) { func (c *msgClient) Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error) {
out := new(MsgInitializeControllerResponse) out := new(MsgAuthenticateResponse)
err := c.cc.Invoke(ctx, Msg_Authenticate_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) ProveWitness(ctx context.Context, in *MsgProveWitness, opts ...grpc.CallOption) (*MsgProveWitnessResponse, error) {
out := new(MsgProveWitnessResponse)
err := c.cc.Invoke(ctx, Msg_ProveWitness_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) SyncVault(ctx context.Context, in *MsgSyncVault, opts ...grpc.CallOption) (*MsgSyncVaultResponse, error) {
out := new(MsgSyncVaultResponse)
err := c.cc.Invoke(ctx, Msg_SyncVault_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) RegisterController(ctx context.Context, in *MsgRegisterController, opts ...grpc.CallOption) (*MsgRegisterControllerResponse, error) {
out := new(MsgRegisterControllerResponse)
err := c.cc.Invoke(ctx, Msg_RegisterController_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Msg_RegisterController_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
@ -64,9 +100,9 @@ func (c *msgClient) RegisterController(ctx context.Context, in *MsgInitializeCon
return out, nil return out, nil
} }
func (c *msgClient) AuthenticateController(ctx context.Context, in *MsgAuthenticateController, opts ...grpc.CallOption) (*MsgAuthenticateControllerResponse, error) { func (c *msgClient) RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error) {
out := new(MsgAuthenticateControllerResponse) out := new(MsgRegisterServiceResponse)
err := c.cc.Invoke(ctx, Msg_AuthenticateController_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Msg_RegisterService_FullMethodName, in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -81,10 +117,16 @@ type MsgServer interface {
// //
// Since: cosmos-sdk 0.47 // Since: cosmos-sdk 0.47
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
// Authenticate asserts the given controller is the owner of the given address.
Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error)
// ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators.
ProveWitness(context.Context, *MsgProveWitness) (*MsgProveWitnessResponse, error)
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
SyncVault(context.Context, *MsgSyncVault) (*MsgSyncVaultResponse, error)
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. // RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
RegisterController(context.Context, *MsgInitializeController) (*MsgInitializeControllerResponse, error) RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error)
// AuthenticateController asserts the given controller is the owner of the given address. // RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
AuthenticateController(context.Context, *MsgAuthenticateController) (*MsgAuthenticateControllerResponse, error) RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error)
mustEmbedUnimplementedMsgServer() mustEmbedUnimplementedMsgServer()
} }
@ -95,11 +137,20 @@ type UnimplementedMsgServer struct {
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
} }
func (UnimplementedMsgServer) RegisterController(context.Context, *MsgInitializeController) (*MsgInitializeControllerResponse, error) { func (UnimplementedMsgServer) Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented")
}
func (UnimplementedMsgServer) ProveWitness(context.Context, *MsgProveWitness) (*MsgProveWitnessResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProveWitness not implemented")
}
func (UnimplementedMsgServer) SyncVault(context.Context, *MsgSyncVault) (*MsgSyncVaultResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SyncVault not implemented")
}
func (UnimplementedMsgServer) RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterController not implemented") return nil, status.Errorf(codes.Unimplemented, "method RegisterController not implemented")
} }
func (UnimplementedMsgServer) AuthenticateController(context.Context, *MsgAuthenticateController) (*MsgAuthenticateControllerResponse, error) { func (UnimplementedMsgServer) RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AuthenticateController not implemented") return nil, status.Errorf(codes.Unimplemented, "method RegisterService not implemented")
} }
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
@ -132,8 +183,62 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Msg_Authenticate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAuthenticate)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).Authenticate(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_Authenticate_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).Authenticate(ctx, req.(*MsgAuthenticate))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_ProveWitness_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgProveWitness)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).ProveWitness(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_ProveWitness_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).ProveWitness(ctx, req.(*MsgProveWitness))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_SyncVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgSyncVault)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).SyncVault(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_SyncVault_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).SyncVault(ctx, req.(*MsgSyncVault))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_RegisterController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Msg_RegisterController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgInitializeController) in := new(MsgRegisterController)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
@ -145,25 +250,25 @@ func _Msg_RegisterController_Handler(srv interface{}, ctx context.Context, dec f
FullMethod: Msg_RegisterController_FullMethodName, FullMethod: Msg_RegisterController_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).RegisterController(ctx, req.(*MsgInitializeController)) return srv.(MsgServer).RegisterController(ctx, req.(*MsgRegisterController))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Msg_AuthenticateController_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Msg_RegisterService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAuthenticateController) in := new(MsgRegisterService)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(MsgServer).AuthenticateController(ctx, in) return srv.(MsgServer).RegisterService(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Msg_AuthenticateController_FullMethodName, FullMethod: Msg_RegisterService_FullMethodName,
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).AuthenticateController(ctx, req.(*MsgAuthenticateController)) return srv.(MsgServer).RegisterService(ctx, req.(*MsgRegisterService))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -179,13 +284,25 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
MethodName: "UpdateParams", MethodName: "UpdateParams",
Handler: _Msg_UpdateParams_Handler, Handler: _Msg_UpdateParams_Handler,
}, },
{
MethodName: "Authenticate",
Handler: _Msg_Authenticate_Handler,
},
{
MethodName: "ProveWitness",
Handler: _Msg_ProveWitness_Handler,
},
{
MethodName: "SyncVault",
Handler: _Msg_SyncVault_Handler,
},
{ {
MethodName: "RegisterController", MethodName: "RegisterController",
Handler: _Msg_RegisterController_Handler, Handler: _Msg_RegisterController_Handler,
}, },
{ {
MethodName: "AuthenticateController", MethodName: "RegisterService",
Handler: _Msg_AuthenticateController_Handler, Handler: _Msg_RegisterService_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},

File diff suppressed because it is too large Load Diff

3
client/go.mod Normal file
View File

@ -0,0 +1,3 @@
module client
go 1.22.0

View File

@ -1,21 +1,16 @@
{ {
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.10.5/.schema/devbox.schema.json", "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
"packages": [ "packages": ["golangci-lint@latest", "go@1.21", "air@latest"],
"ipfs@latest",
"golangci-lint@latest",
"go@1.21",
"templ@latest",
"air@latest"
],
"env": { "env": {
"GOPATH": "$HOME/go", "GOPATH": "$HOME/go",
"PATH": "$HOME/go/bin:$PATH" "PATH": "$HOME/go/bin:$PATH"
}, },
"shell": { "shell": {
"scripts": { "scripts": {
"install": ["make install"],
"proto": ["make proto-gen"], "proto": ["make proto-gen"],
"templ": ["templ generate"], "build": ["go build -o ./bin/sonrd ./cmd/sonrd"],
"ps": ["devbox services ls"] "testnet": ["make sh-testnet"]
} }
} }
} }

3
go.mod
View File

@ -70,6 +70,7 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4
google.golang.org/grpc v1.64.0 google.golang.org/grpc v1.64.0
google.golang.org/protobuf v1.34.2 google.golang.org/protobuf v1.34.2
gopkg.in/macaroon-bakery.v2 v2.3.0
) )
require ( require (
@ -304,7 +305,9 @@ require (
google.golang.org/api v0.169.0 // indirect google.golang.org/api v0.169.0 // indirect
google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240617180043-68d350f18fd4 // indirect
gopkg.in/errgo.v1 v1.0.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/macaroon.v2 v2.1.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect gotest.tools/v3 v3.5.1 // indirect

30
go.sum
View File

@ -1110,6 +1110,10 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8
github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk=
github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY=
github.com/frankban/quicktest v1.0.0/go.mod h1:R98jIehRai+d1/3Hv2//jOVCTJhW1VBavT6B6CuGq2k=
github.com/frankban/quicktest v1.1.0/go.mod h1:R98jIehRai+d1/3Hv2//jOVCTJhW1VBavT6B6CuGq2k=
github.com/frankban/quicktest v1.2.2/go.mod h1:Qh/WofXFeiAFII1aEBu529AtJo6Zg2VHscnEsbBnJ20=
github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
@ -1155,6 +1159,7 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-macaroon-bakery/macaroonpb v1.0.0/go.mod h1:UzrGOcbiwTXISFP2XDLDPjfhMINZa+fX/7A2lMd31zc=
github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
@ -1245,6 +1250,7 @@ github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.2.1-0.20190312032427-6f77996f0c42/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
@ -1557,6 +1563,12 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/juju/mgotest v1.0.1/go.mod h1:vTaDufYul+Ps8D7bgseHjq87X8eu0ivlKLp9mVc/Bfc=
github.com/juju/postgrestest v1.1.0/go.mod h1:/n17Y2T6iFozzXwSCO0JYJ5gSiz2caEtSwAjh/uLXDM=
github.com/juju/qthttptest v0.0.1/go.mod h1://LCf/Ls22/rPw2u1yWukUJvYtfPY4nYpWUl2uZhryo=
github.com/juju/schema v1.0.0/go.mod h1:Y+ThzXpUJ0E7NYYocAbuvJ7vTivXfrof/IfRPq/0abI=
github.com/juju/webbrowser v0.0.0-20160309143629-54b8c57083b4/go.mod h1:G6PCelgkM6cuvyD10iYJsjLBsSadVXtJ+nBxFAxE2BU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
@ -1597,6 +1609,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c=
github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8=
@ -1886,6 +1900,7 @@ github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGn
github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk= github.com/regen-network/gocuke v0.6.2/go.mod h1:zYaqIHZobHyd0xOrHGPQjbhGJsuZ1oElx150u2o1xuk=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
@ -2108,7 +2123,9 @@ go4.org v0.0.0-20200411211856-f5505b9728dd/go.mod h1:CIiUVy99QCPfoE13bO4EZaz5GZM
go4.org v0.0.0-20230225012048-214862532bf5 h1:nifaUDeh+rPaBCMPMQHZmvJf+QdpLFnuQPwx+LxVmtc= go4.org v0.0.0-20230225012048-214862532bf5 h1:nifaUDeh+rPaBCMPMQHZmvJf+QdpLFnuQPwx+LxVmtc=
go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEbFGHD4hhz6S1ZYeaU= go4.org v0.0.0-20230225012048-214862532bf5/go.mod h1:F57wTi5Lrj6WLyswp5EYV1ncrEbFGHD4hhz6S1ZYeaU=
golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
@ -2203,6 +2220,7 @@ golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0= golang.org/x/mod v0.18.0 h1:5+9lSbEzPSdWkH32vYPBwEpX8KwDbM52Ud9xBUvNlb0=
golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.18.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20150829230318-ea47fc708ee3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@ -2344,6 +2362,7 @@ golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
@ -2506,6 +2525,7 @@ golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181008205924-a2b3f7f249e9/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@ -2930,10 +2950,20 @@ gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw=
gopkg.in/errgo.v1 v1.0.0/go.mod h1:CxwszS/Xz1C49Ucd2i6Zil5UToP1EmyrFhKaMVbg1mk=
gopkg.in/errgo.v1 v1.0.1 h1:oQFRXzZ7CkBGdm1XZm/EbQYaYNNEElNBOd09M6cqNso=
gopkg.in/errgo.v1 v1.0.1/go.mod h1:3NjfXwocQRYAPTq4/fzX+CwUhPRcR/azYRhj8G+LqMo=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/httprequest.v1 v1.2.0/go.mod h1:T61ZUaJLpMnzvoJDO03ZD8yRXD4nZzBeDoW5e9sffjg=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/juju/environschema.v1 v1.0.0/go.mod h1:WTgU3KXKCVoO9bMmG/4KHzoaRvLeoxfjArpgd1MGWFA=
gopkg.in/macaroon-bakery.v2 v2.3.0 h1:b40knPgPTke1QLTE8BSYeH7+R/hiIozB1A8CTLYN0Ic=
gopkg.in/macaroon-bakery.v2 v2.3.0/go.mod h1:/8YhtPARXeRzbpEPLmRB66+gQE8/pzBBkWwg7Vz/guc=
gopkg.in/macaroon.v2 v2.1.0 h1:HZcsjBCzq9t0eBPMKqTN/uSN6JOm78ZJ2INbqcBQOUI=
gopkg.in/macaroon.v2 v2.1.0/go.mod h1:OUb+TQP/OP0WOerC2Jp/3CwhIKyIa9kQjuc7H24e6/o=
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w=
gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= gopkg.in/square/go-jose.v2 v2.5.1/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=

View File

@ -1,8 +0,0 @@
version: "0.5"
processes:
ipfs:
command: ipfs daemon
restart: always
sonrd:
command: task testnet

View File

@ -0,0 +1,4 @@
syntax = "proto3";
package did.v1;
option go_package = "github.com/onsonr/hway/x/did/types";

24
proto/did/v1/enums.proto Normal file
View File

@ -0,0 +1,24 @@
syntax = "proto3";
package did.v1;
import "gogoproto/gogo.proto";
import "amino/amino.proto";
option go_package = "github.com/onsonr/hway/x/did/types";
// PermissionScope define the Capabilities Controllers can grant for Services
enum PermissionScope {
PERMISSION_SCOPE_UNSPECIFIED = 0;
PERMISSION_SCOPE_PROFILE_NAME = 1;
PERMISSION_SCOPE_IDENTIFIERS_EMAIL = 2;
PERMISSION_SCOPE_IDENTIFIERS_PHONE = 3;
PERMISSION_SCOPE_TRANSACTIONS_READ = 4;
PERMISSION_SCOPE_TRANSACTIONS_WRITE = 5;
PERMISSION_SCOPE_WALLETS_READ = 6;
PERMISSION_SCOPE_WALLETS_CREATE = 7;
PERMISSION_SCOPE_WALLETS_SUBSCRIBE = 8;
PERMISSION_SCOPE_WALLETS_UPDATE = 9;
PERMISSION_SCOPE_TRANSACTIONS_VERIFY = 10;
PERMISSION_SCOPE_TRANSACTIONS_BROADCAST = 11;
PERMISSION_SCOPE_ADMIN_USER = 12;
PERMISSION_SCOPE_ADMIN_VALIDATOR = 13;
}

View File

@ -3,11 +3,13 @@ package did.v1;
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";
import "amino/amino.proto"; import "amino/amino.proto";
import "did/v1/types.proto";
option go_package = "github.com/onsonr/hway/x/did/types"; option go_package = "github.com/onsonr/hway/x/did/types";
// GenesisState defines the module genesis state // GenesisState defines the module genesis state
message GenesisState { message GenesisState {
// Params defines all the paramaters of the module. // Params defines all the parameters of the module.
Params params = 1 [(gogoproto.nullable) = false]; Params params = 1 [(gogoproto.nullable) = false];
} }
@ -24,49 +26,4 @@ message Params {
repeated ChainInfo whitelisted_chains = 2; repeated ChainInfo whitelisted_chains = 2;
} }
// Meta represents
message Meta {
option (amino.name) = "did/meta";
option (gogoproto.equal) = true;
option (gogoproto.goproto_stringer) = false;
// Key value data for the Property
map<string, string> data = 1;
}
message AssetInfo {
string denom = 1;
string asset_type = 2;
string origin_chain = 3;
string origin_denom = 4;
string origin_type = 5;
string symbol = 6;
int32 decimals = 7;
string description = 8;
string image = 9;
string coinGeckoId = 10;
bool enable = 11;
string path = 12;
string channel = 13;
string port = 14;
Meta counter_party = 15;
}
message ChainInfo {
string chain_id_cosmos = 1;
string chain_name = 2;
string symbol = 3;
string bechAccountPrefix = 4;
string bechValidatorPrefix = 5;
string origin_genesis_time = 6;
repeated Meta accountType = 7;
repeated Meta grpc_endpoint = 8;
repeated Meta lcd_endpoint = 9;
Meta explorer = 10;
string fee_base = 11;
repeated string fee_rate = 12;
int32 fee_init_gas_limit = 13;
bool fee_isSimulable = 14;
double simul_gas_multiply = 15;
}

View File

@ -3,6 +3,7 @@ package did.v1;
import "google/api/annotations.proto"; import "google/api/annotations.proto";
import "did/v1/genesis.proto"; import "did/v1/genesis.proto";
import "did/v1/types.proto";
option go_package = "github.com/onsonr/hway/x/did/types"; option go_package = "github.com/onsonr/hway/x/did/types";
@ -13,14 +14,29 @@ service Query {
option (google.api.http).get = "/did/params"; option (google.api.http).get = "/did/params";
} }
// Resolve queries the DID document by its id. // Accounts returns associated wallet accounts with the DID.
rpc ResolveIdentifier(QueryResolveRequest) returns (QueryResolveResponse) { rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) {
option (google.api.http).get = "/did/resolve/{id}"; option (google.api.http).get = "/did/{did}/accounts";
} }
// LoginOptions queries the PublicKeyCredentialAttestationOptions for starting a login flow. // Credentials returns associated credentials with the DID and Service Origin.
rpc WitnessCredential(QueryWitnessCredentialRequest) returns (QueryWitnessCredentialResponse) { rpc Credentials(QueryCredentialsRequest) returns (QueryCredentialsResponse) {
option (google.api.http).get = "/did/assertion/{id}/witness"; option (google.api.http).get = "/did/{did}/{origin}/credentials";
}
// Identities returns associated identity with the DID.
rpc Identities(QueryIdentitiesRequest) returns (QueryIdentitiesResponse) {
option (google.api.http).get = "/did/{did}/identities";
}
// Resolve queries the DID document by its id.
rpc Resolve(QueryResolveRequest) returns (QueryResolveResponse) {
option (google.api.http).get = "/did/resolve/{did}";
}
// Service returns associated ServiceInfo for a given Origin
rpc Service(QueryServiceRequest) returns (QueryServiceResponse) {
option (google.api.http).get = "/did/service/{origin}";
} }
} }
@ -33,35 +49,56 @@ message QueryParamsResponse {
Params params = 1; Params params = 1;
} }
// QueryExistsRequest is the request type for the Query/Exists RPC method. // QueryAccountsRequest is the request type for the Query/Exists RPC method.
message QueryExistsRequest { message QueryAccountsRequest {
string kind = 1; string did = 1;
string value = 2;
} }
// QueryExistsResponse is the response type for the Query/Exists RPC method. // QueryAccountsResponse is the response type for the Query/Exists RPC method.
message QueryExistsResponse { message QueryAccountsResponse {
bool exists = 1; bool exists = 1;
} }
// QueryCredentialsRequest is the request type for the Query/Exists RPC method.
message QueryCredentialsRequest {
string did = 1;
string origin = 2;
}
// QueryCredentialsResponse is the response type for the Query/Exists RPC method.
message QueryCredentialsResponse {
map<string, bytes> credentials = 1;
}
// QueryIdentitiesRequest is the request type for the Query/Exists RPC method.
message QueryIdentitiesRequest {
string did = 1;
}
// QueryIdentitiesResponse is the response type for the Query/Exists RPC method.
message QueryIdentitiesResponse {
bool exists = 1;
repeated VerificationMethod verificationMethod = 2;
}
// QueryResolveRequest is the request type for the Query/Resolve RPC method. // QueryResolveRequest is the request type for the Query/Resolve RPC method.
message QueryResolveRequest { message QueryResolveRequest {
string id = 1; string did = 1;
} }
// QueryResolveResponse is the response type for the Query/Resolve RPC method. // QueryResolveResponse is the response type for the Query/Resolve RPC method.
message QueryResolveResponse { message QueryResolveResponse {
// document is the DID document // document is the DID document
string document = 1; Document document = 1;
} }
// QueryLoginOptionsRequest is the request type for the Query/LoginOptions RPC method. // QueryServiceRequest is the request type for the Query/LoginOptions RPC method.
message QueryWitnessCredentialRequest { message QueryServiceRequest {
string id = 1; string origin = 1;
} }
// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method. // QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method.
message QueryWitnessCredentialResponse { message QueryServiceResponse {
// options is the PublicKeyCredentialAttestationOptions // options is the PublicKeyCredentialAttestationOptions
string options = 1; string options = 1;
} }

View File

@ -5,13 +5,14 @@ option go_package = "github.com/onsonr/hway/x/did/types";
import "cosmos/orm/v1/orm.proto"; import "cosmos/orm/v1/orm.proto";
import "did/v1/genesis.proto"; import "did/v1/genesis.proto";
import "did/v1/enums.proto";
// Aliases represents the `alsoKnownAs` property associated with a DID Controller // Aliases represents the `alsoKnownAs` property associated with a DID Controller
message Aliases { message Aliases {
option (cosmos.orm.v1.table) = { option (cosmos.orm.v1.table) = {
id: 1 id: 1
primary_key: {fields: "id"} primary_key: {fields: "id"}
index: { id: 1, fields: "handle", unique: true } index: { id: 1, fields: "subject", unique: true }
}; };
// The unique identifier of the alias // The unique identifier of the alias
@ -20,8 +21,8 @@ message Aliases {
// Origin is the Alias provider // Origin is the Alias provider
string origin = 2; string origin = 2;
// Handle is the user defined alias // Subject is the user defined alias
string handle = 3; string subject = 3;
// Controller of the alias // Controller of the alias
string controller = 4; string controller = 4;
@ -146,9 +147,15 @@ message Service {
// The type of the service // The type of the service
string service_type = 2; string service_type = 2;
// The service endpoint
string service_endpoint = 3;
// The controller DID of the service // The controller DID of the service
string controller_did = 4; string controller_did = 3;
// The domain name of the service
string origin_uri = 4;
// The service endpoint
map<string, string> service_endpoints = 5;
// Scopes is the Authorization Grants of the service
repeated PermissionScope scopes = 6;
} }

View File

@ -3,6 +3,7 @@ syntax = "proto3";
package did.v1; package did.v1;
import "cosmos/msg/v1/msg.proto"; import "cosmos/msg/v1/msg.proto";
import "did/v1/enums.proto";
import "did/v1/genesis.proto"; import "did/v1/genesis.proto";
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto"; import "cosmos_proto/cosmos.proto";
@ -16,11 +17,20 @@ service Msg {
// Since: cosmos-sdk 0.47 // Since: cosmos-sdk 0.47
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse); rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. // Authenticate asserts the given controller is the owner of the given address.
rpc RegisterController(MsgInitializeController) returns (MsgInitializeControllerResponse); rpc Authenticate(MsgAuthenticate) returns (MsgAuthenticateResponse);
// AuthenticateController asserts the given controller is the owner of the given address. // ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators.
rpc AuthenticateController(MsgAuthenticateController) returns (MsgAuthenticateControllerResponse); rpc ProveWitness(MsgProveWitness) returns (MsgProveWitnessResponse);
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
rpc SyncVault(MsgSyncVault) returns (MsgSyncVaultResponse);
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse);
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
rpc RegisterService(MsgRegisterService) returns (MsgRegisterServiceResponse);
} }
// MsgUpdateParams is the Msg/UpdateParams request type. // MsgUpdateParams is the Msg/UpdateParams request type.
@ -44,31 +54,8 @@ message MsgUpdateParams {
// Since: cosmos-sdk 0.47 // Since: cosmos-sdk 0.47
message MsgUpdateParamsResponse {} message MsgUpdateParamsResponse {}
// MsgInitializeController is the message type for the InitializeController RPC.
message MsgInitializeController {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Assertions is the list of assertions to initialize the controller with.
repeated bytes assertions = 2;
// Keyshares is the list of keyshares to initialize the controller with.
repeated bytes keyshares = 3;
// Verifications is the list of verifications to initialize the controller with.
repeated bytes verifications = 4;
}
// MsgInitializeControllerResponse is the response type for the InitializeController RPC.
message MsgInitializeControllerResponse {
// Controller is the address of the initialized controller.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
}
// MsgAuthenticate is the message type for the Authenticate RPC. // MsgAuthenticate is the message type for the Authenticate RPC.
message MsgAuthenticateController { message MsgAuthenticate {
option (cosmos.msg.v1.signer) = "authority"; option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account. // authority is the address of the governance account.
@ -84,6 +71,89 @@ message MsgAuthenticateController {
string origin = 4; string origin = 4;
} }
// MsgAuthenticateControllerResponse is the response type for the Authenticate RPC. // MsgAuthenticateResponse is the response type for the Authenticate RPC.
message MsgAuthenticateControllerResponse {} message MsgAuthenticateResponse {}
// MsgProveWitness is the message type for the ProveWitness RPC.
message MsgProveWitness {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// property is key to prove.
string property = 2;
// Witness Value is the bytes of the witness.
bytes witness = 3;
}
// MsgProveWitnessResponse is the response type for the ProveWitness RPC.
message MsgProveWitnessResponse {
bool success = 1;
string property = 2;
}
// MsgSyncVault is the message type for the SyncVault RPC.
message MsgSyncVault {
option (cosmos.msg.v1.signer) = "controller";
// controller is the address of the controller to sync.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// cid is the IPFS content identifier.
string cid = 2;
// Macroon is the public token to authenticate the operation.
bytes macron = 3;
}
// MsgSyncVaultResponse is the response type for the SyncVault RPC.
message MsgSyncVaultResponse {
bool success = 1;
}
// MsgRegisterController is the message type for the InitializeController RPC.
message MsgRegisterController {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Assertions is the list of assertions to initialize the controller with.
repeated bytes assertions = 2;
// Keyshares is the list of keyshares to initialize the controller with.
repeated bytes keyshares = 3;
// Verifications is the list of verifications to initialize the controller with.
repeated bytes verifications = 4;
}
// MsgRegisterControllerResponse is the response type for the InitializeController RPC.
message MsgRegisterControllerResponse {
// Controller is the address of the initialized controller.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Accounts are a Address Map and Supported coin Denoms for the controller
map<string, string> accounts = 2;
}
// MsgRegisterService is the message type for the RegisterService RPC.
message MsgRegisterService {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// origin is the origin of the request in wildcard form.
string origin_uri = 2;
// PermissionScope is the scope of the service.
repeated PermissionScope scopes = 3;
}
// MsgRegisterServiceResponse is the response type for the RegisterService RPC.
message MsgRegisterServiceResponse {
bool success = 1;
}

View File

@ -3,15 +3,56 @@ syntax = "proto3";
package did.v1; package did.v1;
import "cosmos/msg/v1/msg.proto"; import "cosmos/msg/v1/msg.proto";
import "did/v1/genesis.proto";
import "gogoproto/gogo.proto"; import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto"; import "cosmos_proto/cosmos.proto";
option go_package = "github.com/onsonr/hway/x/did/types"; option go_package = "github.com/onsonr/hway/x/did/types";
// AssetInfo defines the asset info
message AssetInfo {
string id = 1;
string denom = 2;
string symbol = 3;
string asset_type = 4;
string origin_chain = 5;
string origin_denom = 6;
int32 decimals = 7;
string description = 8;
string image_url = 9;
string coingecko_id = 10;
bool is_enabled = 11;
string ibc_path = 12;
string ibc_channel = 13;
string ibc_port = 14;
}
// BaseDocument defines a DID document // ChainInfo defines the chain info
message BaseDocument { message ChainInfo {
string id = 1;
string chain_id = 2;
string name = 3;
string symbol = 4;
string bech32_prefix = 5;
string genesis_time = 6;
repeated Endpoint grpc_endpoints = 7;
repeated Endpoint rest_endpoints = 8;
ExplorerInfo explorer = 9;
FeeInfo fee_info = 10;
}
// Credential defines a WebAuthn credential
message Credential {
string id = 1;
string credential_type = 2;
bytes credential_id = 3;
repeated string transport = 4;
string attestation_type = 5;
string display_name = 6;
string controller = 7;
}
// Document defines a DID document
message Document {
string id = 1; string id = 1;
repeated VerificationMethod verification_methods = 2; repeated VerificationMethod verification_methods = 2;
repeated string authentication = 4; repeated string authentication = 4;
@ -20,6 +61,44 @@ message BaseDocument {
repeated string capability_invocation = 8; repeated string capability_invocation = 8;
} }
// Endpoint defines an endpoint
message Endpoint {
string url = 1;
bool is_primary = 2;
}
// ExplorerInfo defines the explorer info
message ExplorerInfo {
string name = 1;
string url = 2;
}
// FeeInfo defines a fee info
message FeeInfo {
string base_denom = 1;
repeated string fee_rates = 2;
int32 init_gas_limit = 3;
bool is_simulable = 4;
double gas_multiply = 5;
}
// Identity defines an associated profile for a did subject
message Identity {
string id = 1;
string subject = 2;
string controller = 3;
repeated Credential credentials = 4;
repeated VerificationMethod verification_methods = 5;
}
// PubKey defines a public key for a did
message PubKey {
string id = 1;
bytes key = 2;
string key_type = 3;
string controller = 4;
}
// VerificationMethod defines a verification method // VerificationMethod defines a verification method
message VerificationMethod { message VerificationMethod {
string id = 1; string id = 1;

View File

@ -31,23 +31,32 @@ func (k Querier) Params(c context.Context, req *types.QueryParamsRequest) (*type
return &types.QueryParamsResponse{Params: &p}, nil return &types.QueryParamsResponse{Params: &p}, nil
} }
// PropertyExists implements types.QueryServer. // Accounts implements types.QueryServer.
func (k Querier) PropertyExists(goCtx context.Context, req *types.QueryExistsRequest) (*types.QueryExistsResponse, error) { func (k Querier) Accounts(goCtx context.Context, req *types.QueryAccountsRequest) (*types.QueryAccountsResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx) // ctx := sdk.UnwrapSDKContext(goCtx)
panic("PropertyExists is unimplemented") return &types.QueryAccountsResponse{}, nil
return &types.QueryExistsResponse{}, nil
} }
// ResolveIdentifier implements types.QueryServer. // Credentials implements types.QueryServer.
func (k Querier) ResolveIdentifier(goCtx context.Context, req *types.QueryResolveRequest) (*types.QueryResolveResponse, error) { func (k Querier) Credentials(goCtx context.Context, req *types.QueryCredentialsRequest) (*types.QueryCredentialsResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
return &types.QueryCredentialsResponse{}, nil
}
// Identities implements types.QueryServer.
func (k Querier) Identities(goCtx context.Context, req *types.QueryIdentitiesRequest) (*types.QueryIdentitiesResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
return &types.QueryIdentitiesResponse{}, nil
}
// Resolve implements types.QueryServer.
func (k Querier) Resolve(goCtx context.Context, req *types.QueryResolveRequest) (*types.QueryResolveResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx) // ctx := sdk.UnwrapSDKContext(goCtx)
panic("ResolveIdentifier is unimplemented")
return &types.QueryResolveResponse{}, nil return &types.QueryResolveResponse{}, nil
} }
// WitnessCredential implements types.QueryServer. // Service implements types.QueryServer.
func (k Querier) WitnessCredential(goCtx context.Context, req *types.QueryWitnessCredentialRequest) (*types.QueryWitnessCredentialResponse, error) { func (k Querier) Service(goCtx context.Context, req *types.QueryServiceRequest) (*types.QueryServiceResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx) // ctx := sdk.UnwrapSDKContext(goCtx)
panic("WitnessCredential is unimplemented") return &types.QueryServiceResponse{}, nil
return &types.QueryWitnessCredentialResponse{}, nil
} }

View File

@ -3,9 +3,11 @@ package keeper
import ( import (
"context" "context"
sdk "github.com/cosmos/cosmos-sdk/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"cosmossdk.io/errors" "cosmossdk.io/errors"
didv1 "github.com/onsonr/hway/api/did/v1"
"github.com/onsonr/hway/x/did/types" "github.com/onsonr/hway/x/did/types"
) )
@ -29,16 +31,45 @@ func (ms msgServer) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams
return nil, ms.k.Params.Set(ctx, msg.Params) return nil, ms.k.Params.Set(ctx, msg.Params)
} }
// AuthenticateController implements types.MsgServer. // Authenticate implements types.MsgServer.
func (ms msgServer) AuthenticateController(ctx context.Context, msg *types.MsgAuthenticateController) (*types.MsgAuthenticateControllerResponse, error) { func (ms msgServer) Authenticate(ctx context.Context, msg *types.MsgAuthenticate) (*types.MsgAuthenticateResponse, error) {
if ms.k.authority != msg.Authority {
return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
}
// ctx := sdk.UnwrapSDKContext(goCtx) // ctx := sdk.UnwrapSDKContext(goCtx)
panic("AuthenticateController is unimplemented") return &types.MsgAuthenticateResponse{}, nil
return &types.MsgAuthenticateControllerResponse{}, nil
} }
// RegisterController implements types.MsgServer. // RegisterController implements types.MsgServer.
func (ms msgServer) RegisterController(ctx context.Context, msg *types.MsgInitializeController) (*types.MsgInitializeControllerResponse, error) { func (ms msgServer) RegisterController(goCtx context.Context, msg *types.MsgRegisterController) (*types.MsgRegisterControllerResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx) if ms.k.authority != msg.Authority {
panic("RegisterController is unimplemented") return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
return &types.MsgInitializeControllerResponse{}, nil }
ctx := sdk.UnwrapSDKContext(goCtx)
svc := didv1.Service{
ControllerDid: msg.Authority,
}
ms.k.OrmDB.ServiceTable().Insert(ctx, &svc)
return &types.MsgRegisterControllerResponse{}, nil
}
// RegisterService implements types.MsgServer.
func (ms msgServer) RegisterService(ctx context.Context, msg *types.MsgRegisterService) (*types.MsgRegisterServiceResponse, error) {
if ms.k.authority != msg.Authority {
return nil, errors.Wrapf(govtypes.ErrInvalidSigner, "invalid authority; expected %s, got %s", ms.k.authority, msg.Authority)
}
// ctx := sdk.UnwrapSDKContext(goCtx)
return &types.MsgRegisterServiceResponse{}, nil
}
// ProveWitness implements types.MsgServer.
func (ms msgServer) ProveWitness(ctx context.Context, msg *types.MsgProveWitness) (*types.MsgProveWitnessResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
return &types.MsgProveWitnessResponse{}, nil
}
// SyncVault implements types.MsgServer.
func (ms msgServer) SyncVault(ctx context.Context, msg *types.MsgSyncVault) (*types.MsgSyncVaultResponse, error) {
// ctx := sdk.UnwrapSDKContext(goCtx)
return &types.MsgSyncVaultResponse{}, nil
} }

View File

@ -1 +1,16 @@
package keeper package keeper
func (k Keeper) insertAliasFromDisplayName() {
}
func (k Keeper) insertAssertionFromIdentity() {
}
func (k Keeper) insertAuthenticationFromCredential() {
}
func (k Keeper) insertControllerFromMotrVault() {
}
func (k Keeper) insertDelegationFromAccount() {
}

View File

@ -0,0 +1,35 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: did/v1/accounts.proto
package types
import (
fmt "fmt"
proto "github.com/cosmos/gogoproto/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
func init() { proto.RegisterFile("did/v1/accounts.proto", fileDescriptor_2125a09fb14c3bc3) }
var fileDescriptor_2125a09fb14c3bc3 = []byte{
// 122 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4d, 0xc9, 0x4c, 0xd1,
0x2f, 0x33, 0xd4, 0x4f, 0x4c, 0x4e, 0xce, 0x2f, 0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f,
0xc9, 0x17, 0x62, 0x4b, 0xc9, 0x4c, 0xd1, 0x2b, 0x33, 0x74, 0xb2, 0x39, 0xf1, 0x48, 0x8e, 0xf1,
0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e,
0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xa5, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc,
0x5c, 0xfd, 0xfc, 0xbc, 0xe2, 0xfc, 0xbc, 0x22, 0xfd, 0x8c, 0xf2, 0xc4, 0x4a, 0xfd, 0x0a, 0x7d,
0x90, 0x89, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0x60, 0xc3, 0x8c, 0x01, 0x01, 0x00, 0x00,
0xff, 0xff, 0x28, 0xd1, 0x54, 0x54, 0x65, 0x00, 0x00, 0x00,
}

View File

@ -34,7 +34,8 @@ func RegisterInterfaces(registry types.InterfaceRegistry) {
registry.RegisterImplementations( registry.RegisterImplementations(
(*sdk.Msg)(nil), (*sdk.Msg)(nil),
&MsgUpdateParams{}, &MsgUpdateParams{},
&MsgInitializeController{}, &MsgRegisterController{},
&MsgRegisterService{},
) )
msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc)
} }

120
x/did/types/enums.pb.go Normal file
View File

@ -0,0 +1,120 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: did/v1/enums.proto
package types
import (
fmt "fmt"
_ "github.com/cosmos/cosmos-sdk/types/tx/amino"
_ "github.com/cosmos/gogoproto/gogoproto"
proto "github.com/cosmos/gogoproto/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// PermissionScope define the Capabilities Controllers can grant for Services
type PermissionScope int32
const (
PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0
PermissionScope_PERMISSION_SCOPE_PROFILE_NAME PermissionScope = 1
PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_EMAIL PermissionScope = 2
PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_PHONE PermissionScope = 3
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ PermissionScope = 4
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE PermissionScope = 5
PermissionScope_PERMISSION_SCOPE_WALLETS_READ PermissionScope = 6
PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE PermissionScope = 7
PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE PermissionScope = 8
PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE PermissionScope = 9
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY PermissionScope = 10
PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST PermissionScope = 11
PermissionScope_PERMISSION_SCOPE_ADMIN_USER PermissionScope = 12
PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR PermissionScope = 13
)
var PermissionScope_name = map[int32]string{
0: "PERMISSION_SCOPE_UNSPECIFIED",
1: "PERMISSION_SCOPE_PROFILE_NAME",
2: "PERMISSION_SCOPE_IDENTIFIERS_EMAIL",
3: "PERMISSION_SCOPE_IDENTIFIERS_PHONE",
4: "PERMISSION_SCOPE_TRANSACTIONS_READ",
5: "PERMISSION_SCOPE_TRANSACTIONS_WRITE",
6: "PERMISSION_SCOPE_WALLETS_READ",
7: "PERMISSION_SCOPE_WALLETS_CREATE",
8: "PERMISSION_SCOPE_WALLETS_SUBSCRIBE",
9: "PERMISSION_SCOPE_WALLETS_UPDATE",
10: "PERMISSION_SCOPE_TRANSACTIONS_VERIFY",
11: "PERMISSION_SCOPE_TRANSACTIONS_BROADCAST",
12: "PERMISSION_SCOPE_ADMIN_USER",
13: "PERMISSION_SCOPE_ADMIN_VALIDATOR",
}
var PermissionScope_value = map[string]int32{
"PERMISSION_SCOPE_UNSPECIFIED": 0,
"PERMISSION_SCOPE_PROFILE_NAME": 1,
"PERMISSION_SCOPE_IDENTIFIERS_EMAIL": 2,
"PERMISSION_SCOPE_IDENTIFIERS_PHONE": 3,
"PERMISSION_SCOPE_TRANSACTIONS_READ": 4,
"PERMISSION_SCOPE_TRANSACTIONS_WRITE": 5,
"PERMISSION_SCOPE_WALLETS_READ": 6,
"PERMISSION_SCOPE_WALLETS_CREATE": 7,
"PERMISSION_SCOPE_WALLETS_SUBSCRIBE": 8,
"PERMISSION_SCOPE_WALLETS_UPDATE": 9,
"PERMISSION_SCOPE_TRANSACTIONS_VERIFY": 10,
"PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": 11,
"PERMISSION_SCOPE_ADMIN_USER": 12,
"PERMISSION_SCOPE_ADMIN_VALIDATOR": 13,
}
func (x PermissionScope) String() string {
return proto.EnumName(PermissionScope_name, int32(x))
}
func (PermissionScope) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_001c58538597e328, []int{0}
}
func init() {
proto.RegisterEnum("did.v1.PermissionScope", PermissionScope_name, PermissionScope_value)
}
func init() { proto.RegisterFile("did/v1/enums.proto", fileDescriptor_001c58538597e328) }
var fileDescriptor_001c58538597e328 = []byte{
// 388 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0xd2, 0xc1, 0x6e, 0xd3, 0x30,
0x18, 0x07, 0xf0, 0x04, 0x46, 0x01, 0x03, 0xc2, 0x58, 0x9c, 0x06, 0x64, 0x63, 0x9b, 0x18, 0x02,
0xa9, 0xd6, 0xc4, 0x95, 0x8b, 0x93, 0x7c, 0x15, 0x96, 0x12, 0x27, 0xb2, 0x9d, 0x4d, 0x70, 0x89,
0xd6, 0x26, 0x6a, 0x73, 0x48, 0x5c, 0x35, 0x6d, 0xa1, 0x6f, 0xc1, 0x73, 0xf0, 0x24, 0x1c, 0x7b,
0xe4, 0x88, 0xda, 0x17, 0x41, 0x69, 0xe1, 0xd4, 0x36, 0x5c, 0x2c, 0xeb, 0xf3, 0x4f, 0x7f, 0x7d,
0x96, 0xfe, 0x88, 0x64, 0x45, 0x46, 0xe7, 0x57, 0x34, 0xaf, 0x66, 0x65, 0xdd, 0x1d, 0x4f, 0xcc,
0xd4, 0x90, 0x4e, 0x56, 0x64, 0xdd, 0xf9, 0xd5, 0xf1, 0xf3, 0xa1, 0x19, 0x9a, 0xcd, 0x88, 0x36,
0xb7, 0xed, 0xeb, 0xf1, 0xb3, 0xdb, 0xb2, 0xa8, 0x0c, 0xdd, 0x9c, 0xdb, 0xd1, 0xbb, 0x1f, 0x47,
0xe8, 0x69, 0x9c, 0x4f, 0xca, 0xa2, 0xae, 0x0b, 0x53, 0xa9, 0x81, 0x19, 0xe7, 0xe4, 0x14, 0xbd,
0x8c, 0x41, 0x86, 0x5c, 0x29, 0x1e, 0x89, 0x54, 0x79, 0x51, 0x0c, 0x69, 0x22, 0x54, 0x0c, 0x1e,
0xef, 0x71, 0xf0, 0xb1, 0x45, 0x5e, 0xa3, 0x57, 0x3b, 0x22, 0x96, 0x51, 0x8f, 0x07, 0x90, 0x0a,
0x16, 0x02, 0xb6, 0xc9, 0x1b, 0x74, 0xb6, 0x43, 0xb8, 0x0f, 0x42, 0x37, 0x19, 0x52, 0xa5, 0x10,
0x32, 0x1e, 0xe0, 0x3b, 0xff, 0x75, 0xf1, 0xa7, 0x48, 0x00, 0xbe, 0xbb, 0xd7, 0x69, 0xc9, 0x84,
0x62, 0x9e, 0xe6, 0x91, 0x50, 0xa9, 0x04, 0xe6, 0xe3, 0x23, 0x72, 0x89, 0xce, 0xdb, 0xdd, 0x8d,
0xe4, 0x1a, 0xf0, 0xbd, 0xbd, 0x7f, 0xb8, 0x61, 0x41, 0x00, 0xfa, 0x6f, 0x56, 0x87, 0x9c, 0xa3,
0x93, 0x83, 0xc4, 0x93, 0xc0, 0x34, 0xe0, 0xfb, 0x7b, 0x17, 0xfb, 0x87, 0x54, 0xe2, 0x2a, 0x4f,
0x72, 0x17, 0xf0, 0x83, 0xd6, 0xb0, 0x24, 0xf6, 0x9b, 0xb0, 0x87, 0xe4, 0x2d, 0xba, 0x68, 0xdf,
0xfe, 0x1a, 0x24, 0xef, 0x7d, 0xc6, 0x88, 0xbc, 0x47, 0x97, 0xed, 0xd2, 0x95, 0x11, 0xf3, 0x3d,
0xa6, 0x34, 0x7e, 0x44, 0x4e, 0xd0, 0x8b, 0x1d, 0xcc, 0xfc, 0x90, 0x8b, 0x34, 0x51, 0x20, 0xf1,
0x63, 0x72, 0x81, 0x4e, 0x0f, 0x80, 0x6b, 0x16, 0x70, 0x9f, 0xe9, 0x48, 0xe2, 0x27, 0xee, 0xc7,
0x9f, 0x2b, 0xc7, 0x5e, 0xae, 0x1c, 0xfb, 0xf7, 0xca, 0xb1, 0xbf, 0xaf, 0x1d, 0x6b, 0xb9, 0x76,
0xac, 0x5f, 0x6b, 0xc7, 0xfa, 0x72, 0x36, 0x2c, 0xa6, 0xa3, 0x59, 0xbf, 0x3b, 0x30, 0x25, 0x35,
0x55, 0x6d, 0xaa, 0x09, 0x1d, 0x7d, 0xbd, 0x5d, 0xd0, 0x6f, 0xb4, 0x29, 0xe9, 0x74, 0x31, 0xce,
0xeb, 0x7e, 0x67, 0xd3, 0xb8, 0x0f, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x9e, 0x1a, 0xa8, 0xd9,
0xb8, 0x02, 0x00, 0x00,
}

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,10 @@ import (
var _ sdk.Msg = &MsgUpdateParams{} var _ sdk.Msg = &MsgUpdateParams{}
//
// [UpdateParams]
//
// NewMsgUpdateParams creates new instance of MsgUpdateParams // NewMsgUpdateParams creates new instance of MsgUpdateParams
func NewMsgUpdateParams( func NewMsgUpdateParams(
sender sdk.Address, sender sdk.Address,
@ -44,33 +48,72 @@ func (msg *MsgUpdateParams) Validate() error {
return msg.Params.Validate() return msg.Params.Validate()
} }
// NewMsgInitializeController creates a new instance of MsgInitializeController //
func NewMsgInitializeController( // [RegisterController]
//
// NewMsgRegisterController creates a new instance of MsgRegisterController
func NewMsgRegisterController(
sender sdk.Address, sender sdk.Address,
) (*MsgInitializeController, error) { ) (*MsgRegisterController, error) {
return &MsgInitializeController{ return &MsgRegisterController{
Authority: sender.String(), Authority: sender.String(),
}, nil }, nil
} }
// Route returns the name of the module // Route returns the name of the module
func (msg MsgInitializeController) Route() string { return ModuleName } func (msg MsgRegisterController) Route() string { return ModuleName }
// Type returns the the action // Type returns the the action
func (msg MsgInitializeController) Type() string { return "initialize_controller" } func (msg MsgRegisterController) Type() string { return "initialize_controller" }
// GetSignBytes implements the LegacyMsg interface. // GetSignBytes implements the LegacyMsg interface.
func (msg MsgInitializeController) GetSignBytes() []byte { func (msg MsgRegisterController) GetSignBytes() []byte {
return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg)) return sdk.MustSortJSON(AminoCdc.MustMarshalJSON(&msg))
} }
// GetSigners returns the expected signers for a MsgUpdateParams message. // GetSigners returns the expected signers for a MsgUpdateParams message.
func (msg *MsgInitializeController) GetSigners() []sdk.AccAddress { func (msg *MsgRegisterController) GetSigners() []sdk.AccAddress {
addr, _ := sdk.AccAddressFromBech32(msg.Authority) addr, _ := sdk.AccAddressFromBech32(msg.Authority)
return []sdk.AccAddress{addr} return []sdk.AccAddress{addr}
} }
// ValidateBasic does a sanity check on the provided data. // ValidateBasic does a sanity check on the provided data.
func (msg *MsgInitializeController) Validate() error { func (msg *MsgRegisterController) Validate() error {
return nil
}
//
// [RegisterService]
//
// NewMsgRegisterController creates a new instance of MsgRegisterController
func NewMsgRegisterService(
sender sdk.Address,
) (*MsgRegisterService, error) {
return &MsgRegisterService{
Authority: 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 "initialize_controller" }
// 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.Authority)
return []sdk.AccAddress{addr}
}
// ValidateBasic does a sanity check on the provided data.
func (msg *MsgRegisterService) Validate() error {
return nil return nil
} }

53
x/did/types/perms.go Normal file
View File

@ -0,0 +1,53 @@
package types
import "gopkg.in/macaroon-bakery.v2/bakery/checkers"
var (
PermissionScopeStrings = [...]string{
"profile.name",
"identifiers.email",
"identifiers.phone",
"transactions.read",
"transactions.write",
"wallets.read",
"wallets.create",
"wallets.subscribe",
"wallets.update",
"transactions.verify",
"transactions.broadcast",
"admin.user",
"admin.validator",
}
StringToPermissionScope = map[string]PermissionScope{
"PERMISSION_SCOPE_UNSPECIFIED": PermissionScope_PERMISSION_SCOPE_UNSPECIFIED,
"PERMISSION_SCOPE_PROFILE_NAME": PermissionScope_PERMISSION_SCOPE_PROFILE_NAME,
"PERMISSION_SCOPE_IDENTIFIERS_EMAIL": PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_EMAIL,
"PERMISSION_SCOPE_IDENTIFIERS_PHONE": PermissionScope_PERMISSION_SCOPE_IDENTIFIERS_PHONE,
"PERMISSION_SCOPE_TRANSACTIONS_READ": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_READ,
"PERMISSION_SCOPE_TRANSACTIONS_WRITE": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_WRITE,
"PERMISSION_SCOPE_WALLETS_READ": PermissionScope_PERMISSION_SCOPE_WALLETS_READ,
"PERMISSION_SCOPE_WALLETS_CREATE": PermissionScope_PERMISSION_SCOPE_WALLETS_CREATE,
"PERMISSION_SCOPE_WALLETS_SUBSCRIBE": PermissionScope_PERMISSION_SCOPE_WALLETS_SUBSCRIBE,
"PERMISSION_SCOPE_WALLETS_UPDATE": PermissionScope_PERMISSION_SCOPE_WALLETS_UPDATE,
"PERMISSION_SCOPE_TRANSACTIONS_VERIFY": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_VERIFY,
"PERMISSION_SCOPE_TRANSACTIONS_BROADCAST": PermissionScope_PERMISSION_SCOPE_TRANSACTIONS_BROADCAST,
"PERMISSION_SCOPE_ADMIN_USER": PermissionScope_PERMISSION_SCOPE_ADMIN_USER,
"PERMISSION_SCOPE_ADMIN_VALIDATOR": PermissionScope_PERMISSION_SCOPE_ADMIN_VALIDATOR,
}
)
func ResolvePermissionScope(scope string) (PermissionScope, bool) {
uriToPrefix := make(map[string]string)
for _, scope := range PermissionScopeStrings {
uriToPrefix["https://example.com/auth/"+scope] = scope
}
PermissionNamespace := checkers.NewNamespace(uriToPrefix)
prefix, ok := PermissionNamespace.Resolve("https://example.com/auth/" + scope)
if !ok {
return 0, false
}
permScope, ok := StringToPermissionScope[prefix]
return permScope, ok
}

File diff suppressed because it is too large Load Diff

View File

@ -51,7 +51,191 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal
} }
func request_Query_ResolveIdentifier_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_Query_Accounts_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryAccountsRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["did"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did")
}
protoReq.Did, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err)
}
msg, err := client.Accounts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_Accounts_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryAccountsRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["did"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did")
}
protoReq.Did, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err)
}
msg, err := server.Accounts(ctx, &protoReq)
return msg, metadata, err
}
func request_Query_Credentials_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryCredentialsRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["did"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did")
}
protoReq.Did, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err)
}
val, ok = pathParams["origin"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin")
}
protoReq.Origin, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err)
}
msg, err := client.Credentials(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_Credentials_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryCredentialsRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["did"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did")
}
protoReq.Did, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err)
}
val, ok = pathParams["origin"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin")
}
protoReq.Origin, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err)
}
msg, err := server.Credentials(ctx, &protoReq)
return msg, metadata, err
}
func request_Query_Identities_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryIdentitiesRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["did"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did")
}
protoReq.Did, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err)
}
msg, err := client.Identities(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Query_Identities_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryIdentitiesRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["did"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did")
}
protoReq.Did, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err)
}
msg, err := server.Identities(ctx, &protoReq)
return msg, metadata, err
}
func request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryResolveRequest var protoReq QueryResolveRequest
var metadata runtime.ServerMetadata var metadata runtime.ServerMetadata
@ -62,23 +246,23 @@ func request_Query_ResolveIdentifier_0(ctx context.Context, marshaler runtime.Ma
_ = err _ = err
) )
val, ok = pathParams["id"] val, ok = pathParams["did"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did")
} }
protoReq.Id, err = runtime.String(val) protoReq.Did, err = runtime.String(val)
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err)
} }
msg, err := client.ResolveIdentifier(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.Resolve(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
func local_request_Query_ResolveIdentifier_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func local_request_Query_Resolve_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryResolveRequest var protoReq QueryResolveRequest
var metadata runtime.ServerMetadata var metadata runtime.ServerMetadata
@ -89,24 +273,24 @@ func local_request_Query_ResolveIdentifier_0(ctx context.Context, marshaler runt
_ = err _ = err
) )
val, ok = pathParams["id"] val, ok = pathParams["did"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "did")
} }
protoReq.Id, err = runtime.String(val) protoReq.Did, err = runtime.String(val)
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "did", err)
} }
msg, err := server.ResolveIdentifier(ctx, &protoReq) msg, err := server.Resolve(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
func request_Query_WitnessCredential_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryWitnessCredentialRequest var protoReq QueryServiceRequest
var metadata runtime.ServerMetadata var metadata runtime.ServerMetadata
var ( var (
@ -116,24 +300,24 @@ func request_Query_WitnessCredential_0(ctx context.Context, marshaler runtime.Ma
_ = err _ = err
) )
val, ok = pathParams["id"] val, ok = pathParams["origin"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin")
} }
protoReq.Id, err = runtime.String(val) protoReq.Origin, err = runtime.String(val)
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err)
} }
msg, err := client.WitnessCredential(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) msg, err := client.Service(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err return msg, metadata, err
} }
func local_request_Query_WitnessCredential_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { func local_request_Query_Service_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq QueryWitnessCredentialRequest var protoReq QueryServiceRequest
var metadata runtime.ServerMetadata var metadata runtime.ServerMetadata
var ( var (
@ -143,18 +327,18 @@ func local_request_Query_WitnessCredential_0(ctx context.Context, marshaler runt
_ = err _ = err
) )
val, ok = pathParams["id"] val, ok = pathParams["origin"]
if !ok { if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "origin")
} }
protoReq.Id, err = runtime.String(val) protoReq.Origin, err = runtime.String(val)
if err != nil { if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "origin", err)
} }
msg, err := server.WitnessCredential(ctx, &protoReq) msg, err := server.Service(ctx, &protoReq)
return msg, metadata, err return msg, metadata, err
} }
@ -188,7 +372,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
}) })
mux.Handle("GET", pattern_Query_ResolveIdentifier_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_Query_Accounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream var stream runtime.ServerTransportStream
@ -199,7 +383,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
resp, md, err := local_request_Query_ResolveIdentifier_0(rctx, inboundMarshaler, server, req, pathParams) resp, md, err := local_request_Query_Accounts_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
@ -207,11 +391,11 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return return
} }
forward_Query_ResolveIdentifier_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_Query_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
mux.Handle("GET", pattern_Query_WitnessCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_Query_Credentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
var stream runtime.ServerTransportStream var stream runtime.ServerTransportStream
@ -222,7 +406,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
resp, md, err := local_request_Query_WitnessCredential_0(rctx, inboundMarshaler, server, req, pathParams) resp, md, err := local_request_Query_Credentials_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
@ -230,7 +414,76 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv
return return
} }
forward_Query_WitnessCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_Query_Credentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_Identities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_Identities_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_Identities_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_Resolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_Resolve_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_Resolve_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_Service_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Query_Service_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
@ -295,7 +548,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
}) })
mux.Handle("GET", pattern_Query_ResolveIdentifier_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_Query_Accounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@ -304,18 +557,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
resp, md, err := request_Query_ResolveIdentifier_0(rctx, inboundMarshaler, client, req, pathParams) resp, md, err := request_Query_Accounts_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
forward_Query_ResolveIdentifier_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_Query_Accounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
mux.Handle("GET", pattern_Query_WitnessCredential_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { mux.Handle("GET", pattern_Query_Credentials_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context()) ctx, cancel := context.WithCancel(req.Context())
defer cancel() defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
@ -324,14 +577,74 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
resp, md, err := request_Query_WitnessCredential_0(rctx, inboundMarshaler, client, req, pathParams) resp, md, err := request_Query_Credentials_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md) ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil { if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return return
} }
forward_Query_WitnessCredential_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) forward_Query_Credentials_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_Identities_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_Identities_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_Identities_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_Resolve_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_Resolve_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_Resolve_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_Query_Service_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Query_Service_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_Query_Service_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
}) })
@ -341,15 +654,27 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie
var ( var (
pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"did", "params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"did", "params"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_ResolveIdentifier_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"did", "resolve", "id"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Accounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 2, 1}, []string{"did", "accounts"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_WitnessCredential_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3}, []string{"did", "assertion", "id", "witness"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Credentials_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"did", "origin", "credentials"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_Identities_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 0, 2, 1}, []string{"did", "identities"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_Resolve_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 0}, []string{"did", "resolve"}, "", runtime.AssumeColonVerbOpt(false)))
pattern_Query_Service_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"did", "service", "origin"}, "", runtime.AssumeColonVerbOpt(false)))
) )
var ( var (
forward_Query_Params_0 = runtime.ForwardResponseMessage forward_Query_Params_0 = runtime.ForwardResponseMessage
forward_Query_ResolveIdentifier_0 = runtime.ForwardResponseMessage forward_Query_Accounts_0 = runtime.ForwardResponseMessage
forward_Query_WitnessCredential_0 = runtime.ForwardResponseMessage forward_Query_Credentials_0 = runtime.ForwardResponseMessage
forward_Query_Identities_0 = runtime.ForwardResponseMessage
forward_Query_Resolve_0 = runtime.ForwardResponseMessage
forward_Query_Service_0 = runtime.ForwardResponseMessage
) )

View File

@ -29,8 +29,8 @@ type Aliases struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// Origin is the Alias provider // Origin is the Alias provider
Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"` Origin string `protobuf:"bytes,2,opt,name=origin,proto3" json:"origin,omitempty"`
// Handle is the user defined alias // Subject is the user defined alias
Handle string `protobuf:"bytes,3,opt,name=handle,proto3" json:"handle,omitempty"` Subject string `protobuf:"bytes,3,opt,name=subject,proto3" json:"subject,omitempty"`
// Controller of the alias // Controller of the alias
Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"` Controller string `protobuf:"bytes,4,opt,name=controller,proto3" json:"controller,omitempty"`
// Expiration of the alias // Expiration of the alias
@ -84,9 +84,9 @@ func (m *Aliases) GetOrigin() string {
return "" return ""
} }
func (m *Aliases) GetHandle() string { func (m *Aliases) GetSubject() string {
if m != nil { if m != nil {
return m.Handle return m.Subject
} }
return "" return ""
} }
@ -466,10 +466,14 @@ type Service struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// The type of the service // The type of the service
ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"` ServiceType string `protobuf:"bytes,2,opt,name=service_type,json=serviceType,proto3" json:"service_type,omitempty"`
// The service endpoint
ServiceEndpoint string `protobuf:"bytes,3,opt,name=service_endpoint,json=serviceEndpoint,proto3" json:"service_endpoint,omitempty"`
// The controller DID of the service // The controller DID of the service
ControllerDid string `protobuf:"bytes,4,opt,name=controller_did,json=controllerDid,proto3" json:"controller_did,omitempty"` ControllerDid string `protobuf:"bytes,3,opt,name=controller_did,json=controllerDid,proto3" json:"controller_did,omitempty"`
// The domain name of the service
OriginUri string `protobuf:"bytes,4,opt,name=origin_uri,json=originUri,proto3" json:"origin_uri,omitempty"`
// The service endpoint
ServiceEndpoints map[string]string `protobuf:"bytes,5,rep,name=service_endpoints,json=serviceEndpoints,proto3" json:"service_endpoints,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// Scopes is the Authorization Grants of the service
Scopes []PermissionScope `protobuf:"varint,6,rep,packed,name=scopes,proto3,enum=did.v1.PermissionScope" json:"scopes,omitempty"`
} }
func (m *Service) Reset() { *m = Service{} } func (m *Service) Reset() { *m = Service{} }
@ -519,13 +523,6 @@ func (m *Service) GetServiceType() string {
return "" return ""
} }
func (m *Service) GetServiceEndpoint() string {
if m != nil {
return m.ServiceEndpoint
}
return ""
}
func (m *Service) GetControllerDid() string { func (m *Service) GetControllerDid() string {
if m != nil { if m != nil {
return m.ControllerDid return m.ControllerDid
@ -533,6 +530,27 @@ func (m *Service) GetControllerDid() string {
return "" return ""
} }
func (m *Service) GetOriginUri() string {
if m != nil {
return m.OriginUri
}
return ""
}
func (m *Service) GetServiceEndpoints() map[string]string {
if m != nil {
return m.ServiceEndpoints
}
return nil
}
func (m *Service) GetScopes() []PermissionScope {
if m != nil {
return m.Scopes
}
return nil
}
func init() { func init() {
proto.RegisterType((*Aliases)(nil), "did.v1.Aliases") proto.RegisterType((*Aliases)(nil), "did.v1.Aliases")
proto.RegisterType((*Assertion)(nil), "did.v1.Assertion") proto.RegisterType((*Assertion)(nil), "did.v1.Assertion")
@ -542,55 +560,61 @@ func init() {
proto.RegisterType((*Delegation)(nil), "did.v1.Delegation") proto.RegisterType((*Delegation)(nil), "did.v1.Delegation")
proto.RegisterMapType((map[string]string)(nil), "did.v1.Delegation.PublicKeyJwksEntry") proto.RegisterMapType((map[string]string)(nil), "did.v1.Delegation.PublicKeyJwksEntry")
proto.RegisterType((*Service)(nil), "did.v1.Service") proto.RegisterType((*Service)(nil), "did.v1.Service")
proto.RegisterMapType((map[string]string)(nil), "did.v1.Service.ServiceEndpointsEntry")
} }
func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) } func init() { proto.RegisterFile("did/v1/state.proto", fileDescriptor_f44bb702879c34b4) }
var fileDescriptor_f44bb702879c34b4 = []byte{ var fileDescriptor_f44bb702879c34b4 = []byte{
// 685 bytes of a gzipped FileDescriptorProto // 760 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x94, 0x3f, 0x6f, 0x13, 0x4d, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x95, 0xbd, 0x6e, 0x2b, 0x45,
0x10, 0xc6, 0x73, 0x3e, 0xff, 0x1d, 0xdb, 0x89, 0xb5, 0x8a, 0xf2, 0xde, 0x6b, 0xc0, 0x18, 0xa3, 0x14, 0xc7, 0xb3, 0x5e, 0x7f, 0x1e, 0x7f, 0x60, 0x46, 0x81, 0x2c, 0x46, 0x31, 0xc6, 0xe8, 0x4a,
0x48, 0xa1, 0xb1, 0x09, 0x34, 0x28, 0xa1, 0xc0, 0x24, 0x29, 0x00, 0x45, 0x42, 0x86, 0x8a, 0xc6, 0xae, 0xbc, 0xdc, 0x4b, 0x83, 0x72, 0x29, 0x30, 0x49, 0x0a, 0x40, 0x91, 0x22, 0x07, 0x1a, 0x1a,
0x5a, 0x7b, 0x37, 0xf6, 0xe2, 0xf3, 0xee, 0x69, 0x77, 0xed, 0xe4, 0x3a, 0x7a, 0x24, 0x44, 0x41, 0x6b, 0xbd, 0x33, 0x71, 0x26, 0xde, 0x9d, 0x59, 0xcd, 0xcc, 0x3a, 0xd9, 0x8e, 0x1e, 0x09, 0x51,
0x9d, 0x96, 0x92, 0xaf, 0x41, 0x19, 0x89, 0x86, 0x12, 0x25, 0xdf, 0x80, 0x4f, 0x80, 0xf6, 0xf6, 0x50, 0xf3, 0x00, 0x34, 0xbc, 0x06, 0x65, 0x24, 0x1a, 0x0a, 0x0a, 0x94, 0xbc, 0x01, 0x4f, 0x80,
0x1c, 0x1f, 0x76, 0x00, 0x21, 0xba, 0xec, 0x33, 0x33, 0x99, 0xdf, 0x3c, 0x33, 0x3e, 0x40, 0x84, 0x76, 0x67, 0xd6, 0xde, 0xd8, 0x01, 0x84, 0x52, 0xd9, 0xf3, 0x3f, 0x67, 0xe6, 0xfc, 0xce, 0x7f,
0x91, 0xd6, 0x74, 0xbb, 0xa5, 0x34, 0xd6, 0xb4, 0x19, 0x48, 0xa1, 0x05, 0xca, 0x12, 0x46, 0x9a, 0x8e, 0x3d, 0x80, 0x30, 0xc5, 0xee, 0xea, 0xa5, 0x2b, 0x95, 0xa7, 0xc8, 0x38, 0x12, 0x5c, 0x71,
0xd3, 0xed, 0xea, 0x7f, 0x7d, 0xa1, 0xc6, 0x42, 0xb5, 0x84, 0x1c, 0x9b, 0x14, 0x21, 0xc7, 0x36, 0x54, 0xc5, 0x14, 0x8f, 0x57, 0x2f, 0x7b, 0x07, 0x3e, 0x97, 0x21, 0x97, 0x2e, 0x17, 0x61, 0x9a,
0xa1, 0xba, 0x1e, 0x17, 0x0d, 0x28, 0xa7, 0x8a, 0x29, 0xab, 0x36, 0x3e, 0x3a, 0x90, 0x6b, 0xfb, 0xc2, 0x45, 0xa8, 0x13, 0x7a, 0xfb, 0x66, 0xd3, 0x82, 0x30, 0x22, 0xa9, 0x34, 0x6a, 0x7e, 0x14,
0x0c, 0x2b, 0xaa, 0xd0, 0x2a, 0xa4, 0x18, 0xf1, 0x9c, 0xba, 0xb3, 0x55, 0xe8, 0xa4, 0x18, 0x41, 0x61, 0x71, 0x68, 0xb4, 0xe1, 0xcf, 0x16, 0xd4, 0x26, 0x01, 0xf5, 0x24, 0x91, 0xa8, 0x03, 0x25,
0x1b, 0x90, 0x15, 0x92, 0x0d, 0x18, 0xf7, 0x52, 0x91, 0x16, 0xbf, 0x8c, 0x3e, 0xc4, 0x9c, 0xf8, 0x8a, 0x1d, 0x6b, 0x60, 0x8d, 0x1a, 0xd3, 0x12, 0xc5, 0xe8, 0x6d, 0xa8, 0x72, 0x41, 0x17, 0x94,
0xd4, 0x73, 0xad, 0x6e, 0x5f, 0xa8, 0x06, 0xd0, 0x17, 0x5c, 0x4b, 0xe1, 0xfb, 0x54, 0x7a, 0xe9, 0x39, 0xa5, 0x4c, 0x33, 0x2b, 0xe4, 0x40, 0x4d, 0xc6, 0xf3, 0x6b, 0xe2, 0x2b, 0xc7, 0xce, 0x02,
0x28, 0x96, 0x50, 0x4c, 0x9c, 0x9e, 0x04, 0x4c, 0x62, 0xcd, 0x04, 0xf7, 0x32, 0x75, 0x67, 0x2b, 0xf9, 0x12, 0xf5, 0x01, 0x7c, 0xce, 0x94, 0xe0, 0x41, 0x40, 0x84, 0x53, 0xce, 0x82, 0x05, 0x25,
0xdd, 0x49, 0x28, 0x3b, 0xd7, 0xbf, 0x9f, 0x7e, 0x79, 0xe7, 0x6e, 0x40, 0xda, 0x70, 0xa0, 0xd2, 0x8d, 0x93, 0xdb, 0x88, 0x0a, 0x4f, 0x51, 0xce, 0x9c, 0xca, 0xc0, 0x1a, 0x95, 0xa7, 0x05, 0xe5,
0xac, 0x4b, 0xc5, 0xf1, 0x1c, 0xcf, 0x69, 0xbc, 0x49, 0x41, 0xa1, 0xad, 0x14, 0x95, 0x26, 0x77, 0xe8, 0xf0, 0xaf, 0x9f, 0x7e, 0xfb, 0xde, 0x3e, 0x80, 0x72, 0x4a, 0x82, 0xda, 0xeb, 0x3a, 0x5d,
0x89, 0xf5, 0x7f, 0xc8, 0x8f, 0x68, 0xd8, 0xd5, 0x61, 0x40, 0x63, 0xda, 0xdc, 0x88, 0x86, 0x2f, 0xcb, 0xb1, 0x1c, 0x6b, 0xf8, 0x6d, 0x09, 0x1a, 0x13, 0x29, 0x89, 0x48, 0x93, 0x77, 0x70, 0xdf,
0xc3, 0xc0, 0x62, 0x49, 0x4a, 0x28, 0xd7, 0x0c, 0xfb, 0x11, 0x72, 0xa9, 0x93, 0x50, 0xd0, 0x2e, 0x81, 0xfa, 0x92, 0x24, 0x33, 0x95, 0x44, 0xc4, 0x00, 0xd7, 0x96, 0x24, 0xf9, 0x2a, 0x89, 0x48,
0xe4, 0xc7, 0x54, 0x63, 0x82, 0x35, 0xf6, 0xd2, 0x75, 0x77, 0xab, 0x78, 0xef, 0x66, 0xd3, 0x9a, 0xc6, 0x25, 0x08, 0x26, 0x4c, 0x51, 0x2f, 0xc8, 0xa0, 0x5b, 0xd3, 0x82, 0x82, 0x5e, 0x43, 0x3d,
0xd9, 0xbc, 0xec, 0xd7, 0x3c, 0x8c, 0x33, 0x0e, 0xb8, 0x96, 0x61, 0xe7, 0xb2, 0x60, 0x61, 0xe6, 0x24, 0xca, 0xc3, 0x9e, 0xf2, 0x9c, 0xf2, 0xc0, 0x1e, 0x35, 0x5f, 0xbd, 0x37, 0xd6, 0x1e, 0x8f,
0xcc, 0xe2, 0xcc, 0xd5, 0x5d, 0x28, 0xff, 0x54, 0x8a, 0x2a, 0xe0, 0x8e, 0x68, 0x18, 0x93, 0x9b, 0xd7, 0xf5, 0xc6, 0x67, 0x26, 0xe3, 0x94, 0x29, 0x91, 0x4c, 0xd7, 0x1b, 0xb6, 0x9a, 0xae, 0x6c,
0x3f, 0xd1, 0x3a, 0x64, 0xa6, 0xd8, 0x9f, 0xcc, 0xb8, 0xed, 0x63, 0x27, 0xf5, 0xc0, 0xd9, 0x59, 0x37, 0xdd, 0x7b, 0x0d, 0xed, 0x47, 0x5b, 0x51, 0x17, 0xec, 0x25, 0x49, 0x0c, 0x79, 0xfa, 0x15,
0x8d, 0x0c, 0xc9, 0x5b, 0x43, 0xbc, 0x54, 0xe3, 0x83, 0x03, 0xc5, 0xb6, 0xd6, 0xd4, 0xec, 0xfd, 0xed, 0x43, 0x65, 0xe5, 0x05, 0x71, 0xce, 0xad, 0x17, 0x47, 0xa5, 0x8f, 0xad, 0xa3, 0x4e, 0xe6,
0x2f, 0x4d, 0xb8, 0x6c, 0xe2, 0x26, 0x9a, 0x18, 0x35, 0x90, 0x42, 0x1c, 0xc5, 0xcb, 0xb2, 0x8f, 0x48, 0x5d, 0x3b, 0xe2, 0x94, 0x86, 0x3f, 0x5a, 0xd0, 0x9c, 0x28, 0x45, 0xd2, 0x71, 0xf8, 0x9f,
0x3f, 0xcd, 0xb4, 0x80, 0xe5, 0x36, 0x3e, 0x39, 0x00, 0x7b, 0xf3, 0x35, 0x2f, 0x52, 0x55, 0xc0, 0x26, 0xac, 0x8b, 0xd8, 0x85, 0x22, 0xa9, 0x1a, 0x09, 0xce, 0x2f, 0xcd, 0x6d, 0xe9, 0xc5, 0x7f,
0x25, 0x06, 0xdf, 0x4e, 0x4c, 0x18, 0x41, 0x77, 0x61, 0x3d, 0x98, 0xf4, 0x7c, 0xd6, 0xef, 0x1a, 0xf5, 0xb4, 0x85, 0x65, 0x0f, 0x7f, 0xb1, 0x00, 0x8e, 0x37, 0xf7, 0xbc, 0x4d, 0xd5, 0x05, 0x1b,
0xdc, 0xf1, 0xc4, 0xd7, 0xac, 0x87, 0xd5, 0x8c, 0x0d, 0xd9, 0xd8, 0x33, 0x1a, 0x1e, 0xce, 0x22, 0xa7, 0xf8, 0xba, 0x63, 0x4c, 0x31, 0xfa, 0x10, 0xf6, 0xa3, 0x78, 0x1e, 0x50, 0x7f, 0x96, 0xe2,
0xe8, 0x1a, 0x14, 0xa6, 0x78, 0xe2, 0xeb, 0x6e, 0x9f, 0x91, 0x18, 0x36, 0x1f, 0x09, 0x7b, 0x8c, 0x86, 0x71, 0xa0, 0xe8, 0xdc, 0x93, 0x39, 0x1b, 0xd2, 0xb1, 0x2f, 0x49, 0x72, 0x96, 0x47, 0xd0,
0xa0, 0x3a, 0x14, 0x8f, 0x18, 0x1f, 0x50, 0x19, 0x48, 0xc6, 0x75, 0x04, 0x5c, 0xea, 0x24, 0xa5, 0xbb, 0xd0, 0x58, 0x79, 0x71, 0xa0, 0x66, 0x3e, 0xc5, 0x06, 0xb6, 0x9e, 0x09, 0xc7, 0x14, 0xa3,
0x05, 0xe2, 0x74, 0xe3, 0xad, 0x0b, 0xb0, 0x4f, 0x7d, 0x3a, 0xb8, 0xda, 0xc7, 0x65, 0xe2, 0x1b, 0x01, 0x34, 0x2f, 0x29, 0x5b, 0x10, 0x11, 0x09, 0xca, 0x54, 0x06, 0xdc, 0x9a, 0x16, 0xa5, 0x2d,
0x00, 0xfd, 0x21, 0x66, 0xdc, 0x7a, 0x6b, 0x39, 0x0b, 0x91, 0x12, 0xb9, 0x7b, 0x1b, 0xca, 0x36, 0xe2, 0xf2, 0xf0, 0x3b, 0x1b, 0xe0, 0x84, 0x04, 0x64, 0xf1, 0xb4, 0x8f, 0xbb, 0xc4, 0x87, 0x00,
0x8c, 0x09, 0x91, 0x54, 0xa9, 0x18, 0xb1, 0x14, 0x89, 0x6d, 0xab, 0xa1, 0x4d, 0x58, 0x9d, 0x9b, 0xfe, 0x95, 0x47, 0x99, 0xf6, 0x56, 0x73, 0x36, 0x32, 0x25, 0x73, 0xf7, 0x03, 0x68, 0xeb, 0xb0,
0xd8, 0x35, 0x0d, 0xac, 0xb5, 0xe5, 0xb9, 0xba, 0xff, 0x1b, 0x73, 0xb2, 0xbf, 0x34, 0xe7, 0x10, 0x87, 0xb1, 0x20, 0x52, 0x1a, 0xc4, 0x56, 0x26, 0x4e, 0xb4, 0x86, 0x5e, 0x40, 0x67, 0x63, 0xe2,
0xd6, 0x12, 0x15, 0xaf, 0x8f, 0x47, 0xca, 0xcb, 0x45, 0x77, 0xbc, 0x39, 0xbb, 0xe3, 0xf9, 0xac, 0x2c, 0x2d, 0xa0, 0xad, 0x6d, 0x6f, 0xd4, 0x93, 0x7f, 0x31, 0xa7, 0xfa, 0x8f, 0xe6, 0x9c, 0xc1,
0xcd, 0xe7, 0xb3, 0xfa, 0xa7, 0xc7, 0x23, 0x65, 0xaf, 0xb9, 0x1c, 0x24, 0xb5, 0x78, 0x56, 0xce, 0x1b, 0x85, 0x1d, 0xd7, 0x37, 0x4b, 0xe9, 0xd4, 0xb2, 0x39, 0x7e, 0x91, 0xcf, 0xf1, 0xa6, 0xd7,
0xa9, 0xdf, 0x65, 0xc4, 0xcb, 0x47, 0x3f, 0xd3, 0x42, 0xac, 0x3c, 0x21, 0xd5, 0x47, 0x80, 0x96, 0xf1, 0x79, 0xbe, 0xff, 0x8b, 0x9b, 0xa5, 0xd4, 0xd3, 0xdc, 0x8e, 0x8a, 0x9a, 0xe9, 0x95, 0x31,
0xff, 0xc7, 0x3f, 0x9c, 0x75, 0xa6, 0x71, 0xea, 0x40, 0xee, 0x05, 0x95, 0x53, 0xd6, 0xa7, 0x4b, 0x12, 0xcc, 0x28, 0x76, 0xea, 0xd9, 0xef, 0xb4, 0x61, 0x94, 0xcf, 0x71, 0xef, 0x53, 0x40, 0xbb,
0xab, 0xb8, 0x05, 0x25, 0x65, 0x43, 0xc9, 0xb3, 0x2e, 0xc6, 0x5a, 0x64, 0xfe, 0x1d, 0xa8, 0xcc, 0x67, 0x3c, 0x63, 0xac, 0x2b, 0xc3, 0x3f, 0x4a, 0x50, 0xbb, 0x20, 0x62, 0x45, 0x7d, 0xb2, 0x73,
0x52, 0x28, 0x27, 0x81, 0x30, 0x37, 0x60, 0x37, 0xb4, 0x16, 0xeb, 0x07, 0xb1, 0x7c, 0xc5, 0x0a, 0x15, 0xef, 0x43, 0x4b, 0xea, 0x50, 0x71, 0xac, 0x9b, 0x46, 0xcb, 0xcc, 0xdf, 0xf5, 0xd5, 0x7e,
0xd2, 0x57, 0xac, 0x60, 0x01, 0x30, 0xfb, 0xf8, 0xe1, 0xe7, 0xf3, 0x9a, 0x73, 0x76, 0x5e, 0x73, 0xca, 0xd7, 0x43, 0x00, 0xfd, 0x17, 0x36, 0x8b, 0x05, 0x35, 0x17, 0xd4, 0xd0, 0xca, 0xd7, 0x82,
0xbe, 0x9d, 0xd7, 0x9c, 0xf7, 0x17, 0xb5, 0x95, 0xb3, 0x8b, 0xda, 0xca, 0xd7, 0x8b, 0xda, 0xca, 0xa2, 0x29, 0xbc, 0x99, 0x17, 0x22, 0x0c, 0x47, 0x9c, 0x32, 0x25, 0x9d, 0xca, 0x63, 0x1b, 0x0d,
0xab, 0xc6, 0x80, 0xe9, 0xe1, 0xa4, 0xd7, 0xec, 0x8b, 0x71, 0x4b, 0x70, 0x25, 0xb8, 0x6c, 0x0d, 0x64, 0xfe, 0x79, 0x9a, 0xe7, 0x69, 0x1b, 0xbb, 0x72, 0x4b, 0x46, 0x2e, 0x54, 0xa5, 0xcf, 0x23,
0x8f, 0x71, 0xd8, 0x3a, 0x69, 0x99, 0xaf, 0xad, 0x21, 0x56, 0xbd, 0x6c, 0xf4, 0xa5, 0xbd, 0xff, 0x22, 0x9d, 0xea, 0xc0, 0x1e, 0x75, 0x5e, 0x1d, 0xe4, 0x07, 0x9d, 0x13, 0x11, 0x52, 0x29, 0x29,
0x23, 0x00, 0x00, 0xff, 0xff, 0x12, 0x6f, 0x94, 0xba, 0xb6, 0x05, 0x00, 0x00, 0x67, 0x17, 0x69, 0x7c, 0x6a, 0xd2, 0x7a, 0xc7, 0xf0, 0xd6, 0x93, 0x67, 0x3f, 0xc3, 0xde, 0xea,
0x67, 0x9f, 0xfc, 0x7a, 0xdf, 0xb7, 0xee, 0xee, 0xfb, 0xd6, 0x9f, 0xf7, 0x7d, 0xeb, 0x87, 0x87,
0xfe, 0xde, 0xdd, 0x43, 0x7f, 0xef, 0xf7, 0x87, 0xfe, 0xde, 0x37, 0xc3, 0x05, 0x55, 0x57, 0xf1,
0x7c, 0xec, 0xf3, 0xd0, 0xe5, 0x4c, 0x72, 0x26, 0xdc, 0xab, 0x1b, 0x2f, 0x71, 0x6f, 0xdd, 0xf4,
0xb1, 0x48, 0xfd, 0x96, 0xf3, 0x6a, 0xf6, 0x54, 0x7c, 0xf4, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff,
0x54, 0xb1, 0xb7, 0x51, 0x8b, 0x06, 0x00, 0x00,
} }
func (m *Aliases) Marshal() (dAtA []byte, err error) { func (m *Aliases) Marshal() (dAtA []byte, err error) {
@ -625,10 +649,10 @@ func (m *Aliases) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i-- i--
dAtA[i] = 0x22 dAtA[i] = 0x22
} }
if len(m.Handle) > 0 { if len(m.Subject) > 0 {
i -= len(m.Handle) i -= len(m.Subject)
copy(dAtA[i:], m.Handle) copy(dAtA[i:], m.Subject)
i = encodeVarintState(dAtA, i, uint64(len(m.Handle))) i = encodeVarintState(dAtA, i, uint64(len(m.Subject)))
i-- i--
dAtA[i] = 0x1a dAtA[i] = 0x1a
} }
@ -944,18 +968,55 @@ func (m *Service) MarshalToSizedBuffer(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Scopes) > 0 {
dAtA2 := make([]byte, len(m.Scopes)*10)
var j1 int
for _, num := range m.Scopes {
for num >= 1<<7 {
dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80)
num >>= 7
j1++
}
dAtA2[j1] = uint8(num)
j1++
}
i -= j1
copy(dAtA[i:], dAtA2[:j1])
i = encodeVarintState(dAtA, i, uint64(j1))
i--
dAtA[i] = 0x32
}
if len(m.ServiceEndpoints) > 0 {
for k := range m.ServiceEndpoints {
v := m.ServiceEndpoints[k]
baseI := i
i -= len(v)
copy(dAtA[i:], v)
i = encodeVarintState(dAtA, i, uint64(len(v)))
i--
dAtA[i] = 0x12
i -= len(k)
copy(dAtA[i:], k)
i = encodeVarintState(dAtA, i, uint64(len(k)))
i--
dAtA[i] = 0xa
i = encodeVarintState(dAtA, i, uint64(baseI-i))
i--
dAtA[i] = 0x2a
}
}
if len(m.OriginUri) > 0 {
i -= len(m.OriginUri)
copy(dAtA[i:], m.OriginUri)
i = encodeVarintState(dAtA, i, uint64(len(m.OriginUri)))
i--
dAtA[i] = 0x22
}
if len(m.ControllerDid) > 0 { if len(m.ControllerDid) > 0 {
i -= len(m.ControllerDid) i -= len(m.ControllerDid)
copy(dAtA[i:], m.ControllerDid) copy(dAtA[i:], m.ControllerDid)
i = encodeVarintState(dAtA, i, uint64(len(m.ControllerDid))) i = encodeVarintState(dAtA, i, uint64(len(m.ControllerDid)))
i-- i--
dAtA[i] = 0x22
}
if len(m.ServiceEndpoint) > 0 {
i -= len(m.ServiceEndpoint)
copy(dAtA[i:], m.ServiceEndpoint)
i = encodeVarintState(dAtA, i, uint64(len(m.ServiceEndpoint)))
i--
dAtA[i] = 0x1a dAtA[i] = 0x1a
} }
if len(m.ServiceType) > 0 { if len(m.ServiceType) > 0 {
@ -1000,7 +1061,7 @@ func (m *Aliases) Size() (n int) {
if l > 0 { if l > 0 {
n += 1 + l + sovState(uint64(l)) n += 1 + l + sovState(uint64(l))
} }
l = len(m.Handle) l = len(m.Subject)
if l > 0 { if l > 0 {
n += 1 + l + sovState(uint64(l)) n += 1 + l + sovState(uint64(l))
} }
@ -1163,14 +1224,29 @@ func (m *Service) Size() (n int) {
if l > 0 { if l > 0 {
n += 1 + l + sovState(uint64(l)) n += 1 + l + sovState(uint64(l))
} }
l = len(m.ServiceEndpoint)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
l = len(m.ControllerDid) l = len(m.ControllerDid)
if l > 0 { if l > 0 {
n += 1 + l + sovState(uint64(l)) n += 1 + l + sovState(uint64(l))
} }
l = len(m.OriginUri)
if l > 0 {
n += 1 + l + sovState(uint64(l))
}
if len(m.ServiceEndpoints) > 0 {
for k, v := range m.ServiceEndpoints {
_ = k
_ = v
mapEntrySize := 1 + len(k) + sovState(uint64(len(k))) + 1 + len(v) + sovState(uint64(len(v)))
n += mapEntrySize + 1 + sovState(uint64(mapEntrySize))
}
}
if len(m.Scopes) > 0 {
l = 0
for _, e := range m.Scopes {
l += sovState(uint64(e))
}
n += 1 + sovState(uint64(l)) + l
}
return n return n
} }
@ -1275,7 +1351,7 @@ func (m *Aliases) Unmarshal(dAtA []byte) error {
iNdEx = postIndex iNdEx = postIndex
case 3: case 3:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Handle", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType)
} }
var stringLen uint64 var stringLen uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
@ -1303,7 +1379,7 @@ func (m *Aliases) Unmarshal(dAtA []byte) error {
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
m.Handle = string(dAtA[iNdEx:postIndex]) m.Subject = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 4: case 4:
if wireType != 2 { if wireType != 2 {
@ -2588,38 +2664,6 @@ func (m *Service) Unmarshal(dAtA []byte) error {
m.ServiceType = string(dAtA[iNdEx:postIndex]) m.ServiceType = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 3: case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ServiceEndpoint", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ServiceEndpoint = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ControllerDid", wireType) return fmt.Errorf("proto: wrong wireType = %d for field ControllerDid", wireType)
} }
@ -2651,6 +2695,234 @@ func (m *Service) Unmarshal(dAtA []byte) error {
} }
m.ControllerDid = string(dAtA[iNdEx:postIndex]) m.ControllerDid = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field OriginUri", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
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 ErrInvalidLengthState
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.OriginUri = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ServiceEndpoints", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthState
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.ServiceEndpoints == nil {
m.ServiceEndpoints = make(map[string]string)
}
var mapkey string
var mapvalue string
for iNdEx < postIndex {
entryPreIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
if fieldNum == 1 {
var stringLenmapkey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapkey |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapkey := int(stringLenmapkey)
if intStringLenmapkey < 0 {
return ErrInvalidLengthState
}
postStringIndexmapkey := iNdEx + intStringLenmapkey
if postStringIndexmapkey < 0 {
return ErrInvalidLengthState
}
if postStringIndexmapkey > l {
return io.ErrUnexpectedEOF
}
mapkey = string(dAtA[iNdEx:postStringIndexmapkey])
iNdEx = postStringIndexmapkey
} else if fieldNum == 2 {
var stringLenmapvalue uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapvalue |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapvalue := int(stringLenmapvalue)
if intStringLenmapvalue < 0 {
return ErrInvalidLengthState
}
postStringIndexmapvalue := iNdEx + intStringLenmapvalue
if postStringIndexmapvalue < 0 {
return ErrInvalidLengthState
}
if postStringIndexmapvalue > l {
return io.ErrUnexpectedEOF
}
mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue])
iNdEx = postStringIndexmapvalue
} else {
iNdEx = entryPreIndex
skippy, err := skipState(dAtA[iNdEx:])
if err != nil {
return err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthState
}
if (iNdEx + skippy) > postIndex {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
m.ServiceEndpoints[mapkey] = mapvalue
iNdEx = postIndex
case 6:
if wireType == 0 {
var v PermissionScope
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= PermissionScope(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Scopes = append(m.Scopes, v)
} else if wireType == 2 {
var packedLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
packedLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if packedLen < 0 {
return ErrInvalidLengthState
}
postIndex := iNdEx + packedLen
if postIndex < 0 {
return ErrInvalidLengthState
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
var elementCount int
if elementCount != 0 && len(m.Scopes) == 0 {
m.Scopes = make([]PermissionScope, 0, elementCount)
}
for iNdEx < postIndex {
var v PermissionScope
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowState
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= PermissionScope(b&0x7F) << shift
if b < 0x80 {
break
}
}
m.Scopes = append(m.Scopes, v)
}
} else {
return fmt.Errorf("proto: wrong wireType = %d for field Scopes", wireType)
}
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipState(dAtA[iNdEx:]) skippy, err := skipState(dAtA[iNdEx:])

File diff suppressed because it is too large Load Diff

15
x/did/types/types.go Normal file
View File

@ -0,0 +1,15 @@
package types
func (a *AssetInfo) Equal(b *AssetInfo) bool {
if a == nil && b == nil {
return true
}
return false
}
func (c *ChainInfo) Equal(b *ChainInfo) bool {
if c == nil && b == nil {
return true
}
return false
}

File diff suppressed because it is too large Load Diff