Skip to content

Commit

Permalink
Migrate commands/events into payload to enable more generic message p…
Browse files Browse the repository at this point in the history
…assing (#3)

Modify existing message format to migrate commands/events into a payload section and utilize destination header in root of RelayMessage
  • Loading branch information
matthewpaul authored Aug 12, 2024
1 parent f09f57c commit e8a791e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
22 changes: 20 additions & 2 deletions proto/relay.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,35 @@ import "self_serve/orb.proto";

// Service Definitions
service OrbService {
rpc OrbConnect(stream OrbEvent) returns (stream OrbCommand);
rpc OrbConnect(stream RelayMessage) returns (stream RelayMessage);
}

service AppService {
rpc AppConnect(stream AppEvent) returns (stream AppCommand);
rpc AppConnect(stream RelayMessage) returns (stream RelayMessage);
}

service BackendService {
rpc RequestOrbUpdateConfig(config.OrbUpdateConfigRequest) returns (config.OrbUpdateConfigResponse);
}

message RelayPayload {
oneof payload {
OrbConnectRequestEvent orb_connect_request_event = 1;
AppConnectRequestEvent app_connect_request_event = 2;
OrbCommand orb_command = 3;
OrbEvent orb_event = 4;
AppCommand app_command = 5;
AppEvent app_event = 6;
BackendEvent backend_event = 7;
BackendCommand backend_command = 8;
}
}

message RelayMessage {
string destination = 1;
RelayPayload payload = 2;
}

message OrbConnectRequestEvent {
string orb_id = 1;
string auth_token = 2;
Expand Down
8 changes: 2 additions & 6 deletions proto/self_serve/app.proto
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ message AppReceiveQRCommand {
string qr_code = 1;
}

message AppConnectedToOrbCommand {
string orb_id = 1;
}
message AppConnectedToOrbCommand {}

message AppShowStartSignupButtonCommand {}

Expand All @@ -20,6 +18,4 @@ message AppReceiveSignupResultCommand {

message AppRequestStartSelfServeFlowEvent {}

message AppRequestStartSignupEvent {
string orb_id = 1;
}
message AppRequestStartSignupEvent {}
11 changes: 3 additions & 8 deletions proto/self_serve/orb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@ package selfserve;

message OrbStartSelfServeSignupCommand {}

message OrbSelfServeSessionStartedEvent {
string app_id = 1;
}
message OrbSelfServeSessionStartedEvent {}

message OrbSignupStartedEvent {
string app_id = 1;
}
message OrbSignupStartedEvent {}

message OrbSignupCompletedEvent {
string app_id = 1;
bool success = 2;
bool success = 1;
}

0 comments on commit e8a791e

Please sign in to comment.