gRPCServices.proto 1.64 KB
Newer Older
Axel's avatar
Axel committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
syntax = "proto3";

package api;

service Platform {
	rpc Register(RegisterRequest) returns (ErrorCode) {}
	rpc Auth(AuthRequest) returns (RegisteredUser) {}
	rpc Unregister(Empty) returns (ErrorCode) {}
	rpc PostContract(PostContractRequest) returns (ErrorCode) {}
	rpc JoinSignature(JoinSignatureRequest) returns (ErrorCode) {}
	rpc ReadySign(ReadySignRequest) returns (ErrorCode) {}
}

// RegisterRequest message contains the client's email adress and his
// public key
message RegisterRequest {
	string email = 1;
	string key = 2;
}

// ErrorCode message contains an error code (see dffs/dfssp/api/errorCodes.go)
// and a message
message ErrorCode {
	int32 code = 1;
	string message = 2;
}

// AuthRequest message contains the client's email adress and the token used
// for authentication
message AuthRequest {
	string email = 1;
	string token = 2;
}

// RegisteredUser message contains the generated client certificate
// and the CA root certificate (PEM-encoded)
message RegisteredUser {
	bytes rootCert = 1;
	bytes clientCert = 2;
}

// Empty message is an empty message
message Empty {
}

// PostContractRequest message contains the contract as SHA-512 hash, the list of signers
// as an array of string, and a comment
message PostContractRequest {
	string contract = 1;
	repeated string signer = 2;
	string comment = 3;
}

// JoinSignatureRequest message contains the contract to join unique identifier
// and the port the client will be listening at
message JoinSignatureRequest {
	string contractUuid = 1;
	uint32 port  =2;
}

// ReadySignRequest contains the contract unique identitier that is ready to be signed
message ReadySignRequest {
	string contractUuid = 1;
}