diff --git a/proto/relay.proto b/proto/relay.proto index 8e528a7..a7d6c3d 100644 --- a/proto/relay.proto +++ b/proto/relay.proto @@ -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; diff --git a/proto/self_serve/app.proto b/proto/self_serve/app.proto index 4d0dba8..e25d6ba 100644 --- a/proto/self_serve/app.proto +++ b/proto/self_serve/app.proto @@ -6,9 +6,7 @@ message AppReceiveQRCommand { string qr_code = 1; } -message AppConnectedToOrbCommand { - string orb_id = 1; -} +message AppConnectedToOrbCommand {} message AppShowStartSignupButtonCommand {} @@ -20,6 +18,4 @@ message AppReceiveSignupResultCommand { message AppRequestStartSelfServeFlowEvent {} -message AppRequestStartSignupEvent { - string orb_id = 1; -} +message AppRequestStartSignupEvent {} diff --git a/proto/self_serve/orb.proto b/proto/self_serve/orb.proto index 1c18645..cee7566 100644 --- a/proto/self_serve/orb.proto +++ b/proto/self_serve/orb.proto @@ -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; }