Files
threshold/internal/proto/local/controller/servers/services/v1/session_service.proto
T
Louis RuchandJeff Mitchell 31af49e76d refactor(worker): Move tcp_proxy into its own package (#1458)
* refactor(worker): Move tcp_proxy into its own package

This refactors:

- the tcp_proxy.go into worker/proxy/tcp
- add a missing unit test for the HandleTcpProxyV1
- refactors session.go into worker/session, needed to avoid import cycle
- adds a baseline for a mock controller session client
- go lint fixes

* Add sleep between spinning listener goroutine and dialing

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
2021-08-18 15:30:55 +02:00

120 lines
3.5 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/server_coordination_service.proto";
service SessionService {
// GetSession 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;
// The name of the requesting worker, used for filtering to ensure this
// worker is allowed to handle this session.
string server_id = 20;
}
// LookupSessionResponse contains information necessary for a client to
// establish a session.
message LookupSessionResponse {
api.resources.targets.v1.SessionAuthorizationData authorization = 10;
string tofu_token = 20;
uint32 version = 30;
string endpoint = 40;
google.protobuf.Timestamp expiration = 50;
controller.servers.services.v1.SESSIONSTATUS status = 60;
int32 connection_limit = 70;
int32 connections_left = 80;
string host_id = 90;
string host_set_id = 100;
string target_id = 110;
string user_id = 120;
}
message ActivateSessionRequest {
string session_id = 10;
string tofu_token = 20;
uint32 version = 30;
string worker_id = 40;
controller.servers.services.v1.SESSIONSTATUS status = 50;
}
message ActivateSessionResponse {
controller.servers.services.v1.SESSIONSTATUS status = 10;
}
message CancelSessionRequest {
string session_id = 10;
}
message CancelSessionResponse {
controller.servers.services.v1.SESSIONSTATUS status = 10;
}
message AuthorizeConnectionRequest {
string session_id = 10;
string worker_id = 20;
}
message AuthorizeConnectionResponse {
string connection_id = 10;
controller.servers.services.v1.CONNECTIONSTATUS status = 20;
int32 connections_left = 30;
}
message ConnectConnectionRequest {
string connection_id = 10;
string client_tcp_address = 20;
uint32 client_tcp_port = 30;
string endpoint_tcp_address = 40;
uint32 endpoint_tcp_port = 50;
string type = 60;
}
message ConnectConnectionResponse {
controller.servers.services.v1.CONNECTIONSTATUS status = 10;
}
message CloseConnectionRequestData {
string connection_id = 10;
uint64 bytes_up = 20;
uint64 bytes_down = 30;
string reason = 40;
}
message CloseConnectionRequest {
repeated CloseConnectionRequestData close_request_data = 10;
}
message CloseConnectionResponseData {
string connection_id = 10;
controller.servers.services.v1.CONNECTIONSTATUS status = 20;
}
message CloseConnectionResponse {
repeated CloseConnectionResponseData close_response_data = 10;
}