forked from futo-org/Harbor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpolycentric.proto
More file actions
487 lines (405 loc) · 10.8 KB
/
Copy pathpolycentric.proto
File metadata and controls
487 lines (405 loc) · 10.8 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
syntax = "proto3";
package polycentric;
enum ContentType {
UNKNOWN = 0;
DELETE = 1;
SYSTEM_PROCESSES = 2;
POST = 3;
FOLLOW = 4;
USERNAME = 5;
DESCRIPTION = 6;
BLOB_META = 7;
BLOB_SECTION = 8;
AVATAR = 9;
SERVER = 10;
VOUCH = 11;
CLAIM = 12;
BANNER = 13;
OPINION = 14;
STORE = 15;
AUTHORITY = 16;
JOIN_TOPIC = 17;
BLOCK = 18;
}
enum Opinion {
UNSPECIFIED = 0;
LIKE = 1;
DISLIKE = 2;
NEUTRAL = 3;
}
message PublicKey {
uint64 key_type = 1;
bytes key = 2;
}
message PrivateKey {
uint64 key_type = 1;
bytes key = 2;
}
message VectorClock {
repeated uint64 logical_clocks = 1;
}
message Index {
uint64 index_type = 1;
uint64 logical_clock = 2;
}
message Indices {
repeated Index indices = 1;
}
message Process {
bytes process = 1;
}
message Digest {
enum DigestType {
Unknown = 0;
SHA256 = 1;
}
uint64 digest_type = 1;
bytes digest = 2;
}
message Pointer {
PublicKey system = 1;
Process process = 2;
uint64 logical_clock = 3;
Digest event_digest = 4;
}
message LWWElementSet {
enum Operation {
ADD = 0;
REMOVE = 1;
}
Operation operation = 1;
bytes value = 2;
uint64 unix_milliseconds = 3;
}
message LWWElement {
bytes value = 1;
uint64 unix_milliseconds = 2;
}
message Reference {
enum ReferenceType {
Unknown = 0;
System = 1;
Pointer = 2;
Bytes = 3;
}
uint64 reference_type = 1;
bytes reference = 2;
}
message ProcessSecret {
PrivateKey system = 1;
Process process = 2;
}
message ModerationTag {
string name = 1;
uint32 level = 2;
}
message SignedEvent {
bytes signature = 1;
bytes event = 2;
repeated ModerationTag moderation_tags = 3;
}
message Events {
repeated SignedEvent events = 1;
}
message Post {
string content = 1;
optional ImageManifest image = 2;
}
message ImageManifest {
string mime = 1;
uint32 width = 2;
uint32 height = 3;
bytes digest = 4;
}
message ImageBundle {
repeated ImageManifest images = 1;
}
message Claim {
uint64 claim_type = 1;
repeated ClaimFieldEntry fields = 2;
}
message ClaimFieldEntry {
uint64 key = 1;
string value = 2;
}
message Delete {
Process process = 1;
uint64 logical_clock = 2;
Indices indices = 3;
optional uint64 unix_milliseconds = 4;
ContentType content_type = 5;
}
message SystemProcesses {
repeated Process processes = 1;
}
message SystemState {
repeated string servers = 1;
repeated string authorities = 2;
repeated Process processes = 3;
}
message ProcessState {
uint64 logical_clock = 1;
uint64 unix_milliseconds = 2;
repeated Range ranges = 3;
}
message Range {
uint64 low = 1;
uint64 high = 2;
}
message RangesForProcess {
Process process = 1;
repeated Range ranges = 2;
}
message RangesForSystem {
repeated RangesForProcess ranges_for_processes = 1;
}
message OpinionSummary {
uint64 like_count = 1;
uint64 dislike_count = 2;
uint64 neutral_count = 3;
optional uint32 user_opinion = 4;
}
message BlobMeta {
string mime = 1;
uint64 size = 2;
repeated BlobSection sections = 3;
}
message BlobSection {
bytes digest = 1;
uint64 size = 2;
}
message URLInfo {
uint64 url_type = 1;
bytes body = 2;
}
message URLInfoSystemLink {
PublicKey system = 1;
repeated string servers = 2;
}
message URLInfoEventLink {
PublicKey system = 1;
Process process = 2;
uint64 logical_clock = 3;
repeated string servers = 4;
}
message ExportBundle {
repeated SignedEvent events = 1;
repeated URLInfoSystemLink system_links = 2;
repeated URLInfoEventLink event_links = 3;
}
message HarborChallengeResponse {
HarborChallengeResponseBody body = 1;
bytes signature = 2;
}
message HarborChallengeResponseBody {
string challenge = 1;
uint64 unix_milliseconds = 2;
}
message HarborValidateRequest {
string solution = 1;
HarborChallengeResponse challenge_response = 2;
}
message StorageTypeSystemState {
repeated string servers = 1;
repeated string authorities = 2;
repeated Process processes = 3;
}
message StorageTypeProcessSecret {
PrivateKey system = 1;
Process process = 2;
}
message QueryEngineStats {
uint64 total_events = 1;
uint64 system_count = 2;
uint64 process_count = 3;
message MemoryUsage {
uint64 bytes = 1;
}
optional MemoryUsage memory_usage = 4;
}
message EventCreationData {
PublicKey system = 1;
Process process = 2;
ContentType content_type = 3;
bytes content = 4;
optional Indices indices = 5;
optional LWWElementSet lww_element_set = 6;
optional LWWElement lww_element = 7;
repeated Reference references = 8;
optional uint64 unix_milliseconds = 9;
optional uint64 logical_clock = 10;
}
message Event {
PublicKey system = 1;
Process process = 2;
uint64 logical_clock = 3;
ContentType content_type = 4;
bytes content = 5;
VectorClock vector_clock = 6;
Indices indices = 7;
optional LWWElementSet lww_element_set = 8;
optional LWWElement lww_element = 9;
repeated Reference references = 10;
optional uint64 unix_milliseconds = 11;
}
message ReferencesResult {
repeated SignedEvent events = 1;
repeated SignedEvent related_events = 2;
bytes cursor = 3;
}
message FeedResult {
repeated SignedEvent events = 1;
bytes cursor = 2;
}
message CountReferencesResult {
repeated uint64 counts = 1 [packed = false];
}
message EventCreationResult {
bytes event = 1;
uint64 logical_clock = 2;
}
message EventKey {
uint64 system_key_type = 1;
bytes system_key = 2;
bytes process = 3;
uint64 logical_clock = 4;
}
message FeedCursor {
uint64 unix_milliseconds = 1;
EventKey event_key = 2;
}
message ReferenceCursor {
EventKey last_event_key = 1;
uint64 offset = 2;
uint64 processed_count = 3;
}
message DebugReferenceDigestResult {
bool success = 1;
bool pointer_parsed = 2;
bool has_digest = 3;
optional Digest reference_digest = 4;
Digest calculated_digest = 5;
bool digests_match = 6;
string error = 7;
uint32 reference_bytes_length = 8;
uint32 event_bytes_length = 9;
bool pointer_system_present = 10;
bool pointer_process_present = 11;
uint64 pointer_logical_clock = 12;
}
message Server {
string server = 1;
}
message AggregationBucket {
bytes key = 1;
int64 value = 2;
}
message PublicKeys {
repeated PublicKey systems = 1;
}
message KeyPair {
uint64 key_type = 1;
bytes private_key = 2;
bytes public_key = 3;
}
message ResultEventsAndRelatedEventsAndCursor {
Events result_events = 1;
Events related_events = 2;
optional bytes cursor = 3;
}
message ResultTopStringReferences {
repeated AggregationBucket buckets = 1;
}
message StorageTypeCRDTSetItem {
uint64 content_type = 1;
bytes value = 2;
uint64 unix_milliseconds = 3;
LWWElementSet.Operation operation = 4;
}
message StorageTypeCRDTItem {
uint64 content_type = 1;
bytes value = 2;
uint64 unix_milliseconds = 3;
}
message StorageTypeProcessState {
uint64 logical_clock = 1;
repeated Range ranges = 2;
Indices indices = 3;
}
message RepeatedUInt64 {
repeated uint64 numbers = 1;
}
message QueryReferencesRequest {
Reference reference = 1;
optional bytes cursor = 2;
optional QueryReferencesRequestEvents request_events = 3;
repeated QueryReferencesRequestCountLWWElementReferences count_lww_element_references = 4;
repeated QueryReferencesRequestCountReferences count_references = 5;
repeated bytes extra_byte_references = 6;
}
message QueryReferencesRequestEvents {
optional uint64 from_type = 1;
repeated QueryReferencesRequestCountLWWElementReferences count_lww_element_references = 2;
repeated QueryReferencesRequestCountReferences count_references = 3;
}
message QueryReferencesRequestCountLWWElementReferences {
bytes value = 1;
optional uint64 from_type = 2;
}
message QueryReferencesRequestCountReferences {
optional uint64 from_type = 1;
}
message QueryReferencesResponseEventItem {
SignedEvent event = 1;
repeated uint64 counts = 2;
}
message QueryReferencesResponse {
repeated QueryReferencesResponseEventItem items = 1;
repeated SignedEvent related_events = 2;
optional bytes cursor = 3;
repeated uint64 counts = 4;
}
message QueryClaimToSystemRequest {
uint64 claim_type = 1;
PublicKey trust_root = 2;
oneof query {
string match_any_field = 3;
QueryClaimToSystemRequestMatchAll match_all_fields = 4;
}
}
message QueryClaimToSystemRequestMatchAll {
repeated ClaimFieldEntry fields = 1;
}
message QueryClaimToSystemResponse {
repeated QueryClaimToSystemResponseMatch matches = 1;
}
message QueryClaimToSystemResponseMatch {
SignedEvent claim = 1;
repeated SignedEvent proof_chain = 2;
}
message QueryIndexResponse {
repeated SignedEvent events = 1;
repeated SignedEvent proof = 2;
}
message URLInfoDataLink {
PublicKey system = 1;
Process process = 2;
repeated string servers = 3;
uint64 byte_count = 4;
repeated Range sections = 5;
optional string mime = 6;
}
message FindClaimAndVouchRequest {
PublicKey vouching_system = 1;
PublicKey claiming_system = 2;
repeated ClaimFieldEntry fields = 3;
uint64 claim_type = 4;
}
message FindClaimAndVouchResponse {
SignedEvent vouch = 1;
SignedEvent claim = 2;
}
message ClaimHandleRequest {
PublicKey system = 1;
string handle = 2;
}