Feature/update dockerfile (#6)

* chore: remove unused new.Dockerfile

* feat: add DID model definitions

* fix: Fix EncodePublicKey method in KeyInfo struct

* feat: Update `EncodePublicKey` to be the inverse of `DecodePublicKey`

* refactor: update AssetInfo protobuf definition

* fix: update default assets with correct asset types

* fix: Initialize IPFS client and check for mounted directories

* feat: Improve IPFS client initialization and mount checking

* feat: Add local filesystem check for IPFS and IPNS

* fix: Use Unixfs().Get() instead of Cat() for IPFS and IPNS content retrieval

* feat: Update GetCID and GetIPNS functions to read data from IPFS node

* fix: Ensure IPFS client is initialized before pinning CID

* feat: Add AddFile and AddFolder methods

* feat: add IPFS file system abstraction

* feat: Implement IPFS file, location, and filesystem abstractions

* refactor: remove unused functions and types

* refactor: remove unused FileSystem interface

* feat: add initial wasm entrypoint

* feat: add basic vault command operations

* docs: add vault module features

* test: remove test for MsgUpdateParams

* refactor: Replace PrimaryKey with Property struct in zkprop.go

* feat: Update the `CreateWitness` and `CreateAccumulator` and `VerifyWitness` and `UpdateAccumulator` to Use the new `Accumulator` and `Witness` types. Then Clean up the code in the file and refactor the marshalling methods

* <no value>

* feat: add KeyCurve and KeyType to KeyInfo in genesis

* feat: add WASM build step to devbox.json

* feat: Add zkgate.go file

* feat: Uncomment and modify zkgate code to work with Property struct

* feat: Merge zkgate.go and zkprop.go logic

* feat: implement API endpoints for profile management

* refactor: remove unused template file

* feat(orm): remove unused ORM models

* feat: add persistent SQLite database support in WASM

* fix: Update module names in protobuf files

* feat: Add method to initialize SQLite database

* fix: update go-sqlite3 dependency to version 1.14.23

* feat: introduce database layer

* feat: Implement database layer for Vault node

* feature/update-dockerfile

* feat: Add keyshares table

* fix: Reorder the SQL statements in the tables.go file

* feat: Update the `createCredentialsTable` method to match the proper Credential struct

* feat: Update createProfilesTable and add createPropertiesTable

* feat: Add constant SQL queries to queries.go and use prepared statements in db.go

* feat: Add createKeysharesTable to internal/db/db.go

* feat: Update `createPermissionsTable` to match Permissions struct

* feat: Add database enum types

* feat: Add DIDNamespace and PermissionScope enums

* feat: Add DBConfig and DBOption types

* feat: Update the db implementation to use the provided go library

* fix: update db implementation to use go-sqlite3 v0.18.2

* fix: Refactor database connection and statement handling

* feat: Simplify db.go implementation

* feat: Convert constant SQL queries to functions in queries.go and update db.go to use prepared statements

* feat: Add models.go file with database table structs

* fix: Remove unused statement map and prepare statements

diff --git a/internal/db/db.go b/internal/db/db.go
index 201d09b..d4d4d4e 100644
--- a/internal/db/db.go
+++ b/internal/db/db.go
@@ -32,11 +32,6 @@ func Open(config *DBConfig) (*DB, error) {
 		Conn: conn,
 	}

-	if err := createTables(db); err != nil {
-		conn.Close()
-		return nil, fmt.Errorf("failed to create tables: %w", err)
-	}
-
 	return db, nil
 }

@@ -61,114 +56,3 @@ func createTables(db *DB) error {
 	return nil
 }

-// AddAccount adds a new account to the database
-func (db *DB) AddAccount(name, address string) error {
-	return db.Exec(insertAccountQuery(name, address))
-}
-
-// AddAsset adds a new asset to the database
-func (db *DB) AddAsset(name, symbol string, decimals int, chainID int64) error {
-	return db.Exec(insertAssetQuery(name, symbol, decimals, chainID))
-}
-
-// AddChain adds a new chain to the database
-func (db *DB) AddChain(name, networkID string) error {
-	return db.Exec(insertChainQuery(name, networkID))
-}
-
-// AddCredential adds a new credential to the database
-func (db *DB) AddCredential(
-	handle, controller, attestationType, origin string,
-	credentialID, publicKey []byte,
-	transport string,
-	signCount uint32,
-	userPresent, userVerified, backupEligible, backupState, cloneWarning bool,
-) error {
-	return db.Exec(insertCredentialQuery(
-		handle,
-		controller,
-		attestationType,
-		origin,
-		credentialID,
-		publicKey,
-		transport,
-		signCount,
-		userPresent,
-		userVerified,
-		backupEligible,
-		backupState,
-		cloneWarning,
-	))
-}
-
-// AddProfile adds a new profile to the database
-func (db *DB) AddProfile(
-	id, subject, controller, originURI, publicMetadata, privateMetadata string,
-) error {
-	return db.statements["insertProfile"].Exec(
-		id, subject, controller, originURI, publicMetadata, privateMetadata,
-	)
-}
-
-// AddProperty adds a new property to the database
-func (db *DB) AddProperty(
-	profileID, key, accumulator, propertyKey string,
-) error {
-	return db.statements["insertProperty"].Exec(
-		profileID, key, accumulator, propertyKey,
-	)
-}
-
-// AddPermission adds a new permission to the database
-func (db *DB) AddPermission(
-	serviceID string,
-	grants []DIDNamespace,
-	scopes []PermissionScope,
-) error {
-	grantsJSON, err := json.Marshal(grants)
-	if err != nil {
-		return fmt.Errorf("failed to marshal grants: %w", err)
-	}
-
-	scopesJSON, err := json.Marshal(scopes)
-	if err != nil {
-		return fmt.Errorf("failed to marshal scopes: %w", err)
-	}
-
-	return db.statements["insertPermission"].Exec(
-		serviceID, string(grantsJSON), string(scopesJSON),
-	)
-}
-
-// GetPermission retrieves the permission for the given service ID
-func (db *DB) GetPermission(serviceID string) ([]DIDNamespace, []PermissionScope, error) {
-	row := db.statements["getPermission"].QueryRow(serviceID)
-
-	var grantsJSON, scopesJSON string
-	if err := row.Scan(&grantsJSON, &scopesJSON); err != nil {
-		return nil, nil, fmt.Errorf("failed to get permission: %w", err)
-	}
-
-	var grants []DIDNamespace
-	if err := json.Unmarshal([]byte(grantsJSON), &grants); err != nil {
-		return nil, nil, fmt.Errorf("failed to unmarshal grants: %w", err)
-	}
-
-	var scopes []PermissionScope
-	if err := json.Unmarshal([]byte(scopesJSON), &scopes); err != nil {
-		return nil, nil, fmt.Errorf("failed to unmarshal scopes: %w", err)
-	}
-
-	return grants, scopes, nil
-}
-
-// Close closes the database connection and finalizes all prepared statements
-func (db *DB) Close() error {
-	for _, stmt := range db.statements {
-		stmt.Finalize()
-	}
-	return db.Conn.Close()
-}
diff --git a/internal/db/queries.go b/internal/db/queries.go
index 807d701..e69de29 100644
--- a/internal/db/queries.go
+++ b/internal/db/queries.go
@@ -1,79 +0,0 @@
-package db
-
-import "fmt"
-
-// Account queries
-func insertAccountQuery(name, address string) string {
-	return fmt.Sprintf(`INSERT INTO accounts (name, address) VALUES (%s, %s)`, name, address)
-}
-
-// Asset queries
-func insertAssetQuery(name, symbol string, decimals int, chainID int64) string {
-	return fmt.Sprintf(
-		`INSERT INTO assets (name, symbol, decimals, chain_id) VALUES (%s, %s, %d, %d)`,
-		name,
-		symbol,
-		decimals,
-		chainID,
-	)
-}
-
-// Chain queries
-func insertChainQuery(name string, networkID string) string {
-	return fmt.Sprintf(`INSERT INTO chains (name, network_id) VALUES (%s, %d)`, name, networkID)
-}
-
-// Credential queries
-func insertCredentialQuery(
-	handle, controller, attestationType, origin string,
-	credentialID, publicKey []byte,
-	transport string,
-	signCount uint32,
-	userPresent, userVerified, backupEligible, backupState, cloneWarning bool,
-) string {
-	return fmt.Sprintf(`INSERT INTO credentials (
-		handle, controller, attestation_type, origin,
-		credential_id, public_key, transport, sign_count,
-		user_present, user_verified, backup_eligible,
-		backup_state, clone_warning
-	) VALUES (%s, %s, %s, %s, %s, %s, %s, %d, %t, %t, %t, %t, %t)`,
-		handle, controller, attestationType, origin,
-		credentialID, publicKey, transport, signCount,
-		userPresent, userVerified, backupEligible,
-		backupState, cloneWarning)
-}
-
-// Profile queries
-func insertProfileQuery(
-	id, subject, controller, originURI, publicMetadata, privateMetadata string,
-) string {
-	return fmt.Sprintf(`INSERT INTO profiles (
-		id, subject, controller, origin_uri,
-		public_metadata, private_metadata
-	) VALUES (%s, %s, %s, %s, %s, %s)`,
-		id, subject, controller, originURI,
-		publicMetadata, privateMetadata)
-}
-
-// Property queries
-func insertPropertyQuery(profileID, key, accumulator, propertyKey string) string {
-	return fmt.Sprintf(`INSERT INTO properties (
-		profile_id, key, accumulator, property_key
-	) VALUES (%s, %s, %s, %s)`,
-		profileID, key, accumulator, propertyKey)
-}
-
-// Permission queries
-func insertPermissionQuery(serviceID, grants, scopes string) string {
-	return fmt.Sprintf(
-		`INSERT INTO permissions (service_id, grants, scopes) VALUES (%s, %s, %s)`,
-		serviceID,
-		grants,
-		scopes,
-	)
-}
-
-// GetPermission query
-func getPermissionQuery(serviceID string) string {
-	return fmt.Sprintf(`SELECT grants, scopes FROM permissions WHERE service_id = %s`, serviceID)
-}

