feature/refactor types (#1101)

- **docs: remove discord badge from README**
- **fix: ensure go version is up-to-date**
- **<no value>**
- **refactor: update import paths for blocks to components**
- **feat: add Hero component template**
- **fix: update footer logo to svg**
- **feat: add Query/Sign and Query/Verify RPC methods**
- **refactor: rename Keyshares to KsVal in did/v1/state.proto**
This commit is contained in:
Prad Nukala
2024-09-29 14:40:36 -04:00
committed by GitHub
parent 91d8f523dd
commit d04c87de43
124 changed files with 7895 additions and 1072 deletions
+41
View File
@@ -17,6 +17,16 @@ service Query {
rpc Resolve(QueryRequest) returns (QueryResolveResponse) {
option (google.api.http).get = "/did/{did}";
}
// Sign signs a message with the DID document
rpc Sign(QuerySignRequest) returns (QuerySignResponse) {
option (google.api.http).post = "/did/{did}/sign";
}
// Verify verifies a message with the DID document
rpc Verify(QueryVerifyRequest) returns (QueryVerifyResponse) {
option (google.api.http).post = "/did/{did}/verify";
}
}
// Queryequest is the request type for the Query/Params RPC method.
@@ -39,6 +49,37 @@ message QueryResolveResponse {
Document document = 1;
}
// QuerySignRequest is the request type for the Query/Sign RPC method.
message QuerySignRequest {
string did = 1;
string origin = 2;
string key = 3;
string asset = 4;
string message = 5;
}
// QuerySignResponse is the response type for the Query/Sign RPC method.
message QuerySignResponse {
// signature is the signature of the message
string signature = 1;
}
// QueryVerifyRequest is the request type for the Query/Verify RPC method.
message QueryVerifyRequest {
string did = 1;
string origin = 2;
string key = 3;
string asset = 4;
string message = 5;
string signature = 6;
}
// QueryVerifyResponse is the response type for the Query/Verify RPC method.
message QueryVerifyResponse {
// valid is the validity of the signature
bool valid = 1;
}
// Document defines a DID document
message Document {
string id = 1;
+29 -6
View File
@@ -28,6 +28,15 @@ message Authentication {
// PubKey is the verification method
PubKey public_key = 4;
// CredentialID is the byte representation of the credential ID
bytes credential_id = 5;
// Metadata of the authentication
map<string, string> metadata = 6;
// CreationBlock is the block number of the creation of the authentication
int64 creation_block = 7;
}
// Controller represents a Sonr DWN Vault
@@ -78,14 +87,17 @@ message Controller {
// PubKey is the verification method
PubKey public_key = 6;
// Val Keyshare
// Pointer to the Keyshares
string ks_val = 7;
// The Status of the claims for the controller
bool claimed = 8;
// The block number of when a user claimed the controller
int64 claimed_block = 8;
// CreationBlock is the block number of the creation of the controller
int64 creation_block = 9;
}
// Verification reprsents a method of verifying membership in a DID
// Verification represents a verification method
message Verification {
option (cosmos.orm.v1.table) = {
id: 4
@@ -125,9 +137,20 @@ message Verification {
// The public key of the verification
PubKey public_key = 6;
// The Verification Type (Authentication, Assertion, CapabilityDelegation,
// CapabilityInvocation)
// The verification method type
string verification_type = 7;
// Metadata of the verification
map<string, string> metadata = 8;
// CreationBlock is the block number of the creation of the controller
int64 creation_block = 9;
}
message Keyshares {
string validator_cid = 1;
string user_cid = 2;
int64 last_updated_block = 3;
}
// PubKey defines a public key for a did
+4 -4
View File
@@ -17,9 +17,9 @@ service Msg {
// Since: cosmos-sdk 0.47
rpc UpdateParams(MsgUpdateParams) returns (MsgUpdateParamsResponse);
// AuthorizeService asserts the given controller is the owner of the given
// IssueMacaroon asserts the given controller is the owner of the given
// address.
rpc AuthorizeService(MsgIssueMacaroon) returns (MsgIssueMacaroonResponse);
rpc IssueMacaroon(MsgIssueMacaroon) returns (MsgIssueMacaroonResponse);
}
// MsgUpdateParams is the Msg/UpdateParams request type.
@@ -43,7 +43,7 @@ message MsgUpdateParams {
// Since: cosmos-sdk 0.47
message MsgUpdateParamsResponse {}
// MsgIssueMacaroon is the message type for the AuthorizeService RPC.
// MsgIssueMacaroon is the message type for the IssueMacaroon RPC.
message MsgIssueMacaroon {
option (cosmos.msg.v1.signer) = "controller";
@@ -60,7 +60,7 @@ message MsgIssueMacaroon {
string token = 4;
}
// MsgIssueMacaroonResponse is the response type for the AuthorizeService
// MsgIssueMacaroonResponse is the response type for the IssueMacaroon
// RPC.
message MsgIssueMacaroonResponse {
bool success = 1;
+14 -5
View File
@@ -10,13 +10,22 @@ option go_package = "github.com/onsonr/sonr/x/vault/types";
message DWN {
option (cosmos.orm.v1.table) = {
id: 1
primary_key: {fields: "account"}
primary_key: {
fields: "id"
auto_increment: true
}
index: {
id: 1
fields: "amount"
fields: "alias"
unique: true
}
index: {
id: 2
fields: "cid"
unique: true
}
};
bytes account = 1;
uint64 amount = 2;
uint64 id = 1;
string alias = 2;
string cid = 3;
}