Skip to content

Protos for reversed gateway gRPC #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ message AuthenticateRequest {

message AuthenticateResponse {
string token = 1;
}
}
88 changes: 0 additions & 88 deletions core/vpn.proto

This file was deleted.

37 changes: 29 additions & 8 deletions wireguard/gateway.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ package gateway;
import "google/protobuf/empty.proto";

message ConfigurationRequest {
optional string name = 1;
string auth_token = 1;
string hostname = 2;
}

/*
* Networking and VPN configuration send from core to gateway.
*/
message Configuration {
string name = 1;
string prvkey = 2;
Expand Down Expand Up @@ -47,18 +51,35 @@ message PeerStats {
}

/*
* Allow empty messages to keep the connection alive.
* CoreResponse represents messages send from core to gateway
* in response to CoreRequest.
*/
message StatsUpdate {
message CoreResponse {
uint64 id = 1;
oneof payload {
// Allow empty messages to keep the connection alive.
google.protobuf.Empty empty = 2;
PeerStats peer_stats = 3;
Configuration config = 3;
Update update = 4;
}
}

service GatewayService {
rpc Config (ConfigurationRequest) returns (Configuration);
rpc Updates (google.protobuf.Empty) returns (stream Update);
rpc Stats (stream StatsUpdate) returns (google.protobuf.Empty);
/*
* CoreRequest represents messages send from gateway to core.
*/
message CoreRequest {
uint64 id = 1;
oneof payload {
PeerStats peer_stats = 2;
ConfigurationRequest config_request = 3;
}
}

/*
* Bi-directional communication between core and gateway.
* For security reasons, the connection has to be initiated by core,
* so requests and responses are actually send in reverse.
*/
service Gateway {
rpc Bidi (stream CoreResponse) returns (stream CoreRequest);
}