* Install buf with go install This reduces the impact of using buf on our dependency closure, which was significant. It also avoids potential issues with building buf given our own internal dependency constraints. This has caused issues (including crashes!) in the past. See https://github.com/cockroachdb/cockroach/issues/67216#issuecomment-874176186 for more discussion on using tool dependencies generally, and https://github.com/bufbuild/buf/issues/52 for an example of where this sort of thing caused an issue for a user. * Upgrade buf version We should migrate to v1 sooner rather than later, as it has some breaking changes from v0. * Change buf lint/breaking commands These commands were moved up one level for v1 * Migrate to buf.yaml to v1 * Remove unused imports These were uncovered by using "buf lint". * Use buf v1.3.1 * Depend on googleapis and grpc-gateway via BSR * Switch to buf for proto generation * Remove third party dependency * Remove unused tools and scripts * Move local protos up one level * Temporarily don't fail on breaking changes * Generate CI config * Fix generation of controller.json * Replace use of deprecated flag * Remove unused import, regenerate files * Remove temporary skipping over breaking check
126 lines
5.6 KiB
Protocol Buffer
126 lines
5.6 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package controller.servers.services.v1;
|
|
|
|
option go_package = "github.com/hashicorp/boundary/internal/gen/controller/servers/services;services";
|
|
|
|
import "google/protobuf/timestamp.proto";
|
|
import "controller/api/resources/targets/v1/target.proto";
|
|
import "controller/servers/services/v1/credential.proto";
|
|
import "controller/servers/services/v1/server_coordination_service.proto";
|
|
|
|
service SessionService {
|
|
// LookupSession allows a worker to retrieve session information from the
|
|
// controller.
|
|
rpc LookupSession(LookupSessionRequest) returns (LookupSessionResponse) {}
|
|
|
|
// ActivateSession allows a worker to activate a session on a controller.
|
|
rpc ActivateSession(ActivateSessionRequest) returns (ActivateSessionResponse) {}
|
|
|
|
// CancelSession allows a worker to request that the controller cancel a session.
|
|
rpc CancelSession(CancelSessionRequest) returns (CancelSessionResponse) {}
|
|
|
|
// AuthorizeConnection allows a worker to authorize a connection on a controller.
|
|
rpc AuthorizeConnection(AuthorizeConnectionRequest) returns (AuthorizeConnectionResponse) {}
|
|
|
|
// ConnectConnection updates a connection to set it to connected
|
|
rpc ConnectConnection(ConnectConnectionRequest) returns (ConnectConnectionResponse) {}
|
|
|
|
// CloseConnections updates a connection to set it to closed
|
|
rpc CloseConnection(CloseConnectionRequest) returns (CloseConnectionResponse) {}
|
|
}
|
|
|
|
message LookupSessionRequest {
|
|
// The session ID from the client
|
|
string session_id = 10; // @gotags: `class:"public"`
|
|
// The name of the requesting worker, used for filtering to ensure this
|
|
// worker is allowed to handle this session.
|
|
string server_id = 20; // @gotags: `class:"public"`
|
|
}
|
|
|
|
// LookupSessionResponse contains information necessary for a client to
|
|
// establish a session.
|
|
message LookupSessionResponse {
|
|
api.resources.targets.v1.SessionAuthorizationData authorization = 10;
|
|
string tofu_token = 20; // @gotags: `class:"secret"`
|
|
uint32 version = 30; // @gotags: `class:"public"`
|
|
string endpoint = 40; // @gotags: `class:"public"`
|
|
google.protobuf.Timestamp expiration = 50; // @gotags: `class:"public"`
|
|
controller.servers.services.v1.SESSIONSTATUS status = 60; // @gotags: `class:"public"`
|
|
int32 connection_limit = 70; // @gotags: `class:"public"`
|
|
int32 connections_left = 80; // @gotags: `class:"public"`
|
|
string host_id = 90; // @gotags: `class:"public"`
|
|
string host_set_id = 100; // @gotags: `class:"public"`
|
|
string target_id = 110; // @gotags: `class:"public"`
|
|
string user_id = 120; // @gotags: `class:"public"`
|
|
repeated Credential credentials = 130; // @gotags: `class:"secret"`
|
|
}
|
|
|
|
message ActivateSessionRequest {
|
|
string session_id = 10; // @gotags: `class:"public"`
|
|
string tofu_token = 20; // @gotags: `class:"secret"`
|
|
uint32 version = 30; // @gotags: `class:"public"`
|
|
string worker_id = 40; // @gotags: `class:"public"`
|
|
controller.servers.services.v1.SESSIONSTATUS status = 50; // @gotags: `class:"public"`
|
|
}
|
|
|
|
message ActivateSessionResponse {
|
|
controller.servers.services.v1.SESSIONSTATUS status = 10; // @gotags: `class:"public"`
|
|
}
|
|
|
|
message CancelSessionRequest {
|
|
string session_id = 10; // @gotags: `class:"public"`
|
|
}
|
|
|
|
message CancelSessionResponse {
|
|
controller.servers.services.v1.SESSIONSTATUS status = 10; // @gotags: `class:"public"`
|
|
}
|
|
|
|
message AuthorizeConnectionRequest {
|
|
string session_id = 10; // @gotags: `class:"public"`
|
|
string worker_id = 20; // @gotags: `class:"public"`
|
|
}
|
|
|
|
message AuthorizeConnectionResponse {
|
|
string connection_id = 10; // @gotags: `class:"public"`
|
|
controller.servers.services.v1.CONNECTIONSTATUS status = 20; // @gotags: `class:"public"`
|
|
int32 connections_left = 30; // @gotags: `class:"public"`
|
|
}
|
|
|
|
message ConnectConnectionRequest {
|
|
string connection_id = 10; // @gotags: `class:"public"`
|
|
string client_tcp_address = 20; // @gotags: `class:"public"`
|
|
uint32 client_tcp_port = 30; // @gotags: `class:"public"`
|
|
string endpoint_tcp_address = 40; // @gotags: `class:"public"`
|
|
uint32 endpoint_tcp_port = 50; // @gotags: `class:"public"`
|
|
string type = 60; // @gotags: `class:"public"`
|
|
|
|
// user_client_ip is the user's client ip for the connection as determined by
|
|
// the inbound http request handler
|
|
string user_client_ip = 70; // @gotags: `class:"public"
|
|
}
|
|
|
|
message ConnectConnectionResponse {
|
|
controller.servers.services.v1.CONNECTIONSTATUS status = 10; // @gotags: `class:"public"`
|
|
}
|
|
|
|
message CloseConnectionRequestData {
|
|
string connection_id = 10; // @gotags: `class:"public"`
|
|
uint64 bytes_up = 20; // @gotags: `class:"public"`
|
|
uint64 bytes_down = 30; // @gotags: `class:"public"`
|
|
string reason = 40; // @gotags: `class:"public"`
|
|
}
|
|
|
|
message CloseConnectionRequest {
|
|
repeated CloseConnectionRequestData close_request_data = 10; // @gotags: `class:"public"`
|
|
}
|
|
|
|
message CloseConnectionResponseData {
|
|
string connection_id = 10;
|
|
controller.servers.services.v1.CONNECTIONSTATUS status = 20; // @gotags: `class:"public"`
|
|
}
|
|
|
|
message CloseConnectionResponse {
|
|
repeated CloseConnectionResponseData close_response_data = 10; // @gotags: `class:"public"`
|
|
}
|