* fix: update Makefile to use sonrd instead of wasmd

* feat: Add targets for templ and vault in Makefile and use only make in devbox.json

* feat: add SQLite database support

* bump: version 0.6.0 → 0.7.0

* refactor: upgrade actions to latest versions
This commit is contained in:
Prad Nukala
2024-09-05 01:24:57 -04:00
committed by GitHub
parent fd82cf4f3d
commit 8010e6b069
123 changed files with 24666 additions and 14591 deletions
+1 -1
View File
@@ -1564,7 +1564,7 @@ var file_did_v1_accounts_proto_rawDesc = []byte{
0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 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,
0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 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,
+727
View File
@@ -0,0 +1,727 @@
// 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"
sync "sync"
)
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc (unknown)
// source: did/v1/constants.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)
)
// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified
type AssetType int32
const (
AssetType_ASSET_TYPE_UNSPECIFIED AssetType = 0
AssetType_ASSET_TYPE_NATIVE AssetType = 1
AssetType_ASSET_TYPE_WRAPPED AssetType = 2
AssetType_ASSET_TYPE_STAKING AssetType = 3
AssetType_ASSET_TYPE_POOL AssetType = 4
AssetType_ASSET_TYPE_IBC AssetType = 5
AssetType_ASSET_TYPE_CW20 AssetType = 6
)
// Enum value maps for AssetType.
var (
AssetType_name = map[int32]string{
0: "ASSET_TYPE_UNSPECIFIED",
1: "ASSET_TYPE_NATIVE",
2: "ASSET_TYPE_WRAPPED",
3: "ASSET_TYPE_STAKING",
4: "ASSET_TYPE_POOL",
5: "ASSET_TYPE_IBC",
6: "ASSET_TYPE_CW20",
}
AssetType_value = map[string]int32{
"ASSET_TYPE_UNSPECIFIED": 0,
"ASSET_TYPE_NATIVE": 1,
"ASSET_TYPE_WRAPPED": 2,
"ASSET_TYPE_STAKING": 3,
"ASSET_TYPE_POOL": 4,
"ASSET_TYPE_IBC": 5,
"ASSET_TYPE_CW20": 6,
}
)
func (x AssetType) Enum() *AssetType {
p := new(AssetType)
*p = x
return p
}
func (x AssetType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (AssetType) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[0].Descriptor()
}
func (AssetType) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[0]
}
func (x AssetType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use AssetType.Descriptor instead.
func (AssetType) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{0}
}
// DIDNamespace define the different namespaces of DID
type DIDNamespace int32
const (
DIDNamespace_DID_NAMESPACE_UNSPECIFIED DIDNamespace = 0
DIDNamespace_DID_NAMESPACE_IPFS DIDNamespace = 1
DIDNamespace_DID_NAMESPACE_SONR DIDNamespace = 2
DIDNamespace_DID_NAMESPACE_BITCOIN DIDNamespace = 3
DIDNamespace_DID_NAMESPACE_ETHEREUM DIDNamespace = 4
DIDNamespace_DID_NAMESPACE_IBC DIDNamespace = 5
DIDNamespace_DID_NAMESPACE_WEBAUTHN DIDNamespace = 6
DIDNamespace_DID_NAMESPACE_DWN DIDNamespace = 7
DIDNamespace_DID_NAMESPACE_SERVICE DIDNamespace = 8
)
// Enum value maps for DIDNamespace.
var (
DIDNamespace_name = map[int32]string{
0: "DID_NAMESPACE_UNSPECIFIED",
1: "DID_NAMESPACE_IPFS",
2: "DID_NAMESPACE_SONR",
3: "DID_NAMESPACE_BITCOIN",
4: "DID_NAMESPACE_ETHEREUM",
5: "DID_NAMESPACE_IBC",
6: "DID_NAMESPACE_WEBAUTHN",
7: "DID_NAMESPACE_DWN",
8: "DID_NAMESPACE_SERVICE",
}
DIDNamespace_value = map[string]int32{
"DID_NAMESPACE_UNSPECIFIED": 0,
"DID_NAMESPACE_IPFS": 1,
"DID_NAMESPACE_SONR": 2,
"DID_NAMESPACE_BITCOIN": 3,
"DID_NAMESPACE_ETHEREUM": 4,
"DID_NAMESPACE_IBC": 5,
"DID_NAMESPACE_WEBAUTHN": 6,
"DID_NAMESPACE_DWN": 7,
"DID_NAMESPACE_SERVICE": 8,
}
)
func (x DIDNamespace) Enum() *DIDNamespace {
p := new(DIDNamespace)
*p = x
return p
}
func (x DIDNamespace) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (DIDNamespace) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[1].Descriptor()
}
func (DIDNamespace) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[1]
}
func (x DIDNamespace) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use DIDNamespace.Descriptor instead.
func (DIDNamespace) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{1}
}
// KeyAlgorithm defines the key algorithm
type KeyAlgorithm int32
const (
KeyAlgorithm_KEY_ALGORITHM_UNSPECIFIED KeyAlgorithm = 0
KeyAlgorithm_KEY_ALGORITHM_ES256 KeyAlgorithm = 1
KeyAlgorithm_KEY_ALGORITHM_ES384 KeyAlgorithm = 2
KeyAlgorithm_KEY_ALGORITHM_ES512 KeyAlgorithm = 3
KeyAlgorithm_KEY_ALGORITHM_EDDSA KeyAlgorithm = 4
KeyAlgorithm_KEY_ALGORITHM_ES256K KeyAlgorithm = 5
KeyAlgorithm_KEY_ALGORITHM_BLS12377 KeyAlgorithm = 6
KeyAlgorithm_KEY_ALGORITHM_KECCAK256 KeyAlgorithm = 7
)
// Enum value maps for KeyAlgorithm.
var (
KeyAlgorithm_name = map[int32]string{
0: "KEY_ALGORITHM_UNSPECIFIED",
1: "KEY_ALGORITHM_ES256",
2: "KEY_ALGORITHM_ES384",
3: "KEY_ALGORITHM_ES512",
4: "KEY_ALGORITHM_EDDSA",
5: "KEY_ALGORITHM_ES256K",
6: "KEY_ALGORITHM_BLS12377",
7: "KEY_ALGORITHM_KECCAK256",
}
KeyAlgorithm_value = map[string]int32{
"KEY_ALGORITHM_UNSPECIFIED": 0,
"KEY_ALGORITHM_ES256": 1,
"KEY_ALGORITHM_ES384": 2,
"KEY_ALGORITHM_ES512": 3,
"KEY_ALGORITHM_EDDSA": 4,
"KEY_ALGORITHM_ES256K": 5,
"KEY_ALGORITHM_BLS12377": 6,
"KEY_ALGORITHM_KECCAK256": 7,
}
)
func (x KeyAlgorithm) Enum() *KeyAlgorithm {
p := new(KeyAlgorithm)
*p = x
return p
}
func (x KeyAlgorithm) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KeyAlgorithm) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[2].Descriptor()
}
func (KeyAlgorithm) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[2]
}
func (x KeyAlgorithm) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KeyAlgorithm.Descriptor instead.
func (KeyAlgorithm) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{2}
}
// KeyCurve defines the key curve
type KeyCurve int32
const (
KeyCurve_KEY_CURVE_UNSPECIFIED KeyCurve = 0
KeyCurve_KEY_CURVE_P256 KeyCurve = 1
KeyCurve_KEY_CURVE_P384 KeyCurve = 2
KeyCurve_KEY_CURVE_P521 KeyCurve = 3
KeyCurve_KEY_CURVE_X25519 KeyCurve = 4
KeyCurve_KEY_CURVE_X448 KeyCurve = 5
KeyCurve_KEY_CURVE_ED25519 KeyCurve = 6
KeyCurve_KEY_CURVE_ED448 KeyCurve = 7
KeyCurve_KEY_CURVE_SECP256K1 KeyCurve = 8
)
// Enum value maps for KeyCurve.
var (
KeyCurve_name = map[int32]string{
0: "KEY_CURVE_UNSPECIFIED",
1: "KEY_CURVE_P256",
2: "KEY_CURVE_P384",
3: "KEY_CURVE_P521",
4: "KEY_CURVE_X25519",
5: "KEY_CURVE_X448",
6: "KEY_CURVE_ED25519",
7: "KEY_CURVE_ED448",
8: "KEY_CURVE_SECP256K1",
}
KeyCurve_value = map[string]int32{
"KEY_CURVE_UNSPECIFIED": 0,
"KEY_CURVE_P256": 1,
"KEY_CURVE_P384": 2,
"KEY_CURVE_P521": 3,
"KEY_CURVE_X25519": 4,
"KEY_CURVE_X448": 5,
"KEY_CURVE_ED25519": 6,
"KEY_CURVE_ED448": 7,
"KEY_CURVE_SECP256K1": 8,
}
)
func (x KeyCurve) Enum() *KeyCurve {
p := new(KeyCurve)
*p = x
return p
}
func (x KeyCurve) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KeyCurve) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[3].Descriptor()
}
func (KeyCurve) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[3]
}
func (x KeyCurve) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KeyCurve.Descriptor instead.
func (KeyCurve) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{3}
}
// KeyEncoding defines the key encoding
type KeyEncoding int32
const (
KeyEncoding_KEY_ENCODING_UNSPECIFIED KeyEncoding = 0
KeyEncoding_KEY_ENCODING_RAW KeyEncoding = 1
KeyEncoding_KEY_ENCODING_HEX KeyEncoding = 2
KeyEncoding_KEY_ENCODING_MULTIBASE KeyEncoding = 3
KeyEncoding_KEY_ENCODING_JWK KeyEncoding = 4
)
// Enum value maps for KeyEncoding.
var (
KeyEncoding_name = map[int32]string{
0: "KEY_ENCODING_UNSPECIFIED",
1: "KEY_ENCODING_RAW",
2: "KEY_ENCODING_HEX",
3: "KEY_ENCODING_MULTIBASE",
4: "KEY_ENCODING_JWK",
}
KeyEncoding_value = map[string]int32{
"KEY_ENCODING_UNSPECIFIED": 0,
"KEY_ENCODING_RAW": 1,
"KEY_ENCODING_HEX": 2,
"KEY_ENCODING_MULTIBASE": 3,
"KEY_ENCODING_JWK": 4,
}
)
func (x KeyEncoding) Enum() *KeyEncoding {
p := new(KeyEncoding)
*p = x
return p
}
func (x KeyEncoding) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KeyEncoding) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[4].Descriptor()
}
func (KeyEncoding) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[4]
}
func (x KeyEncoding) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KeyEncoding.Descriptor instead.
func (KeyEncoding) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{4}
}
// KeyRole defines the kind of key
type KeyRole int32
const (
KeyRole_KEY_ROLE_UNSPECIFIED KeyRole = 0
// Blockchain key types
KeyRole_KEY_ROLE_AUTHENTICATION KeyRole = 1 // Passkeys and FIDO
KeyRole_KEY_ROLE_ASSERTION KeyRole = 2 // Zk Identifiers
KeyRole_KEY_ROLE_DELEGATION KeyRole = 3 // ETH,BTC,IBC addresses
KeyRole_KEY_ROLE_INVOCATION KeyRole = 4 // DWN Controllers
)
// Enum value maps for KeyRole.
var (
KeyRole_name = map[int32]string{
0: "KEY_ROLE_UNSPECIFIED",
1: "KEY_ROLE_AUTHENTICATION",
2: "KEY_ROLE_ASSERTION",
3: "KEY_ROLE_DELEGATION",
4: "KEY_ROLE_INVOCATION",
}
KeyRole_value = map[string]int32{
"KEY_ROLE_UNSPECIFIED": 0,
"KEY_ROLE_AUTHENTICATION": 1,
"KEY_ROLE_ASSERTION": 2,
"KEY_ROLE_DELEGATION": 3,
"KEY_ROLE_INVOCATION": 4,
}
)
func (x KeyRole) Enum() *KeyRole {
p := new(KeyRole)
*p = x
return p
}
func (x KeyRole) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KeyRole) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[5].Descriptor()
}
func (KeyRole) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[5]
}
func (x KeyRole) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KeyRole.Descriptor instead.
func (KeyRole) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{5}
}
// KeyType defines the key type
type KeyType int32
const (
KeyType_KEY_TYPE_UNSPECIFIED KeyType = 0
KeyType_KEY_TYPE_OCTET KeyType = 1
KeyType_KEY_TYPE_ELLIPTIC KeyType = 2
KeyType_KEY_TYPE_RSA KeyType = 3
KeyType_KEY_TYPE_SYMMETRIC KeyType = 4
KeyType_KEY_TYPE_HMAC KeyType = 5
)
// Enum value maps for KeyType.
var (
KeyType_name = map[int32]string{
0: "KEY_TYPE_UNSPECIFIED",
1: "KEY_TYPE_OCTET",
2: "KEY_TYPE_ELLIPTIC",
3: "KEY_TYPE_RSA",
4: "KEY_TYPE_SYMMETRIC",
5: "KEY_TYPE_HMAC",
}
KeyType_value = map[string]int32{
"KEY_TYPE_UNSPECIFIED": 0,
"KEY_TYPE_OCTET": 1,
"KEY_TYPE_ELLIPTIC": 2,
"KEY_TYPE_RSA": 3,
"KEY_TYPE_SYMMETRIC": 4,
"KEY_TYPE_HMAC": 5,
}
)
func (x KeyType) Enum() *KeyType {
p := new(KeyType)
*p = x
return p
}
func (x KeyType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (KeyType) Descriptor() protoreflect.EnumDescriptor {
return file_did_v1_constants_proto_enumTypes[6].Descriptor()
}
func (KeyType) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[6]
}
func (x KeyType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use KeyType.Descriptor instead.
func (KeyType) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{6}
}
// PermissionScope define the Capabilities Controllers can grant for Services
type PermissionScope int32
const (
PermissionScope_PERMISSION_SCOPE_UNSPECIFIED PermissionScope = 0
PermissionScope_PERMISSION_SCOPE_BASIC_INFO PermissionScope = 1
PermissionScope_PERMISSION_SCOPE_RECORDS_READ PermissionScope = 2
PermissionScope_PERMISSION_SCOPE_RECORDS_WRITE 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_BASIC_INFO",
2: "PERMISSION_SCOPE_RECORDS_READ",
3: "PERMISSION_SCOPE_RECORDS_WRITE",
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_BASIC_INFO": 1,
"PERMISSION_SCOPE_RECORDS_READ": 2,
"PERMISSION_SCOPE_RECORDS_WRITE": 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_constants_proto_enumTypes[7].Descriptor()
}
func (PermissionScope) Type() protoreflect.EnumType {
return &file_did_v1_constants_proto_enumTypes[7]
}
func (x PermissionScope) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PermissionScope.Descriptor instead.
func (PermissionScope) EnumDescriptor() ([]byte, []int) {
return file_did_v1_constants_proto_rawDescGZIP(), []int{7}
}
var File_did_v1_constants_proto protoreflect.FileDescriptor
var file_did_v1_constants_proto_rawDesc = []byte{
0x0a, 0x16, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e,
0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31,
0x2a, 0xac, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a,
0x0a, 0x16, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53,
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x41, 0x53,
0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x41, 0x54, 0x49, 0x56, 0x45, 0x10,
0x01, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x57, 0x52, 0x41, 0x50, 0x50, 0x45, 0x44, 0x10, 0x02, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x53, 0x53,
0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4b, 0x49, 0x4e, 0x47, 0x10,
0x03, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f,
0x50, 0x4f, 0x4f, 0x4c, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e, 0x41, 0x53, 0x53, 0x45, 0x54, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x13, 0x0a, 0x0f, 0x41, 0x53,
0x53, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x57, 0x32, 0x30, 0x10, 0x06, 0x2a,
0xf9, 0x01, 0x0a, 0x0c, 0x44, 0x49, 0x44, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x12, 0x1d, 0x0a, 0x19, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43,
0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,
0x16, 0x0a, 0x12, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45,
0x5f, 0x49, 0x50, 0x46, 0x53, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x44, 0x49, 0x44, 0x5f, 0x4e,
0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x53, 0x4f, 0x4e, 0x52, 0x10, 0x02, 0x12,
0x19, 0x0a, 0x15, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45,
0x5f, 0x42, 0x49, 0x54, 0x43, 0x4f, 0x49, 0x4e, 0x10, 0x03, 0x12, 0x1a, 0x0a, 0x16, 0x44, 0x49,
0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x45, 0x54, 0x48, 0x45,
0x52, 0x45, 0x55, 0x4d, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41,
0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x49, 0x42, 0x43, 0x10, 0x05, 0x12, 0x1a, 0x0a,
0x16, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x57,
0x45, 0x42, 0x41, 0x55, 0x54, 0x48, 0x4e, 0x10, 0x06, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x49, 0x44,
0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43, 0x45, 0x5f, 0x44, 0x57, 0x4e, 0x10, 0x07,
0x12, 0x19, 0x0a, 0x15, 0x44, 0x49, 0x44, 0x5f, 0x4e, 0x41, 0x4d, 0x45, 0x53, 0x50, 0x41, 0x43,
0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x08, 0x2a, 0xe4, 0x01, 0x0a, 0x0c,
0x4b, 0x65, 0x79, 0x41, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1d, 0x0a, 0x19,
0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x55, 0x4e,
0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4b,
0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x32,
0x35, 0x36, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f,
0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x53, 0x33, 0x38, 0x34, 0x10, 0x02, 0x12, 0x17, 0x0a,
0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45,
0x53, 0x35, 0x31, 0x32, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c,
0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x45, 0x44, 0x44, 0x53, 0x41, 0x10, 0x04, 0x12,
0x18, 0x0a, 0x14, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d,
0x5f, 0x45, 0x53, 0x32, 0x35, 0x36, 0x4b, 0x10, 0x05, 0x12, 0x1a, 0x0a, 0x16, 0x4b, 0x45, 0x59,
0x5f, 0x41, 0x4c, 0x47, 0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x42, 0x4c, 0x53, 0x31, 0x32,
0x33, 0x37, 0x37, 0x10, 0x06, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x45, 0x59, 0x5f, 0x41, 0x4c, 0x47,
0x4f, 0x52, 0x49, 0x54, 0x48, 0x4d, 0x5f, 0x4b, 0x45, 0x43, 0x43, 0x41, 0x4b, 0x32, 0x35, 0x36,
0x10, 0x07, 0x2a, 0xd0, 0x01, 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x43, 0x75, 0x72, 0x76, 0x65, 0x12,
0x19, 0x0a, 0x15, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x55, 0x4e, 0x53,
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45,
0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x32, 0x35, 0x36, 0x10, 0x01, 0x12, 0x12,
0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x50, 0x33, 0x38, 0x34,
0x10, 0x02, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f,
0x50, 0x35, 0x32, 0x31, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55,
0x52, 0x56, 0x45, 0x5f, 0x58, 0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x04, 0x12, 0x12, 0x0a, 0x0e,
0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x58, 0x34, 0x34, 0x38, 0x10, 0x05,
0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x45, 0x44,
0x32, 0x35, 0x35, 0x31, 0x39, 0x10, 0x06, 0x12, 0x13, 0x0a, 0x0f, 0x4b, 0x45, 0x59, 0x5f, 0x43,
0x55, 0x52, 0x56, 0x45, 0x5f, 0x45, 0x44, 0x34, 0x34, 0x38, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13,
0x4b, 0x45, 0x59, 0x5f, 0x43, 0x55, 0x52, 0x56, 0x45, 0x5f, 0x53, 0x45, 0x43, 0x50, 0x32, 0x35,
0x36, 0x4b, 0x31, 0x10, 0x08, 0x2a, 0x89, 0x01, 0x0a, 0x0b, 0x4b, 0x65, 0x79, 0x45, 0x6e, 0x63,
0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, 0x18, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43,
0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44,
0x49, 0x4e, 0x47, 0x5f, 0x52, 0x41, 0x57, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x4b, 0x45, 0x59,
0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x48, 0x45, 0x58, 0x10, 0x02, 0x12,
0x1a, 0x0a, 0x16, 0x4b, 0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f,
0x4d, 0x55, 0x4c, 0x54, 0x49, 0x42, 0x41, 0x53, 0x45, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x4b,
0x45, 0x59, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x4a, 0x57, 0x4b, 0x10,
0x04, 0x2a, 0x8a, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x18, 0x0a,
0x14, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,
0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x4b, 0x45, 0x59, 0x5f, 0x52,
0x4f, 0x4c, 0x45, 0x5f, 0x41, 0x55, 0x54, 0x48, 0x45, 0x4e, 0x54, 0x49, 0x43, 0x41, 0x54, 0x49,
0x4f, 0x4e, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45,
0x5f, 0x41, 0x53, 0x53, 0x45, 0x52, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13,
0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x47, 0x41, 0x54,
0x49, 0x4f, 0x4e, 0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x4b, 0x45, 0x59, 0x5f, 0x52, 0x4f, 0x4c,
0x45, 0x5f, 0x49, 0x4e, 0x56, 0x4f, 0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x04, 0x2a, 0x8b,
0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x14, 0x4b, 0x45,
0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45,
0x5f, 0x4f, 0x43, 0x54, 0x45, 0x54, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x4b, 0x45, 0x59, 0x5f,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4c, 0x4c, 0x49, 0x50, 0x54, 0x49, 0x43, 0x10, 0x02, 0x12,
0x10, 0x0a, 0x0c, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x53, 0x41, 0x10,
0x03, 0x12, 0x16, 0x0a, 0x12, 0x4b, 0x45, 0x59, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x59,
0x4d, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x10, 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x4b, 0x45, 0x59,
0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x48, 0x4d, 0x41, 0x43, 0x10, 0x05, 0x2a, 0x9f, 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, 0x1f, 0x0a, 0x1b, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f, 0x4e,
0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x42, 0x41, 0x53, 0x49, 0x43, 0x5f, 0x49, 0x4e, 0x46,
0x4f, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53, 0x53, 0x49, 0x4f,
0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x43, 0x4f, 0x52, 0x44, 0x53, 0x5f,
0x52, 0x45, 0x41, 0x44, 0x10, 0x02, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x45, 0x52, 0x4d, 0x49, 0x53,
0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x5f, 0x52, 0x45, 0x43, 0x4f, 0x52,
0x44, 0x53, 0x5f, 0x57, 0x52, 0x49, 0x54, 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, 0x7e,
0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x43, 0x6f,
0x6e, 0x73, 0x74, 0x61, 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, 0x73, 0x6f, 0x6e, 0x72, 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_constants_proto_rawDescOnce sync.Once
file_did_v1_constants_proto_rawDescData = file_did_v1_constants_proto_rawDesc
)
func file_did_v1_constants_proto_rawDescGZIP() []byte {
file_did_v1_constants_proto_rawDescOnce.Do(func() {
file_did_v1_constants_proto_rawDescData = protoimpl.X.CompressGZIP(file_did_v1_constants_proto_rawDescData)
})
return file_did_v1_constants_proto_rawDescData
}
var file_did_v1_constants_proto_enumTypes = make([]protoimpl.EnumInfo, 8)
var file_did_v1_constants_proto_goTypes = []interface{}{
(AssetType)(0), // 0: did.v1.AssetType
(DIDNamespace)(0), // 1: did.v1.DIDNamespace
(KeyAlgorithm)(0), // 2: did.v1.KeyAlgorithm
(KeyCurve)(0), // 3: did.v1.KeyCurve
(KeyEncoding)(0), // 4: did.v1.KeyEncoding
(KeyRole)(0), // 5: did.v1.KeyRole
(KeyType)(0), // 6: did.v1.KeyType
(PermissionScope)(0), // 7: did.v1.PermissionScope
}
var file_did_v1_constants_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_constants_proto_init() }
func file_did_v1_constants_proto_init() {
if File_did_v1_constants_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_did_v1_constants_proto_rawDesc,
NumEnums: 8,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_did_v1_constants_proto_goTypes,
DependencyIndexes: file_did_v1_constants_proto_depIdxs,
EnumInfos: file_did_v1_constants_proto_enumTypes,
}.Build()
File_did_v1_constants_proto = out.File
file_did_v1_constants_proto_rawDesc = nil
file_did_v1_constants_proto_goTypes = nil
file_did_v1_constants_proto_depIdxs = nil
}
+4115 -2168
View File
File diff suppressed because it is too large Load Diff
+3644 -1061
View File
File diff suppressed because it is too large Load Diff
+1530 -3458
View File
File diff suppressed because it is too large Load Diff
+69 -69
View File
@@ -22,9 +22,9 @@ const (
Query_Params_FullMethodName = "/did.v1.Query/Params"
Query_Accounts_FullMethodName = "/did.v1.Query/Accounts"
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"
Query_Token_FullMethodName = "/did.v1.Query/Token"
)
// QueryClient is the client API for Query service.
@@ -32,17 +32,17 @@ const (
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type QueryClient interface {
// Params queries all parameters of the module.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// Accounts returns associated wallet accounts with the DID.
Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error)
Accounts(ctx context.Context, in *QueryRequest, 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)
Credentials(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error)
// Resolve queries the DID document by its id.
Resolve(ctx context.Context, in *QueryResolveRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error)
Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error)
// Service returns associated ServiceInfo for a given Origin
Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error)
Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error)
// Token returns the current authentication token for the client.
Token(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryTokenResponse, error)
}
type queryClient struct {
@@ -53,7 +53,7 @@ func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
return &queryClient{cc}
}
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
func (c *queryClient) Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
out := new(QueryParamsResponse)
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
if err != nil {
@@ -62,7 +62,7 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts .
return out, nil
}
func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) {
func (c *queryClient) Accounts(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryAccountsResponse, error) {
out := new(QueryAccountsResponse)
err := c.cc.Invoke(ctx, Query_Accounts_FullMethodName, in, out, opts...)
if err != nil {
@@ -71,7 +71,7 @@ func (c *queryClient) Accounts(ctx context.Context, in *QueryAccountsRequest, op
return out, nil
}
func (c *queryClient) Credentials(ctx context.Context, in *QueryCredentialsRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) {
func (c *queryClient) Credentials(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryCredentialsResponse, error) {
out := new(QueryCredentialsResponse)
err := c.cc.Invoke(ctx, Query_Credentials_FullMethodName, in, out, opts...)
if err != nil {
@@ -80,16 +80,7 @@ func (c *queryClient) Credentials(ctx context.Context, in *QueryCredentialsReque
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) {
func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) {
out := new(QueryResolveResponse)
err := c.cc.Invoke(ctx, Query_Resolve_FullMethodName, in, out, opts...)
if err != nil {
@@ -98,7 +89,7 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryResolveRequest, opts
return out, nil
}
func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) {
func (c *queryClient) Service(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryServiceResponse, error) {
out := new(QueryServiceResponse)
err := c.cc.Invoke(ctx, Query_Service_FullMethodName, in, out, opts...)
if err != nil {
@@ -107,22 +98,31 @@ func (c *queryClient) Service(ctx context.Context, in *QueryServiceRequest, opts
return out, nil
}
func (c *queryClient) Token(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryTokenResponse, error) {
out := new(QueryTokenResponse)
err := c.cc.Invoke(ctx, Query_Token_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer
// for forward compatibility
type QueryServer interface {
// Params queries all parameters of the module.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
Params(context.Context, *QueryRequest) (*QueryParamsResponse, error)
// Accounts returns associated wallet accounts with the DID.
Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error)
Accounts(context.Context, *QueryRequest) (*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)
Credentials(context.Context, *QueryRequest) (*QueryCredentialsResponse, error)
// Resolve queries the DID document by its id.
Resolve(context.Context, *QueryResolveRequest) (*QueryResolveResponse, error)
Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error)
// Service returns associated ServiceInfo for a given Origin
Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error)
Service(context.Context, *QueryRequest) (*QueryServiceResponse, error)
// Token returns the current authentication token for the client.
Token(context.Context, *QueryRequest) (*QueryTokenResponse, error)
mustEmbedUnimplementedQueryServer()
}
@@ -130,24 +130,24 @@ type QueryServer interface {
type UnimplementedQueryServer struct {
}
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
}
func (UnimplementedQueryServer) Accounts(context.Context, *QueryAccountsRequest) (*QueryAccountsResponse, error) {
func (UnimplementedQueryServer) Accounts(context.Context, *QueryRequest) (*QueryAccountsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Accounts not implemented")
}
func (UnimplementedQueryServer) Credentials(context.Context, *QueryCredentialsRequest) (*QueryCredentialsResponse, error) {
func (UnimplementedQueryServer) Credentials(context.Context, *QueryRequest) (*QueryCredentialsResponse, error) {
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) {
func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented")
}
func (UnimplementedQueryServer) Service(context.Context, *QueryServiceRequest) (*QueryServiceResponse, error) {
func (UnimplementedQueryServer) Service(context.Context, *QueryRequest) (*QueryServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Service not implemented")
}
func (UnimplementedQueryServer) Token(context.Context, *QueryRequest) (*QueryTokenResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Token not implemented")
}
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
@@ -162,7 +162,7 @@ func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
}
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryParamsRequest)
in := new(QueryRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -174,13 +174,13 @@ func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interf
FullMethod: Query_Params_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
return srv.(QueryServer).Params(ctx, req.(*QueryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryAccountsRequest)
in := new(QueryRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -192,13 +192,13 @@ func _Query_Accounts_Handler(srv interface{}, ctx context.Context, dec func(inte
FullMethod: Query_Accounts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Accounts(ctx, req.(*QueryAccountsRequest))
return srv.(QueryServer).Accounts(ctx, req.(*QueryRequest))
}
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)
in := new(QueryRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -210,31 +210,13 @@ func _Query_Credentials_Handler(srv interface{}, ctx context.Context, dec func(i
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 srv.(QueryServer).Credentials(ctx, req.(*QueryRequest))
}
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(QueryRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -246,13 +228,13 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter
FullMethod: Query_Resolve_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Resolve(ctx, req.(*QueryResolveRequest))
return srv.(QueryServer).Resolve(ctx, req.(*QueryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryServiceRequest)
in := new(QueryRequest)
if err := dec(in); err != nil {
return nil, err
}
@@ -264,7 +246,25 @@ func _Query_Service_Handler(srv interface{}, ctx context.Context, dec func(inter
FullMethod: Query_Service_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Service(ctx, req.(*QueryServiceRequest))
return srv.(QueryServer).Service(ctx, req.(*QueryRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Token_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Token(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Token_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Token(ctx, req.(*QueryRequest))
}
return interceptor(ctx, in, info, handler)
}
@@ -288,10 +288,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{
MethodName: "Credentials",
Handler: _Query_Credentials_Handler,
},
{
MethodName: "Identities",
Handler: _Query_Identities_Handler,
},
{
MethodName: "Resolve",
Handler: _Query_Resolve_Handler,
@@ -300,6 +296,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{
MethodName: "Service",
Handler: _Query_Service_Handler,
},
{
MethodName: "Token",
Handler: _Query_Token_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "did/v1/query.proto",
+486 -59
View File
@@ -17,6 +17,15 @@ type AssertionTable interface {
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(ctx context.Context, id string) (*Assertion, error)
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Assertion, error)
HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error)
// GetByControllerOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Assertion, error)
HasByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (found bool, err error)
// GetByControllerCredentialLabel returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (*Assertion, error)
List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error)
ListRange(ctx context.Context, from, to AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error)
DeleteBy(ctx context.Context, prefixKey AssertionIndexKey) error
@@ -57,6 +66,60 @@ func (this AssertionIdIndexKey) WithId(id string) AssertionIdIndexKey {
return this
}
type AssertionSubjectOriginIndexKey struct {
vs []interface{}
}
func (x AssertionSubjectOriginIndexKey) id() uint32 { return 1 }
func (x AssertionSubjectOriginIndexKey) values() []interface{} { return x.vs }
func (x AssertionSubjectOriginIndexKey) assertionIndexKey() {}
func (this AssertionSubjectOriginIndexKey) WithSubject(subject string) AssertionSubjectOriginIndexKey {
this.vs = []interface{}{subject}
return this
}
func (this AssertionSubjectOriginIndexKey) WithSubjectOrigin(subject string, origin string) AssertionSubjectOriginIndexKey {
this.vs = []interface{}{subject, origin}
return this
}
type AssertionControllerOriginIndexKey struct {
vs []interface{}
}
func (x AssertionControllerOriginIndexKey) id() uint32 { return 2 }
func (x AssertionControllerOriginIndexKey) values() []interface{} { return x.vs }
func (x AssertionControllerOriginIndexKey) assertionIndexKey() {}
func (this AssertionControllerOriginIndexKey) WithController(controller string) AssertionControllerOriginIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this AssertionControllerOriginIndexKey) WithControllerOrigin(controller string, origin string) AssertionControllerOriginIndexKey {
this.vs = []interface{}{controller, origin}
return this
}
type AssertionControllerCredentialLabelIndexKey struct {
vs []interface{}
}
func (x AssertionControllerCredentialLabelIndexKey) id() uint32 { return 3 }
func (x AssertionControllerCredentialLabelIndexKey) values() []interface{} { return x.vs }
func (x AssertionControllerCredentialLabelIndexKey) assertionIndexKey() {}
func (this AssertionControllerCredentialLabelIndexKey) WithController(controller string) AssertionControllerCredentialLabelIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this AssertionControllerCredentialLabelIndexKey) WithControllerCredentialLabel(controller string, credential_label string) AssertionControllerCredentialLabelIndexKey {
this.vs = []interface{}{controller, credential_label}
return this
}
type assertionTable struct {
table ormtable.Table
}
@@ -93,6 +156,72 @@ func (this assertionTable) Get(ctx context.Context, id string) (*Assertion, erro
return &assertion, nil
}
func (this assertionTable) HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
subject,
origin,
)
}
func (this assertionTable) GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Assertion, error) {
var assertion Assertion
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &assertion,
subject,
origin,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &assertion, nil
}
func (this assertionTable) HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error) {
return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx,
controller,
origin,
)
}
func (this assertionTable) GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Assertion, error) {
var assertion Assertion
found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &assertion,
controller,
origin,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &assertion, nil
}
func (this assertionTable) HasByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (found bool, err error) {
return this.table.GetIndexByID(3).(ormtable.UniqueIndex).Has(ctx,
controller,
credential_label,
)
}
func (this assertionTable) GetByControllerCredentialLabel(ctx context.Context, controller string, credential_label string) (*Assertion, error) {
var assertion Assertion
found, err := this.table.GetIndexByID(3).(ormtable.UniqueIndex).Get(ctx, &assertion,
controller,
credential_label,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &assertion, nil
}
func (this assertionTable) List(ctx context.Context, prefixKey AssertionIndexKey, opts ...ormlist.Option) (AssertionIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return AssertionIterator{it}, err
@@ -134,6 +263,9 @@ type AttestationTable interface {
HasBySubjectOrigin(ctx context.Context, subject string, origin string) (found bool, err error)
// GetBySubjectOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetBySubjectOrigin(ctx context.Context, subject string, origin string) (*Attestation, error)
HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error)
// GetByControllerOrigin returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Attestation, error)
List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error)
ListRange(ctx context.Context, from, to AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error)
DeleteBy(ctx context.Context, prefixKey AttestationIndexKey) error
@@ -192,6 +324,24 @@ func (this AttestationSubjectOriginIndexKey) WithSubjectOrigin(subject string, o
return this
}
type AttestationControllerOriginIndexKey struct {
vs []interface{}
}
func (x AttestationControllerOriginIndexKey) id() uint32 { return 2 }
func (x AttestationControllerOriginIndexKey) values() []interface{} { return x.vs }
func (x AttestationControllerOriginIndexKey) attestationIndexKey() {}
func (this AttestationControllerOriginIndexKey) WithController(controller string) AttestationControllerOriginIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this AttestationControllerOriginIndexKey) WithControllerOrigin(controller string, origin string) AttestationControllerOriginIndexKey {
this.vs = []interface{}{controller, origin}
return this
}
type attestationTable struct {
table ormtable.Table
}
@@ -250,6 +400,28 @@ func (this attestationTable) GetBySubjectOrigin(ctx context.Context, subject str
return &attestation, nil
}
func (this attestationTable) HasByControllerOrigin(ctx context.Context, controller string, origin string) (found bool, err error) {
return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx,
controller,
origin,
)
}
func (this attestationTable) GetByControllerOrigin(ctx context.Context, controller string, origin string) (*Attestation, error) {
var attestation Attestation
found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &attestation,
controller,
origin,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &attestation, nil
}
func (this attestationTable) List(ctx context.Context, prefixKey AttestationIndexKey, opts ...ormlist.Option) (AttestationIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return AttestationIterator{it}, err
@@ -288,6 +460,12 @@ type ControllerTable interface {
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(ctx context.Context, id string) (*Controller, error)
HasByAddress(ctx context.Context, address string) (found bool, err error)
// GetByAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByAddress(ctx context.Context, address string) (*Controller, error)
HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error)
// GetByVaultCid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error)
List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error)
ListRange(ctx context.Context, from, to ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error)
DeleteBy(ctx context.Context, prefixKey ControllerIndexKey) error
@@ -328,6 +506,32 @@ func (this ControllerIdIndexKey) WithId(id string) ControllerIdIndexKey {
return this
}
type ControllerAddressIndexKey struct {
vs []interface{}
}
func (x ControllerAddressIndexKey) id() uint32 { return 1 }
func (x ControllerAddressIndexKey) values() []interface{} { return x.vs }
func (x ControllerAddressIndexKey) controllerIndexKey() {}
func (this ControllerAddressIndexKey) WithAddress(address string) ControllerAddressIndexKey {
this.vs = []interface{}{address}
return this
}
type ControllerVaultCidIndexKey struct {
vs []interface{}
}
func (x ControllerVaultCidIndexKey) id() uint32 { return 2 }
func (x ControllerVaultCidIndexKey) values() []interface{} { return x.vs }
func (x ControllerVaultCidIndexKey) controllerIndexKey() {}
func (this ControllerVaultCidIndexKey) WithVaultCid(vault_cid string) ControllerVaultCidIndexKey {
this.vs = []interface{}{vault_cid}
return this
}
type controllerTable struct {
table ormtable.Table
}
@@ -364,6 +568,46 @@ func (this controllerTable) Get(ctx context.Context, id string) (*Controller, er
return &controller, nil
}
func (this controllerTable) HasByAddress(ctx context.Context, address string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
address,
)
}
func (this controllerTable) GetByAddress(ctx context.Context, address string) (*Controller, error) {
var controller Controller
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &controller,
address,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &controller, nil
}
func (this controllerTable) HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error) {
return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx,
vault_cid,
)
}
func (this controllerTable) GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error) {
var controller Controller
found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &controller,
vault_cid,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &controller, nil
}
func (this controllerTable) List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return ControllerIterator{it}, err
@@ -402,6 +646,12 @@ type DelegationTable interface {
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(ctx context.Context, id string) (*Delegation, error)
HasByAccountAddressChainId(ctx context.Context, account_address string, chain_id string) (found bool, err error)
// GetByAccountAddressChainId returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByAccountAddressChainId(ctx context.Context, account_address string, chain_id string) (*Delegation, error)
HasByControllerAccountLabel(ctx context.Context, controller string, account_label string) (found bool, err error)
// GetByControllerAccountLabel returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByControllerAccountLabel(ctx context.Context, controller string, account_label string) (*Delegation, error)
List(ctx context.Context, prefixKey DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error)
ListRange(ctx context.Context, from, to DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error)
DeleteBy(ctx context.Context, prefixKey DelegationIndexKey) error
@@ -442,6 +692,60 @@ func (this DelegationIdIndexKey) WithId(id string) DelegationIdIndexKey {
return this
}
type DelegationAccountAddressChainIdIndexKey struct {
vs []interface{}
}
func (x DelegationAccountAddressChainIdIndexKey) id() uint32 { return 1 }
func (x DelegationAccountAddressChainIdIndexKey) values() []interface{} { return x.vs }
func (x DelegationAccountAddressChainIdIndexKey) delegationIndexKey() {}
func (this DelegationAccountAddressChainIdIndexKey) WithAccountAddress(account_address string) DelegationAccountAddressChainIdIndexKey {
this.vs = []interface{}{account_address}
return this
}
func (this DelegationAccountAddressChainIdIndexKey) WithAccountAddressChainId(account_address string, chain_id string) DelegationAccountAddressChainIdIndexKey {
this.vs = []interface{}{account_address, chain_id}
return this
}
type DelegationControllerAccountLabelIndexKey struct {
vs []interface{}
}
func (x DelegationControllerAccountLabelIndexKey) id() uint32 { return 2 }
func (x DelegationControllerAccountLabelIndexKey) values() []interface{} { return x.vs }
func (x DelegationControllerAccountLabelIndexKey) delegationIndexKey() {}
func (this DelegationControllerAccountLabelIndexKey) WithController(controller string) DelegationControllerAccountLabelIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this DelegationControllerAccountLabelIndexKey) WithControllerAccountLabel(controller string, account_label string) DelegationControllerAccountLabelIndexKey {
this.vs = []interface{}{controller, account_label}
return this
}
type DelegationControllerChainIdIndexKey struct {
vs []interface{}
}
func (x DelegationControllerChainIdIndexKey) id() uint32 { return 3 }
func (x DelegationControllerChainIdIndexKey) values() []interface{} { return x.vs }
func (x DelegationControllerChainIdIndexKey) delegationIndexKey() {}
func (this DelegationControllerChainIdIndexKey) WithController(controller string) DelegationControllerChainIdIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this DelegationControllerChainIdIndexKey) WithControllerChainId(controller string, chain_id string) DelegationControllerChainIdIndexKey {
this.vs = []interface{}{controller, chain_id}
return this
}
type delegationTable struct {
table ormtable.Table
}
@@ -478,6 +782,50 @@ func (this delegationTable) Get(ctx context.Context, id string) (*Delegation, er
return &delegation, nil
}
func (this delegationTable) HasByAccountAddressChainId(ctx context.Context, account_address string, chain_id string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
account_address,
chain_id,
)
}
func (this delegationTable) GetByAccountAddressChainId(ctx context.Context, account_address string, chain_id string) (*Delegation, error) {
var delegation Delegation
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &delegation,
account_address,
chain_id,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &delegation, nil
}
func (this delegationTable) HasByControllerAccountLabel(ctx context.Context, controller string, account_label string) (found bool, err error) {
return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx,
controller,
account_label,
)
}
func (this delegationTable) GetByControllerAccountLabel(ctx context.Context, controller string, account_label string) (*Delegation, error) {
var delegation Delegation
found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &delegation,
controller,
account_label,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &delegation, nil
}
func (this delegationTable) List(ctx context.Context, prefixKey DelegationIndexKey, opts ...ormlist.Option) (DelegationIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return DelegationIterator{it}, err
@@ -508,118 +856,197 @@ func NewDelegationTable(db ormtable.Schema) (DelegationTable, error) {
return delegationTable{table}, nil
}
type ServiceTable interface {
Insert(ctx context.Context, service *Service) error
Update(ctx context.Context, service *Service) error
Save(ctx context.Context, service *Service) error
Delete(ctx context.Context, service *Service) error
type ServiceRecordTable interface {
Insert(ctx context.Context, serviceRecord *ServiceRecord) error
Update(ctx context.Context, serviceRecord *ServiceRecord) error
Save(ctx context.Context, serviceRecord *ServiceRecord) error
Delete(ctx context.Context, serviceRecord *ServiceRecord) 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(ctx context.Context, id string) (*Service, error)
List(ctx context.Context, prefixKey ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error)
ListRange(ctx context.Context, from, to ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error)
DeleteBy(ctx context.Context, prefixKey ServiceIndexKey) error
DeleteRange(ctx context.Context, from, to ServiceIndexKey) error
Get(ctx context.Context, id string) (*ServiceRecord, error)
HasByOriginUri(ctx context.Context, origin_uri string) (found bool, err error)
// GetByOriginUri returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByOriginUri(ctx context.Context, origin_uri string) (*ServiceRecord, error)
HasByControllerOriginUri(ctx context.Context, controller string, origin_uri string) (found bool, err error)
// GetByControllerOriginUri returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByControllerOriginUri(ctx context.Context, controller string, origin_uri string) (*ServiceRecord, error)
List(ctx context.Context, prefixKey ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error)
ListRange(ctx context.Context, from, to ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error)
DeleteBy(ctx context.Context, prefixKey ServiceRecordIndexKey) error
DeleteRange(ctx context.Context, from, to ServiceRecordIndexKey) error
doNotImplement()
}
type ServiceIterator struct {
type ServiceRecordIterator struct {
ormtable.Iterator
}
func (i ServiceIterator) Value() (*Service, error) {
var service Service
err := i.UnmarshalMessage(&service)
return &service, err
func (i ServiceRecordIterator) Value() (*ServiceRecord, error) {
var serviceRecord ServiceRecord
err := i.UnmarshalMessage(&serviceRecord)
return &serviceRecord, err
}
type ServiceIndexKey interface {
type ServiceRecordIndexKey interface {
id() uint32
values() []interface{}
serviceIndexKey()
serviceRecordIndexKey()
}
// primary key starting index..
type ServicePrimaryKey = ServiceIdIndexKey
type ServiceRecordPrimaryKey = ServiceRecordIdIndexKey
type ServiceIdIndexKey struct {
type ServiceRecordIdIndexKey struct {
vs []interface{}
}
func (x ServiceIdIndexKey) id() uint32 { return 0 }
func (x ServiceIdIndexKey) values() []interface{} { return x.vs }
func (x ServiceIdIndexKey) serviceIndexKey() {}
func (x ServiceRecordIdIndexKey) id() uint32 { return 0 }
func (x ServiceRecordIdIndexKey) values() []interface{} { return x.vs }
func (x ServiceRecordIdIndexKey) serviceRecordIndexKey() {}
func (this ServiceIdIndexKey) WithId(id string) ServiceIdIndexKey {
func (this ServiceRecordIdIndexKey) WithId(id string) ServiceRecordIdIndexKey {
this.vs = []interface{}{id}
return this
}
type serviceTable struct {
type ServiceRecordOriginUriIndexKey struct {
vs []interface{}
}
func (x ServiceRecordOriginUriIndexKey) id() uint32 { return 1 }
func (x ServiceRecordOriginUriIndexKey) values() []interface{} { return x.vs }
func (x ServiceRecordOriginUriIndexKey) serviceRecordIndexKey() {}
func (this ServiceRecordOriginUriIndexKey) WithOriginUri(origin_uri string) ServiceRecordOriginUriIndexKey {
this.vs = []interface{}{origin_uri}
return this
}
type ServiceRecordControllerOriginUriIndexKey struct {
vs []interface{}
}
func (x ServiceRecordControllerOriginUriIndexKey) id() uint32 { return 2 }
func (x ServiceRecordControllerOriginUriIndexKey) values() []interface{} { return x.vs }
func (x ServiceRecordControllerOriginUriIndexKey) serviceRecordIndexKey() {}
func (this ServiceRecordControllerOriginUriIndexKey) WithController(controller string) ServiceRecordControllerOriginUriIndexKey {
this.vs = []interface{}{controller}
return this
}
func (this ServiceRecordControllerOriginUriIndexKey) WithControllerOriginUri(controller string, origin_uri string) ServiceRecordControllerOriginUriIndexKey {
this.vs = []interface{}{controller, origin_uri}
return this
}
type serviceRecordTable struct {
table ormtable.Table
}
func (this serviceTable) Insert(ctx context.Context, service *Service) error {
return this.table.Insert(ctx, service)
func (this serviceRecordTable) Insert(ctx context.Context, serviceRecord *ServiceRecord) error {
return this.table.Insert(ctx, serviceRecord)
}
func (this serviceTable) Update(ctx context.Context, service *Service) error {
return this.table.Update(ctx, service)
func (this serviceRecordTable) Update(ctx context.Context, serviceRecord *ServiceRecord) error {
return this.table.Update(ctx, serviceRecord)
}
func (this serviceTable) Save(ctx context.Context, service *Service) error {
return this.table.Save(ctx, service)
func (this serviceRecordTable) Save(ctx context.Context, serviceRecord *ServiceRecord) error {
return this.table.Save(ctx, serviceRecord)
}
func (this serviceTable) Delete(ctx context.Context, service *Service) error {
return this.table.Delete(ctx, service)
func (this serviceRecordTable) Delete(ctx context.Context, serviceRecord *ServiceRecord) error {
return this.table.Delete(ctx, serviceRecord)
}
func (this serviceTable) Has(ctx context.Context, id string) (found bool, err error) {
func (this serviceRecordTable) Has(ctx context.Context, id string) (found bool, err error) {
return this.table.PrimaryKey().Has(ctx, id)
}
func (this serviceTable) Get(ctx context.Context, id string) (*Service, error) {
var service Service
found, err := this.table.PrimaryKey().Get(ctx, &service, id)
func (this serviceRecordTable) Get(ctx context.Context, id string) (*ServiceRecord, error) {
var serviceRecord ServiceRecord
found, err := this.table.PrimaryKey().Get(ctx, &serviceRecord, id)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &service, nil
return &serviceRecord, nil
}
func (this serviceTable) List(ctx context.Context, prefixKey ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error) {
func (this serviceRecordTable) HasByOriginUri(ctx context.Context, origin_uri string) (found bool, err error) {
return this.table.GetIndexByID(1).(ormtable.UniqueIndex).Has(ctx,
origin_uri,
)
}
func (this serviceRecordTable) GetByOriginUri(ctx context.Context, origin_uri string) (*ServiceRecord, error) {
var serviceRecord ServiceRecord
found, err := this.table.GetIndexByID(1).(ormtable.UniqueIndex).Get(ctx, &serviceRecord,
origin_uri,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &serviceRecord, nil
}
func (this serviceRecordTable) HasByControllerOriginUri(ctx context.Context, controller string, origin_uri string) (found bool, err error) {
return this.table.GetIndexByID(2).(ormtable.UniqueIndex).Has(ctx,
controller,
origin_uri,
)
}
func (this serviceRecordTable) GetByControllerOriginUri(ctx context.Context, controller string, origin_uri string) (*ServiceRecord, error) {
var serviceRecord ServiceRecord
found, err := this.table.GetIndexByID(2).(ormtable.UniqueIndex).Get(ctx, &serviceRecord,
controller,
origin_uri,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &serviceRecord, nil
}
func (this serviceRecordTable) List(ctx context.Context, prefixKey ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return ServiceIterator{it}, err
return ServiceRecordIterator{it}, err
}
func (this serviceTable) ListRange(ctx context.Context, from, to ServiceIndexKey, opts ...ormlist.Option) (ServiceIterator, error) {
func (this serviceRecordTable) ListRange(ctx context.Context, from, to ServiceRecordIndexKey, opts ...ormlist.Option) (ServiceRecordIterator, error) {
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
return ServiceIterator{it}, err
return ServiceRecordIterator{it}, err
}
func (this serviceTable) DeleteBy(ctx context.Context, prefixKey ServiceIndexKey) error {
func (this serviceRecordTable) DeleteBy(ctx context.Context, prefixKey ServiceRecordIndexKey) error {
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
}
func (this serviceTable) DeleteRange(ctx context.Context, from, to ServiceIndexKey) error {
func (this serviceRecordTable) DeleteRange(ctx context.Context, from, to ServiceRecordIndexKey) error {
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
}
func (this serviceTable) doNotImplement() {}
func (this serviceRecordTable) doNotImplement() {}
var _ ServiceTable = serviceTable{}
var _ ServiceRecordTable = serviceRecordTable{}
func NewServiceTable(db ormtable.Schema) (ServiceTable, error) {
table := db.GetTable(&Service{})
func NewServiceRecordTable(db ormtable.Schema) (ServiceRecordTable, error) {
table := db.GetTable(&ServiceRecord{})
if table == nil {
return nil, ormerrors.TableNotFound.Wrap(string((&Service{}).ProtoReflect().Descriptor().FullName()))
return nil, ormerrors.TableNotFound.Wrap(string((&ServiceRecord{}).ProtoReflect().Descriptor().FullName()))
}
return serviceTable{table}, nil
return serviceRecordTable{table}, nil
}
type StateStore interface {
@@ -627,17 +1054,17 @@ type StateStore interface {
AttestationTable() AttestationTable
ControllerTable() ControllerTable
DelegationTable() DelegationTable
ServiceTable() ServiceTable
ServiceRecordTable() ServiceRecordTable
doNotImplement()
}
type stateStore struct {
assertion AssertionTable
attestation AttestationTable
controller ControllerTable
delegation DelegationTable
service ServiceTable
assertion AssertionTable
attestation AttestationTable
controller ControllerTable
delegation DelegationTable
serviceRecord ServiceRecordTable
}
func (x stateStore) AssertionTable() AssertionTable {
@@ -656,8 +1083,8 @@ func (x stateStore) DelegationTable() DelegationTable {
return x.delegation
}
func (x stateStore) ServiceTable() ServiceTable {
return x.service
func (x stateStore) ServiceRecordTable() ServiceRecordTable {
return x.serviceRecord
}
func (stateStore) doNotImplement() {}
@@ -685,7 +1112,7 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
return nil, err
}
serviceTable, err := NewServiceTable(db)
serviceRecordTable, err := NewServiceRecordTable(db)
if err != nil {
return nil, err
}
@@ -695,6 +1122,6 @@ func NewStateStore(db ormtable.Schema) (StateStore, error) {
attestationTable,
controllerTable,
delegationTable,
serviceTable,
serviceRecordTable,
}, nil
}
+1054 -285
View File
File diff suppressed because it is too large Load Diff
+3080 -861
View File
File diff suppressed because it is too large Load Diff
+36 -34
View File
@@ -20,8 +20,8 @@ const _ = grpc.SupportPackageIsVersion7
const (
Msg_UpdateParams_FullMethodName = "/did.v1.Msg/UpdateParams"
Msg_Authenticate_FullMethodName = "/did.v1.Msg/Authenticate"
Msg_ProveWitness_FullMethodName = "/did.v1.Msg/ProveWitness"
Msg_Authorize_FullMethodName = "/did.v1.Msg/Authorize"
Msg_AllocateVault_FullMethodName = "/did.v1.Msg/AllocateVault"
Msg_SyncVault_FullMethodName = "/did.v1.Msg/SyncVault"
Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController"
Msg_RegisterService_FullMethodName = "/did.v1.Msg/RegisterService"
@@ -35,10 +35,11 @@ type MsgClient interface {
//
// Since: cosmos-sdk 0.47
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)
// Authorize asserts the given controller is the owner of the given address.
Authorize(ctx context.Context, in *MsgAuthorize, opts ...grpc.CallOption) (*MsgAuthorizeResponse, error)
// AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database.
// this operation is called by services initiating a controller registration.
AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, 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.
@@ -64,18 +65,18 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
return out, nil
}
func (c *msgClient) Authenticate(ctx context.Context, in *MsgAuthenticate, opts ...grpc.CallOption) (*MsgAuthenticateResponse, error) {
out := new(MsgAuthenticateResponse)
err := c.cc.Invoke(ctx, Msg_Authenticate_FullMethodName, in, out, opts...)
func (c *msgClient) Authorize(ctx context.Context, in *MsgAuthorize, opts ...grpc.CallOption) (*MsgAuthorizeResponse, error) {
out := new(MsgAuthorizeResponse)
err := c.cc.Invoke(ctx, Msg_Authorize_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...)
func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) {
out := new(MsgAllocateVaultResponse)
err := c.cc.Invoke(ctx, Msg_AllocateVault_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
@@ -117,10 +118,11 @@ type MsgServer interface {
//
// Since: cosmos-sdk 0.47
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)
// Authorize asserts the given controller is the owner of the given address.
Authorize(context.Context, *MsgAuthorize) (*MsgAuthorizeResponse, error)
// AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database.
// this operation is called by services initiating a controller registration.
AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, 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.
@@ -137,11 +139,11 @@ type UnimplementedMsgServer struct {
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
}
func (UnimplementedMsgServer) Authenticate(context.Context, *MsgAuthenticate) (*MsgAuthenticateResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Authenticate not implemented")
func (UnimplementedMsgServer) Authorize(context.Context, *MsgAuthorize) (*MsgAuthorizeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Authorize not implemented")
}
func (UnimplementedMsgServer) ProveWitness(context.Context, *MsgProveWitness) (*MsgProveWitnessResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProveWitness not implemented")
func (UnimplementedMsgServer) AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented")
}
func (UnimplementedMsgServer) SyncVault(context.Context, *MsgSyncVault) (*MsgSyncVaultResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SyncVault not implemented")
@@ -183,38 +185,38 @@ func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(in
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)
func _Msg_Authorize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAuthorize)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).Authenticate(ctx, in)
return srv.(MsgServer).Authorize(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_Authenticate_FullMethodName,
FullMethod: Msg_Authorize_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).Authenticate(ctx, req.(*MsgAuthenticate))
return srv.(MsgServer).Authorize(ctx, req.(*MsgAuthorize))
}
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)
func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAllocateVault)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).ProveWitness(ctx, in)
return srv.(MsgServer).AllocateVault(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_ProveWitness_FullMethodName,
FullMethod: Msg_AllocateVault_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).ProveWitness(ctx, req.(*MsgProveWitness))
return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault))
}
return interceptor(ctx, in, info, handler)
}
@@ -285,12 +287,12 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
Handler: _Msg_UpdateParams_Handler,
},
{
MethodName: "Authenticate",
Handler: _Msg_Authenticate_Handler,
MethodName: "Authorize",
Handler: _Msg_Authorize_Handler,
},
{
MethodName: "ProveWitness",
Handler: _Msg_ProveWitness_Handler,
MethodName: "AllocateVault",
Handler: _Msg_AllocateVault_Handler,
},
{
MethodName: "SyncVault",