2020-09-12 21:54:18 -07:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2021-11-09 11:43:41 -05:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-02-02 17:15:17 -08:00
|
|
|
|
2020-09-12 21:54:18 -07:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
|
|
package controller.servers.services.v1;
|
|
|
|
|
|
2020-09-19 00:18:17 -04:00
|
|
|
import "controller/api/resources/targets/v1/target.proto";
|
2021-12-17 11:26:42 -08:00
|
|
|
import "controller/servers/services/v1/credential.proto";
|
2020-09-20 12:51:08 -04:00
|
|
|
import "controller/servers/services/v1/server_coordination_service.proto";
|
2022-12-06 12:44:00 -07:00
|
|
|
import "google/protobuf/any.proto";
|
2020-09-12 21:54:18 -07:00
|
|
|
import "google/protobuf/timestamp.proto";
|
2022-05-04 11:10:21 -04:00
|
|
|
|
2020-09-12 21:54:18 -07:00
|
|
|
option go_package = "github.com/hashicorp/boundary/internal/gen/controller/servers/services;services";
|
|
|
|
|
|
|
|
|
|
service SessionService {
|
2021-12-17 11:26:42 -08:00
|
|
|
// LookupSession allows a worker to retrieve session information from the
|
2021-11-09 11:43:41 -05:00
|
|
|
// controller.
|
|
|
|
|
rpc LookupSession(LookupSessionRequest) returns (LookupSessionResponse) {}
|
2020-09-20 12:51:08 -04:00
|
|
|
|
2021-11-09 11:43:41 -05:00
|
|
|
// ActivateSession allows a worker to activate a session on a controller.
|
|
|
|
|
rpc ActivateSession(ActivateSessionRequest) returns (ActivateSessionResponse) {}
|
2020-12-16 17:14:47 -05:00
|
|
|
|
2021-11-09 11:43:41 -05:00
|
|
|
// CancelSession allows a worker to request that the controller cancel a session.
|
|
|
|
|
rpc CancelSession(CancelSessionRequest) returns (CancelSessionResponse) {}
|
2020-09-20 23:09:42 -04:00
|
|
|
|
2021-11-09 11:43:41 -05:00
|
|
|
// AuthorizeConnection allows a worker to authorize a connection on a controller.
|
|
|
|
|
rpc AuthorizeConnection(AuthorizeConnectionRequest) returns (AuthorizeConnectionResponse) {}
|
2020-09-21 00:09:50 -04:00
|
|
|
|
2021-11-09 11:43:41 -05:00
|
|
|
// 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) {}
|
2020-09-12 21:54:18 -07:00
|
|
|
}
|
|
|
|
|
|
2020-09-19 00:18:17 -04:00
|
|
|
message LookupSessionRequest {
|
2021-11-09 11:43:41 -05:00
|
|
|
// The session ID from the client
|
2023-07-28 12:41:55 -07:00
|
|
|
string session_id = 10; // @gotags: `class:"public" eventstream:"observation"`
|
2022-06-16 09:30:04 -04:00
|
|
|
// The id of the requesting worker, used for filtering to ensure this worker
|
|
|
|
|
// can handle this session
|
2023-07-28 12:41:55 -07:00
|
|
|
string worker_id = 20; // @gotags: `class:"public" eventstream:"observation"`
|
2020-09-12 21:54:18 -07:00
|
|
|
}
|
|
|
|
|
|
2020-09-19 00:18:17 -04:00
|
|
|
// LookupSessionResponse contains information necessary for a client to
|
|
|
|
|
// establish a session.
|
|
|
|
|
message LookupSessionResponse {
|
2021-11-09 11:43:41 -05:00
|
|
|
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"`
|
2023-07-28 12:41:55 -07:00
|
|
|
google.protobuf.Timestamp expiration = 50; // @gotags: `class:"public" eventstream:"observation"`
|
|
|
|
|
controller.servers.services.v1.SESSIONSTATUS status = 60; // @gotags: `class:"public" eventstream:"observation"`
|
2021-11-09 11:43:41 -05:00
|
|
|
int32 connection_limit = 70; // @gotags: `class:"public"`
|
|
|
|
|
int32 connections_left = 80; // @gotags: `class:"public"`
|
2023-07-28 12:41:55 -07:00
|
|
|
string host_id = 90; // @gotags: `class:"public" eventstream:"observation"`
|
|
|
|
|
string host_set_id = 100; // @gotags: `class:"public" eventstream:"observation"`
|
|
|
|
|
string target_id = 110; // @gotags: `class:"public" eventstream:"observation"`
|
|
|
|
|
string user_id = 120; // @gotags: `class:"public" eventstream:"observation"`
|
2022-12-06 12:44:00 -07:00
|
|
|
|
|
|
|
|
// credentials is deprecated on this response message. Instead use the
|
|
|
|
|
// credentials field inside the ProtocolContext message.
|
|
|
|
|
repeated Credential credentials = 130 [deprecated = true]; // @gotags: `class:"secret"`
|
|
|
|
|
// pkcs8_host_keys is deprecated on this response message.
|
|
|
|
|
repeated bytes pkcs8_host_keys = 140 [deprecated = true]; // @gotags: `class:"secret"`
|
2020-09-19 00:18:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ActivateSessionRequest {
|
2022-06-16 09:30:04 -04:00
|
|
|
reserved 40;
|
|
|
|
|
reserved "worker_id";
|
|
|
|
|
|
2023-07-28 12:41:55 -07:00
|
|
|
string session_id = 10; // @gotags: `class:"public" eventstream:"observation"`
|
2021-11-09 11:43:41 -05:00
|
|
|
string tofu_token = 20; // @gotags: `class:"secret"`
|
|
|
|
|
uint32 version = 30; // @gotags: `class:"public"`
|
2023-07-28 12:41:55 -07:00
|
|
|
controller.servers.services.v1.SESSIONSTATUS status = 50; // @gotags: `class:"public" eventstream:"observation"`
|
2020-09-20 12:51:08 -04:00
|
|
|
}
|
|
|
|
|
|
2020-09-20 23:09:42 -04:00
|
|
|
message ActivateSessionResponse {
|
2023-07-28 12:41:55 -07:00
|
|
|
controller.servers.services.v1.SESSIONSTATUS status = 10; // @gotags: `class:"public" eventstream:"observation"`
|
2020-12-16 17:14:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CancelSessionRequest {
|
2023-07-28 12:41:55 -07:00
|
|
|
string session_id = 10; // @gotags: `class:"public" eventstream:"observation"`
|
2020-12-16 17:14:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CancelSessionResponse {
|
2023-07-28 12:41:55 -07:00
|
|
|
controller.servers.services.v1.SESSIONSTATUS status = 10; // @gotags: `class:"public" eventstream:"observation"`
|
2020-09-20 12:51:08 -04:00
|
|
|
}
|
|
|
|
|
|
2020-09-20 23:09:42 -04:00
|
|
|
message AuthorizeConnectionRequest {
|
2023-07-28 12:41:55 -07:00
|
|
|
string session_id = 10; // @gotags: `class:"public" eventstream:"observation"`
|
|
|
|
|
string worker_id = 20; // @gotags: `class:"public" eventstream:"observation"`
|
2020-09-19 00:18:17 -04:00
|
|
|
}
|
|
|
|
|
|
2020-09-20 23:09:42 -04:00
|
|
|
message AuthorizeConnectionResponse {
|
2023-07-28 12:41:55 -07:00
|
|
|
string connection_id = 10; // @gotags: `class:"public" eventstream:"observation"`
|
|
|
|
|
controller.servers.services.v1.CONNECTIONSTATUS status = 20; // @gotags: `class:"public" eventstream:"observation"`
|
2021-11-09 11:43:41 -05:00
|
|
|
int32 connections_left = 30; // @gotags: `class:"public"`
|
2022-12-06 12:44:00 -07:00
|
|
|
|
|
|
|
|
// protocol_context contains information specific to the protocol being
|
|
|
|
|
// proxied. This is not needed to be set for tcp sessions.
|
|
|
|
|
google.protobuf.Any protocol_context = 40; // @gotags: `class:"public"`
|
2023-01-04 11:24:09 -05:00
|
|
|
|
|
|
|
|
// route specifies the workers the connection will be sent through
|
|
|
|
|
repeated string route = 50;
|
2020-09-20 23:09:42 -04:00
|
|
|
}
|
|
|
|
|
|
2020-09-21 00:09:50 -04:00
|
|
|
message ConnectConnectionRequest {
|
2023-07-28 12:41:55 -07:00
|
|
|
string connection_id = 10; // @gotags: `class:"public" eventstream:"observation"`
|
2021-11-09 11:43:41 -05:00
|
|
|
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"`
|
2023-07-28 12:41:55 -07:00
|
|
|
string type = 60; // @gotags: `class:"public" eventstream:"observation"`
|
2021-12-09 20:41:08 -05:00
|
|
|
|
|
|
|
|
// 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"
|
2020-09-20 23:09:42 -04:00
|
|
|
}
|
|
|
|
|
|
2020-09-21 00:09:50 -04:00
|
|
|
message ConnectConnectionResponse {
|
2023-07-28 12:41:55 -07:00
|
|
|
controller.servers.services.v1.CONNECTIONSTATUS status = 10; // @gotags: `class:"public" eventstream:"observation"`
|
2020-09-21 00:09:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CloseConnectionRequestData {
|
2023-07-28 12:41:55 -07:00
|
|
|
string connection_id = 10; // @gotags: `class:"public" eventstream:"observation"`
|
2022-10-06 17:37:50 +01:00
|
|
|
int64 bytes_up = 20; // @gotags: `class:"public"`
|
|
|
|
|
int64 bytes_down = 30; // @gotags: `class:"public"`
|
2025-04-17 18:16:25 +00:00
|
|
|
string reason = 40; // @gotags: `class:"public" eventstream:"observation"`
|
2020-09-21 00:09:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CloseConnectionRequest {
|
2023-07-28 12:41:55 -07:00
|
|
|
repeated CloseConnectionRequestData close_request_data = 10; // @gotags: `class:"public" eventstream:"observation"`
|
2020-09-21 00:09:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CloseConnectionResponseData {
|
2021-11-09 11:43:41 -05:00
|
|
|
string connection_id = 10;
|
2023-07-28 12:41:55 -07:00
|
|
|
controller.servers.services.v1.CONNECTIONSTATUS status = 20; // @gotags: `class:"public" eventstream:"observation"`
|
2020-09-21 00:09:50 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CloseConnectionResponse {
|
2023-07-28 12:41:55 -07:00
|
|
|
repeated CloseConnectionResponseData close_response_data = 10; // @gotags: `class:"public" eventstream:"observation"`
|
2021-06-02 14:59:36 -04:00
|
|
|
}
|