Skip to content

Commit

Permalink
feat: Update events
Browse files Browse the repository at this point in the history
  • Loading branch information
St4NNi committed Nov 20, 2024
1 parent e019994 commit bec43ea
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 27 deletions.
13 changes: 7 additions & 6 deletions v3/auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ service AuthService {
rpc Authorize(AuthorizeRequest) returns (AuthorizeResponse) {}
}

message ResourceAction {
string resource_id = 1;
aruna.api.v3.Permission permission = 2;
}

message AuthorizeRequest {
string token = 1;
repeated string resource_ids = 2;
aruna.api.v3.Permission permission = 3;
string current_state = 4;
repeated ResourceAction actions = 1;
}

message AuthorizeResponse {
bool authorized = 1;
string message = 2;
bool should_update = 3;
string expected_state = 2;
}
6 changes: 3 additions & 3 deletions v3/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ service EventsService {
rpc GetEvents(GetEventsRequest) returns (GetEventsResponse) {}
}


message GetEventsRequest {
string start_after = 1; // Base64 encoded event_id
int32 batch_size = 2;
string consumer_id = 1;
string start_after = 2; // Base64 encoded event_id
int32 batch_size = 3;
}

message GetEventsResponse {
Expand Down
20 changes: 2 additions & 18 deletions v3/models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -153,24 +153,8 @@ message Endpoint {
// TODO: Add more fields
}

enum EventType {
EVENT_TYPE_UNSPECIFIED = 0;
EVENT_TYPE_CREATED = 1;
EVENT_TYPE_UPDATED = 2;
EVENT_TYPE_DELETED = 3;
}

// field_name: lables, value: {key: "foo", value: "bar"}, removed: false
// field_name: relations, value: {from_id: "123", to_id: "456", relation_type: "is_part_of"}, removed: false
message FieldUpdate {
string field_name = 1;
string value = 2;
bool removed = 3;
}

message Event {
string event_id = 1;
string target_id = 2;
EventType event_type = 3;
repeated FieldUpdate field_updates = 4;
string event_body = 2;
repeated string target_ids = 3;
}

0 comments on commit bec43ea

Please sign in to comment.