2017-01-26 15:51:22 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2017-01-27 02:43:17 +00:00
|
|
|
// option go_package = "git.xeserv.us/xena/route/routerpc/routegrpc;routegrpc";
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
package route;
|
|
|
|
|
2017-10-08 03:53:54 +00:00
|
|
|
// Nil represents nothing.
|
2017-04-28 21:56:52 +00:00
|
|
|
message Nil {}
|
2017-01-26 15:51:22 +00:00
|
|
|
|
2017-10-08 03:53:54 +00:00
|
|
|
// Routes lets users manage and manipulate http routes.
|
2017-04-28 21:56:52 +00:00
|
|
|
service Routes {
|
2017-10-08 03:53:54 +00:00
|
|
|
// Get fetches a single route based on the Host or ID.
|
|
|
|
rpc Get(GetRouteRequest) returns (Route) {}
|
|
|
|
|
|
|
|
// GetAll fetches all of the routes that the user owns.
|
|
|
|
rpc GetAll(Nil) returns (GetAllRoutesResponse) {}
|
|
|
|
|
|
|
|
// Put creates a new route based on user-supplied details.
|
|
|
|
rpc Put(Route) returns (Route) {}
|
|
|
|
|
|
|
|
// Delete removes a route.
|
|
|
|
rpc Delete(Route) returns (Nil) {}
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-10-08 03:53:54 +00:00
|
|
|
// GetRouteRequest specifies the host or id of the route that the user wants
|
|
|
|
// to fetch.
|
2017-04-28 21:56:52 +00:00
|
|
|
message GetRouteRequest {
|
|
|
|
string host = 1;
|
2017-10-08 03:53:54 +00:00
|
|
|
string id = 2;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-10-08 03:53:54 +00:00
|
|
|
// Route is a single HTTP route.
|
2017-04-28 21:56:52 +00:00
|
|
|
message Route {
|
2017-01-26 15:51:22 +00:00
|
|
|
string id = 1;
|
2017-04-28 21:56:52 +00:00
|
|
|
string creator = 2;
|
|
|
|
string host = 3;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-10-08 03:53:54 +00:00
|
|
|
// GetAllRoutesResponse encapsulates a list of routes.
|
2017-04-28 21:56:52 +00:00
|
|
|
message GetAllRoutesResponse {
|
|
|
|
repeated Route routes = 1;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-10-08 03:53:54 +00:00
|
|
|
// Tokens lets a user manage the database authentication tokens.
|
2017-01-26 15:51:22 +00:00
|
|
|
service Tokens {
|
2017-10-08 03:53:54 +00:00
|
|
|
rpc Get(GetTokenRequest) returns (Token) {}
|
|
|
|
|
|
|
|
rpc GetAll(Nil) returns (TokenSet) {}
|
|
|
|
|
|
|
|
rpc Put(Token) returns (Token) {}
|
|
|
|
|
|
|
|
rpc Delete(Token) returns (Nil) {}
|
|
|
|
|
|
|
|
rpc Deactivate(Token) returns (Nil) {}
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-10-08 03:53:54 +00:00
|
|
|
// Token is an individual authentication token. Id and Body will usually be
|
|
|
|
// unique ID's or other cryptographic identifiers.
|
2017-04-28 21:56:52 +00:00
|
|
|
message Token {
|
|
|
|
string id = 1;
|
2017-10-08 03:53:54 +00:00
|
|
|
string body = 2; // the actual token used in authenitcation
|
|
|
|
repeated string scopes = 3; // the permissions the token has
|
2017-04-28 21:56:52 +00:00
|
|
|
bool active = 4;
|
|
|
|
}
|
|
|
|
|
2017-10-08 03:53:54 +00:00
|
|
|
// Tokenset encapsulates a list of tokens.
|
2017-04-28 21:56:52 +00:00
|
|
|
message TokenSet {
|
|
|
|
repeated Token tokens = 1;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
|
|
|
|
2017-04-28 21:56:52 +00:00
|
|
|
message GetTokenRequest {
|
2017-01-26 15:51:22 +00:00
|
|
|
string token = 1;
|
2017-04-28 21:56:52 +00:00
|
|
|
string id = 2;
|
2017-01-26 15:51:22 +00:00
|
|
|
}
|
2017-09-30 16:11:00 +00:00
|
|
|
|
|
|
|
service Backends {
|
2017-10-08 03:53:54 +00:00
|
|
|
rpc List(BackendSelector) returns (BackendList) {}
|
|
|
|
|
|
|
|
rpc Kill(BackendID) returns (Nil) {}
|
2017-09-30 16:11:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message Backend {
|
|
|
|
string id = 1;
|
|
|
|
string proto = 2;
|
|
|
|
string user = 3;
|
|
|
|
string domain = 4;
|
|
|
|
float phi = 5;
|
|
|
|
string host = 6;
|
2017-09-30 17:33:19 +00:00
|
|
|
bool usable = 7;
|
2017-09-30 16:11:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message BackendList {
|
|
|
|
BackendSelector bs = 1;
|
|
|
|
repeated Backend backends = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message BackendSelector {
|
|
|
|
string domain = 1;
|
|
|
|
string user = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message BackendID {
|
|
|
|
string id = 1;
|
|
|
|
}
|