1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

acl api proto

This commit is contained in:
Sergey Cherepanov 2023-07-17 16:04:47 +02:00
parent b1c198df1d
commit a858e283f6
No known key found for this signature in database
GPG key ID: 87F8EDE8FBDF637C
3 changed files with 1035 additions and 70 deletions

View file

@ -11,6 +11,7 @@ enum ErrCodes {
SpaceIsDeleted = 4;
PeerIsNotResponsible = 5;
ReceiptIsInvalid = 6;
InvalidPayload = 7;
ErrorOffset = 100;
}
@ -25,6 +26,10 @@ service SpaceSync {
rpc ObjectSyncStream(stream ObjectSyncMessage) returns (stream ObjectSyncMessage);
// ObjectSync sends object sync message and synchronously gets response message
rpc ObjectSync(ObjectSyncMessage) returns (ObjectSyncMessage);
// AclAddRecord adds a new record to acl log. Works only with any-sync-node
rpc AclAddRecord(AclAddRecordRequest) returns (AclAddRecordResponse);
// AclGetRecords gets acl records
rpc AclGetRecords(AclGetRecordsRequest) returns (AclGetRecordsResponse);
}
// HeadSyncRange presenting a request for one range
@ -157,3 +162,27 @@ message SpaceSubscription {
repeated string spaceIds = 1;
SpaceSubscriptionAction action = 2;
}
// AclAddRecordRequest contains marshaled consensusproto.RawRecord
message AclAddRecordRequest {
string spaceId = 1;
bytes payload = 2;
}
// AclAddRecordResponse contains created record id and marshaled consensusproto.RawRecord
message AclAddRecordResponse {
string recordId = 1;
bytes payload = 2;
}
// AclGetRecordsRequest can optionally contain the last known aclHeal, the server will return only new records or an empty list if there are no new records.
// If aclHead is not provided the whole list will be returned.
message AclGetRecordsRequest {
string spaceId = 1;
string aclHead = 2;
}
// AclGetRecordsResponse contains list of marshaled consensusproto.RawRecordWithId
message AclGetRecordsResponse {
repeated bytes records = 1;
}