-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathappencryption.proto
75 lines (60 loc) · 1.52 KB
/
appencryption.proto
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
65
66
67
68
69
70
71
72
73
74
75
syntax = "proto3";
package asherah.apps.server;
option go_package = "api;api";
option java_package = "com.godaddy.asherah.grpc";
option java_outer_classname = "AppEncryptionProtos";
service AppEncryption {
// Performs session operations for a single partition.
//
// Each session must begin with a GetSession message with all subsequent
// Encrypt and Decrypt operations scoped its partition.
rpc Session (stream SessionRequest) returns (stream SessionResponse);
}
// SessionRequest represents an operation on an individual session
message SessionRequest {
oneof request {
Encrypt encrypt = 1;
Decrypt decrypt = 2;
GetSession get_session = 3;
}
}
message Encrypt {
bytes data = 1;
}
message Decrypt {
DataRowRecord data_row_record = 1;
}
// DataRowRecord represents an envelope containing data encypted by a DRK, the
// encrypted DRK itself, and meta data of the key used to encrypt the DRK.
message DataRowRecord {
EnvelopeKeyRecord key = 1;
bytes data = 2;
}
message EnvelopeKeyRecord {
int64 created = 1;
bytes key = 2;
KeyMeta parent_key_meta = 3;
}
message KeyMeta {
int64 created = 1;
string key_id = 2;
}
message GetSession {
string partition_id = 1;
}
message ErrorResponse {
string message = 1;
}
message EncryptResponse {
DataRowRecord data_row_record = 1;
}
message DecryptResponse {
bytes data = 1;
}
message SessionResponse {
oneof response {
EncryptResponse encrypt_response = 1;
DecryptResponse decrypt_response = 2;
ErrorResponse error_response = 3;
}
}