mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
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:
+69
-69
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user