feat(did): remove unused proto files

This commit is contained in:
Prad Nukala
2024-09-14 14:46:09 -04:00
parent 001000da14
commit 8f234dc561
13 changed files with 34 additions and 5800 deletions
-4
View File
@@ -1,4 +0,0 @@
syntax = "proto3";
package did.v1;
option go_package = "github.com/onsonr/hway/x/did/types";
-24
View File
@@ -1,24 +0,0 @@
syntax = "proto3";
package did.v1;
import "gogoproto/gogo.proto";
import "amino/amino.proto";
option go_package = "github.com/onsonr/hway/x/did/types";
// PermissionScope define the Capabilities Controllers can grant for Services
enum PermissionScope {
PERMISSION_SCOPE_UNSPECIFIED = 0;
PERMISSION_SCOPE_PROFILE_NAME = 1;
PERMISSION_SCOPE_IDENTIFIERS_EMAIL = 2;
PERMISSION_SCOPE_IDENTIFIERS_PHONE = 3;
PERMISSION_SCOPE_TRANSACTIONS_READ = 4;
PERMISSION_SCOPE_TRANSACTIONS_WRITE = 5;
PERMISSION_SCOPE_WALLETS_READ = 6;
PERMISSION_SCOPE_WALLETS_CREATE = 7;
PERMISSION_SCOPE_WALLETS_SUBSCRIBE = 8;
PERMISSION_SCOPE_WALLETS_UPDATE = 9;
PERMISSION_SCOPE_TRANSACTIONS_VERIFY = 10;
PERMISSION_SCOPE_TRANSACTIONS_BROADCAST = 11;
PERMISSION_SCOPE_ADMIN_USER = 12;
PERMISSION_SCOPE_ADMIN_VALIDATOR = 13;
}
-45
View File
@@ -5,9 +5,6 @@ import "amino/amino.proto";
import "gogoproto/gogo.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
import "did/v1/types.proto";
option go_package = "github.com/onsonr/hway/x/did/types";
// GenesisState defines the module genesis state
message GenesisState {
@@ -81,47 +78,6 @@ message KeyInfo {
KeyType type = 5; // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC"
}
// ValidatorInfo defines information for accepted Validator nodes
message ValidatorInfo {
string moniker = 1;
repeated Endpoint grpc_endpoints = 2;
repeated Endpoint rest_endpoints = 3;
ExplorerInfo explorer = 4;
FeeInfo fee_info = 5;
IBCChannel ibc_channel = 6;
// Endpoint defines an endpoint
message Endpoint {
string url = 1;
bool is_primary = 2;
}
// ExplorerInfo defines the explorer info
message ExplorerInfo {
string name = 1;
string url = 2;
}
// FeeInfo defines a fee info
message FeeInfo {
string base_denom = 1;
repeated string fee_rates = 2;
int32 init_gas_limit = 3;
bool is_simulable = 4;
double gas_multiply = 5;
}
// IBCChannel defines the IBC channel info
message IBCChannel {
string id = 1;
string port = 2;
}
}
//
// [Constant Enumerations]
//
// AssetType defines the type of asset: native, wrapped, staking, pool, or unspecified
enum AssetType {
ASSET_TYPE_UNSPECIFIED = 0;
@@ -226,4 +182,3 @@ enum PermissionScope {
PERMISSION_SCOPE_ADMIN_USER = 12;
PERMISSION_SCOPE_ADMIN_VALIDATOR = 13;
}
+20 -103
View File
@@ -4,7 +4,6 @@ package did.v1;
import "did/v1/genesis.proto";
import "did/v1/models.proto";
import "google/api/annotations.proto";
import "did/v1/types.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
@@ -16,39 +15,34 @@ service Query {
}
// ParamsAssets queries all parameters of the module.
rpc ParamsAssets(QueryRequest) returns (QueryResponse) {
rpc ParamsAssets(QueryRequest) returns (QueryParamsAssetsResponse) {
option (google.api.http).get = "/params/assets";
}
// Params queries all parameters of the module.
rpc ParamsByAsset(QueryRequest) returns (QueryResponse) {
rpc ParamsByAsset(QueryRequest) returns (QueryParamsByAssetResponse) {
option (google.api.http).get = "/params/assets/{asset}";
}
// ParamsKeys queries all parameters of the module.
rpc ParamsKeys(QueryRequest) returns (QueryResponse) {
rpc ParamsKeys(QueryRequest) returns (QueryParamsKeysResponse) {
option (google.api.http).get = "/params/keys";
}
// Params queries all parameters of the module.
rpc ParamsByKey(QueryRequest) returns (QueryResponse) {
rpc ParamsByKey(QueryRequest) returns (QueryParamsByKeyResponse) {
option (google.api.http).get = "/params/keys/{key}";
}
// Params queries all parameters of the module.
rpc RegistrationOptionsByKey(QueryRequest) returns (QueryResponse) {
option (google.api.http).get = "/params/keys/{key}/registration";
}
// Resolve queries the DID document by its id.
rpc Resolve(QueryRequest) returns (QueryResponse) {
rpc Resolve(QueryRequest) returns (QueryResolveResponse) {
option (google.api.http).get = "/did/{did}";
}
// Service returns associated ServiceInfo for a given Origin
// if the servie is not found, a fingerprint is generated to be used
// as a TXT record in DNS. v=sonr, o=origin, p=protocol
rpc Service(QueryRequest) returns (QueryResponse) {
rpc Service(QueryRequest) returns (QueryServiceResponse) {
option (google.api.http).get = "/service/{origin}";
}
}
@@ -66,104 +60,21 @@ message QueryResponse {
bool success = 1;
string query = 2;
Document document = 3;
ServiceInfo service = 4;
Params params = 5;
}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
Params params = 1;
}
message QueryParamsAssetsResponse {
repeated AssetInfo assets = 1;
// Accounts returns associated wallet accounts with the DID.
rpc Accounts(QueryAccountsRequest) returns (QueryAccountsResponse) {
option (google.api.http).get = "/did/{did}/accounts";
}
// Credentials returns associated credentials with the DID and Service Origin.
rpc Credentials(QueryCredentialsRequest) returns (QueryCredentialsResponse) {
option (google.api.http).get = "/did/{did}/{origin}/credentials";
}
// Identities returns associated identity with the DID.
rpc Identities(QueryIdentitiesRequest) returns (QueryIdentitiesResponse) {
option (google.api.http).get = "/did/{did}/identities";
}
// Resolve queries the DID document by its id.
rpc Resolve(QueryResolveRequest) returns (QueryResolveResponse) {
option (google.api.http).get = "/did/resolve/{did}";
}
// Service returns associated ServiceInfo for a given Origin
rpc Service(QueryServiceRequest) returns (QueryServiceResponse) {
option (google.api.http).get = "/did/service/{origin}";
}
}
// QueryParamsRequest is the request type for the Query/Params RPC method.
message QueryParamsRequest {}
// QueryParamsResponse is the response type for the Query/Params RPC method.
message QueryParamsResponse {
// params defines the parameters of the module.
Params params = 1;
}
// QueryAccountsRequest is the request type for the Query/Exists RPC method.
message QueryAccountsRequest {
string did = 1;
message QueryParamsAssetsResponse {
repeated AssetInfo assets = 1;
}
// QueryAccountsResponse is the response type for the Query/Exists RPC method.
message QueryAccountsResponse {
bool exists = 1;
}
// QueryCredentialsRequest is the request type for the Query/Exists RPC method.
message QueryCredentialsRequest {
string did = 1;
string origin = 2;
}
// QueryCredentialsResponse is the response type for the Query/Exists RPC method.
message QueryCredentialsResponse {
map<string, bytes> credentials = 1;
}
// QueryIdentitiesRequest is the request type for the Query/Exists RPC method.
message QueryIdentitiesRequest {
string did = 1;
}
// QueryIdentitiesResponse is the response type for the Query/Exists RPC method.
message QueryIdentitiesResponse {
bool exists = 1;
repeated VerificationMethod verificationMethod = 2;
}
// QueryResolveRequest is the request type for the Query/Resolve RPC method.
message QueryResolveRequest {
string did = 1;
}
// QueryResolveResponse is the response type for the Query/Resolve RPC method.
message QueryResolveResponse {
// document is the DID document
Document document = 1;
}
// QueryServiceRequest is the request type for the Query/LoginOptions RPC method.
message QueryServiceRequest {
string origin = 1;
}
// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method.
message QueryServiceResponse {
// options is the PublicKeyCredentialAttestationOptions
string options = 1;
message QueryParamsByAssetResponse {
AssetInfo asset = 1;
}
message QueryParamsKeysResponse {
@@ -174,10 +85,16 @@ message QueryParamsByKeyResponse {
KeyInfo key = 1;
}
message QueryParamsByAssetResponse {
AssetInfo asset = 1;
// QueryResolveResponse is the response type for the Query/Resolve RPC method.
message QueryResolveResponse {
// document is the DID document
Document document = 1;
}
message QueryRegistrationOptionsByKeyResponse {
repeated string registration_options = 1;
// QueryLoginOptionsResponse is the response type for the Query/LoginOptions RPC method.
message QueryServiceResponse {
// options is the PublicKeyCredentialAttestationOptions
bool existing = 1;
ServiceInfo service = 2;
string txt_record = 3;
}
+8 -14
View File
@@ -3,9 +3,9 @@ syntax = "proto3";
package did.v1;
import "cosmos/orm/v1/orm.proto";
import "did/v1/enums.proto";
import "did/v1/genesis.proto";
import "did/v1/models.proto";
import "did/v1/enums.proto";
option go_package = "github.com/onsonr/sonr/x/did/types";
@@ -29,8 +29,12 @@ message Account {
fields: "controller,chain_code,index"
unique: true
}
index: { id: 1, fields: "subject", unique: true }
};
index: {
id: 1
fields: "subject"
unique: true
}
};
// The unique identifier of the alias
string id = 1;
@@ -51,7 +55,7 @@ message Account {
// Assertion represents strongly created credentials (e.g., Passkeys, SSH, GPG, Native Secure Enclaave)
message Assertion {
option (cosmos.orm.v1.table) = {
id: 2
id: 2
primary_key: {fields: "id"}
};
@@ -216,14 +220,4 @@ message VerificationMethod {
// The public key of the verification
PubKey public_key = 6;
// The controller DID of the service
string controller_did = 3;
// The domain name of the service
string origin_uri = 4;
// The service endpoint
map<string, string> service_endpoints = 5;
// Scopes is the Authorization Grants of the service
repeated PermissionScope scopes = 6;
}
+6 -118
View File
@@ -3,10 +3,8 @@ syntax = "proto3";
package did.v1;
import "cosmos/msg/v1/msg.proto";
import "did/v1/enums.proto";
import "did/v1/genesis.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "did/v1/enums.proto";
import "did/v1/genesis.proto";
import "did/v1/models.proto";
import "gogoproto/gogo.proto";
@@ -36,20 +34,6 @@ service Msg {
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
rpc RegisterService(MsgRegisterService) returns (MsgRegisterServiceResponse);
// Authenticate asserts the given controller is the owner of the given address.
rpc Authenticate(MsgAuthenticate) returns (MsgAuthenticateResponse);
// ProveWitness is an operation to prove the controller has a valid property using ZK Accumulators.
rpc ProveWitness(MsgProveWitness) returns (MsgProveWitnessResponse);
// SyncVault synchronizes the controller with the Vault Motr DWN WASM Wallet.
rpc SyncVault(MsgSyncVault) returns (MsgSyncVaultResponse);
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias.
rpc RegisterController(MsgRegisterController) returns (MsgRegisterControllerResponse);
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key.
rpc RegisterService(MsgRegisterService) returns (MsgRegisterServiceResponse);
}
// MsgUpdateParams is the Msg/UpdateParams request type.
@@ -103,32 +87,6 @@ message MsgAllocateVaultResponse {
bool localhost = 4;
}
// MsgProveWitness is the message type for the ProveWitness RPC.
message MsgProveWitness {
option (cosmos.msg.v1.signer) = "authority";
// MsgAuthenticate is the message type for the Authenticate RPC.
message MsgAuthenticate {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// property is key to prove.
string property = 2;
// Witness Value is the bytes of the witness.
bytes witness = 3;
// token is the macron token to authenticate the operation.
string token = 4;
}
// MsgProveWitnessResponse is the response type for the ProveWitness RPC.
message MsgProveWitnessResponse {
bool success = 1;
string property = 2;
}
// MsgSyncController is the message type for the SyncController RPC.
message MsgSyncController {
option (cosmos.msg.v1.signer) = "controller";
@@ -147,71 +105,19 @@ message MsgSyncControllerResponse {
// MsgRegisterController is the message type for the InitializeController RPC.
message MsgRegisterController {
// MsgAuthenticateResponse is the response type for the Authenticate RPC.
message MsgAuthenticateResponse {}
// MsgProveWitness is the message type for the ProveWitness RPC.
message MsgProveWitness {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Assertions is the list of assertions to initialize the controller with.
string cid = 2;
repeated bytes assertions = 2;
// Origin is the origin of the request in wildcard form.
string origin = 3;
// Keyshares is the list of keyshares to initialize the controller with.
repeated bytes keyshares = 3;
// Credential is the list of keyshares to initialize the controller with.
string credential_creation_response = 4;
// property is key to prove.
string property = 2;
// Witness Value is the bytes of the witness.
bytes witness = 3;
}
// MsgProveWitnessResponse is the response type for the ProveWitness RPC.
message MsgProveWitnessResponse {
bool success = 1;
string property = 2;
}
// MsgSyncVault is the message type for the SyncVault RPC.
message MsgSyncVault {
option (cosmos.msg.v1.signer) = "controller";
// controller is the address of the controller to sync.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// cid is the IPFS content identifier.
string cid = 2;
// Macroon is the public token to authenticate the operation.
bytes macron = 3;
}
// MsgSyncVaultResponse is the response type for the SyncVault RPC.
message MsgSyncVaultResponse {
bool success = 1;
}
// MsgRegisterController is the message type for the InitializeController RPC.
message MsgRegisterController {
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Assertions is the list of assertions to initialize the controller with.
repeated bytes assertions = 2;
// Keyshares is the list of keyshares to initialize the controller with.
repeated bytes keyshares = 3;
// Verifications is the list of verifications to initialize the controller with.
repeated bytes verifications = 4;
// Verifications is the list of verifications to initialize the controller with.
repeated bytes verifications = 4;
}
// MsgRegisterControllerResponse is the response type for the InitializeController RPC.
@@ -247,11 +153,6 @@ message MsgAuthorizeService {
message MsgAuthorizeServiceResponse {
bool success = 1;
string token = 2;
// Controller is the address of the initialized controller.
string controller = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// Accounts are a Address Map and Supported coin Denoms for the controller
map<string, string> accounts = 2;
}
// MsgRegisterService is the message type for the RegisterService RPC.
@@ -263,19 +164,6 @@ message MsgRegisterService {
// origin is the origin of the request in wildcard form. Requires valid TXT record in DNS.
Service service = 2;
// token is the macron token to authenticate the operation.
string token = 3;
option (cosmos.msg.v1.signer) = "authority";
// authority is the address of the governance account.
string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
// origin is the origin of the request in wildcard form.
string origin_uri = 2;
// PermissionScope is the scope of the service.
repeated PermissionScope scopes = 3;
}
// MsgRegisterServiceResponse is the response type for the RegisterService RPC.
-114
View File
@@ -1,114 +0,0 @@
syntax = "proto3";
package did.v1;
import "cosmos/msg/v1/msg.proto";
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
option go_package = "github.com/onsonr/hway/x/did/types";
// AssetInfo defines the asset info
message AssetInfo {
string id = 1;
string denom = 2;
string symbol = 3;
string asset_type = 4;
string origin_chain = 5;
string origin_denom = 6;
int32 decimals = 7;
string description = 8;
string image_url = 9;
string coingecko_id = 10;
bool is_enabled = 11;
string ibc_path = 12;
string ibc_channel = 13;
string ibc_port = 14;
}
// ChainInfo defines the chain info
message ChainInfo {
string id = 1;
string chain_id = 2;
string name = 3;
string symbol = 4;
string bech32_prefix = 5;
string genesis_time = 6;
repeated Endpoint grpc_endpoints = 7;
repeated Endpoint rest_endpoints = 8;
ExplorerInfo explorer = 9;
FeeInfo fee_info = 10;
}
// Credential defines a WebAuthn credential
message Credential {
string id = 1;
string credential_type = 2;
bytes credential_id = 3;
repeated string transport = 4;
string attestation_type = 5;
string display_name = 6;
string controller = 7;
}
// Document defines a DID document
message Document {
string id = 1;
repeated VerificationMethod verification_methods = 2;
repeated string authentication = 4;
repeated string assertion_method = 5;
repeated string capability_delegation = 7;
repeated string capability_invocation = 8;
}
// Endpoint defines an endpoint
message Endpoint {
string url = 1;
bool is_primary = 2;
}
// ExplorerInfo defines the explorer info
message ExplorerInfo {
string name = 1;
string url = 2;
}
// FeeInfo defines a fee info
message FeeInfo {
string base_denom = 1;
repeated string fee_rates = 2;
int32 init_gas_limit = 3;
bool is_simulable = 4;
double gas_multiply = 5;
}
// Identity defines an associated profile for a did subject
message Identity {
string id = 1;
string subject = 2;
string controller = 3;
repeated Credential credentials = 4;
repeated VerificationMethod verification_methods = 5;
}
// PubKey defines a public key for a did
message PubKey {
string id = 1;
bytes key = 2;
string key_type = 3;
string controller = 4;
}
// VerificationMethod defines a verification method
message VerificationMethod {
string id = 1;
string controller = 2;
// The delegation proof or verification method
string public_key_multibase = 3;
// Public Key JWKS is a map of the associated public keys
map<string, string> public_key_jwks = 4;
}