Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ATL-1774] feat(iris): Define Castor and Pollux specific protobuf mod…
…els (#41) * [ATL-1774] feat(iris): Define Castor and Pollux specific protobuf models. Also Iris service protobuf
- Loading branch information
Showing
10 changed files
with
226 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## gRPC API ## | ||
|
||
We use gRPC messages for both: interactions with Iris, and also to serialise messages which reside in the DLT. | ||
|
||
`protocol` folder contains only definitions which are posted to the DLT and | ||
basically define low-level protocol operations. | ||
|
||
Files outside the `protocol` folder describe messages and services which are used in gRPC interface of Iris, | ||
using protocol messages in their definitions. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
syntax = "proto3"; | ||
|
||
import "scalapb/scalapb.proto"; | ||
|
||
option (scalapb.options) = { | ||
no_default_values_in_constructor: true | ||
package_name: "io.iohk.atala.iris.proto" | ||
}; | ||
|
||
message PublicKeyJwk { | ||
message ECKeyData { | ||
string curve = 1; // The curve name, like secp256k1. | ||
bytes x = 2; // The x coordinate, represented as bytes. | ||
bytes y = 3; // The y coordinate, represented as bytes. | ||
} | ||
|
||
oneof key { | ||
ECKeyData ec_key = 1; | ||
} | ||
} | ||
|
||
message DocumentDefinition { | ||
message PublicKey { | ||
string id = 1; | ||
|
||
enum Type { | ||
SECP256K1 = 0; | ||
} | ||
Type type = 2; | ||
|
||
PublicKeyJwk jwk = 3; | ||
|
||
enum Purpose { | ||
AUTHENTICATION = 0; | ||
KEY_AGREEMENT = 1; | ||
ASSERTION_METHOD = 2; | ||
CAPABILITY_INVOCATION = 3; | ||
} | ||
Purpose purpose = 4; | ||
} | ||
|
||
message Service { | ||
string id = 1; | ||
enum Type { | ||
MEDIATOR_SERVICE = 0; | ||
} | ||
Type type = 2; | ||
string service_endpoint = 3; | ||
} | ||
|
||
repeated PublicKey public_keys = 1; | ||
repeated Service services = 2; | ||
} | ||
|
||
message CreateDid { | ||
bytes initial_update_commitment = 1; | ||
bytes initial_recovery_commitment = 2; | ||
string storage = 3; | ||
DocumentDefinition document = 4; | ||
} | ||
|
||
message UpdateDid { | ||
message Patch { | ||
oneof patch { | ||
DocumentDefinition.PublicKey add_public_key = 1; | ||
string remove_public_key = 2; | ||
DocumentDefinition.Service add_service = 3; | ||
string remove_service = 4; | ||
} | ||
} | ||
|
||
string did = 1; | ||
bytes revealed_update_key = 2; | ||
bytes previous_version = 3; | ||
bytes forward_update_commitment = 4; | ||
repeated Patch patches = 5; | ||
bytes signature = 6; | ||
} | ||
|
||
message RecoverDid { | ||
string did = 1; | ||
bytes revealed_recovery_key = 2; | ||
bytes previous_version = 3; | ||
bytes forward_update_commitment = 4; | ||
bytes forward_recovery_commitment = 5; | ||
repeated DocumentDefinition document = 6; | ||
bytes signature = 7; | ||
} | ||
|
||
message DeactivateDid { | ||
string did = 1; | ||
bytes revealed_recovery_key = 2; | ||
bytes previous_version = 3; | ||
bytes signature = 4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
syntax = "proto3"; | ||
|
||
import "scalapb/scalapb.proto"; | ||
import "protocol/vc_operations.proto"; | ||
import "protocol/did_operations.proto"; | ||
|
||
option (scalapb.options) = { | ||
no_default_values_in_constructor: true | ||
package_name: "io.iohk.atala.iris.proto" | ||
}; | ||
|
||
// The possible operations affecting the blockchain. | ||
message IrisOperation { | ||
// The actual operation. | ||
oneof operation { | ||
// Used to create a public DID. | ||
CreateDid create_did = 1; | ||
|
||
// Used to update an existing public DID. | ||
UpdateDid update_did = 2; | ||
|
||
// Used to recover an existing public DID. | ||
RecoverDid recover_did = 3; | ||
|
||
// Used to deactivate DID | ||
DeactivateDid deactivate_did = 4; | ||
|
||
IssueCredentialsBatch issue_credentials_batch = 5; | ||
|
||
RevokeCredentials revoke_credentials = 6; | ||
}; | ||
} | ||
|
||
// List of operations which will be stored in the blockchain transaction metadata | ||
message AtalaObject { | ||
repeated IrisOperation operations = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
syntax = "proto3"; | ||
|
||
import "scalapb/scalapb.proto"; | ||
|
||
option (scalapb.options) = { | ||
no_default_values_in_constructor: true | ||
package_name: "io.iohk.atala.iris.proto" | ||
}; | ||
|
||
message IssueCredentialsBatch { | ||
string issuer_did = 1; | ||
bytes merkle_root = 2; | ||
} | ||
|
||
message RevokeCredentials { | ||
string revoker_did = 1; | ||
bytes issuance_batch_digest = 2; | ||
repeated bytes credentials_to_revoke = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
syntax = "proto3"; | ||
|
||
import "scalapb/scalapb.proto"; | ||
import "protocol/did_operations.proto"; | ||
import "protocol/vc_operations.proto"; | ||
import "protocol/dlt.proto"; | ||
|
||
option (scalapb.options) = { | ||
no_default_values_in_constructor: true | ||
package_name: "io.iohk.atala.iris.proto" | ||
}; | ||
|
||
message IrisOperationId { | ||
bytes id = 1; | ||
} | ||
|
||
message IrisOperationOutcome { | ||
bytes operation_id = 1; | ||
} | ||
|
||
enum IrisOperationStatus { | ||
PENDING = 0; | ||
SUBMITTED = 1; | ||
ROLLED_BACK = 2; | ||
CONFIRMED = 3; | ||
}; | ||
|
||
message IrisOperationInfo { | ||
bytes operationId = 1; | ||
oneof operation { | ||
CreateDid create_did = 2; | ||
UpdateDid update_did = 3; | ||
RecoverDid recovery_did = 4; | ||
DeactivateDid deactivate_did = 5; | ||
} | ||
} | ||
|
||
service IrisService { | ||
rpc ScheduleOperation(IrisOperation) returns (IrisOperationOutcome) {} | ||
rpc GetOperation(IrisOperationId) returns (IrisOperationInfo) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 22 additions & 3 deletions
25
...server/src/main/scala/io/iohk/atala/iris/apiserver/grpc/service/IrisServiceGrpcImpl.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters