Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(grpc): enhance domain grpc services #1381

Merged
merged 8 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 52 additions & 28 deletions bindings/grpc/proto/domain_linkage.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,53 @@
syntax = "proto3";
package domain_linkage;

message ValidateDidResponse {
string did = 1;
message Domains {
message ValidDomain {
string url = 1;
string credential = 2;
string service_id = 3;
}

repeated ValidDomain valid = 1;
wulfraem marked this conversation as resolved.
Show resolved Hide resolved

message InvalidDomain {
string url = 1;
optional string credential = 2;
string service_id = 3;
string error = 4;
}

repeated InvalidDomain invalid = 2;
}
Domains domains = 2;
}

message ValidateDomainResponse {
string domain = 1;
message LinkedDids {

itsyaasir marked this conversation as resolved.
Show resolved Hide resolved
message ValidDid {
string did = 1;
string credential = 2;
string service_id = 3;
}

repeated ValidDid valid = 1;

message InvalidDid {
optional string did = 1;
optional string credential = 2;
optional string service_id = 3;
string error = 4;
}

repeated InvalidDid invalid = 2;
}
LinkedDids linked_dids = 2;
}

message ValidateDomainRequest {
// domain to validate
string domain = 1;
Expand All @@ -16,27 +63,6 @@ message ValidateDomainAgainstDidConfigurationRequest {
string did_configuration = 2;
}

message LinkedDidValidationStatus {
// validation succeeded or not, `error` property is added for `false` cases
bool valid = 1;
// credential from `linked_dids` as compact JWT domain linkage credential if it could be retrieved
optional string document = 2;
// an error message, that occurred when validated, omitted if valid
optional string error = 3;
}

message ValidateDomainResponse {
// list of JWT domain linkage credential, uses the same order as the `did-configuration.json` file for domain
repeated LinkedDidValidationStatus linked_dids = 1;
}

message LinkedDidEndpointValidationStatus {
// id of service endpoint entry
string id = 1;
// list of JWT domain linkage credential, uses the same order as the `did-configuration.json` file for domain
repeated LinkedDidValidationStatus service_endpoint = 2;
}

message ValidateDidRequest {
// DID to validate
string did = 1;
Expand All @@ -49,15 +75,13 @@ message ValidateDidAgainstDidConfigurationsRequest {
repeated ValidateDomainAgainstDidConfigurationRequest did_configurations = 2;
}

message ValidateDidResponse {
// mapping of service entries from DID with validation status for endpoint URLs
repeated LinkedDidEndpointValidationStatus service = 1;
}

service DomainLinkage {
rpc validate_domain(ValidateDomainRequest) returns (ValidateDomainResponse);
rpc validate_domain_against_did_configuration(ValidateDomainAgainstDidConfigurationRequest) returns (ValidateDomainResponse);
rpc validate_domain_against_did_configuration(
ValidateDomainAgainstDidConfigurationRequest)
returns (ValidateDomainResponse);

rpc validate_did(ValidateDidRequest) returns (ValidateDidResponse);
rpc validate_did_against_did_configurations(ValidateDidAgainstDidConfigurationsRequest) returns (ValidateDidResponse);
rpc validate_did_against_did_configurations(
ValidateDidAgainstDidConfigurationsRequest) returns (ValidateDidResponse);
}
8 changes: 8 additions & 0 deletions bindings/grpc/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
comment_width = 120
format_code_in_doc_comments = true
max_width = 120
normalize_comments = false
normalize_doc_attributes = false
tab_spaces = 2
wrap_comments = true
imports_granularity = "Item"
Loading
Loading