@@ -34,39 +34,11 @@ message ClientInit {
3434 string token_name = 2 ;
3535 // SystemRole is the system role requested, e.g. Proxy, Node, Instance, Bot.
3636 string system_role = 3 ;
37- // PublicTlsKey is the public key requested for the subject of the x509 certificate.
38- // It must be encoded in PKIX, ASN.1 DER form.
39- bytes public_tls_key = 4 ;
40- // PublicSshKey is the public key requested for the subject of the SSH certificate.
41- // It must be encoded in SSH wire format.
42- bytes public_ssh_key = 5 ;
4337 // ForwardedByProxy will be set to true when the message is forwarded by the
4438 // Proxy service. When this is set the Auth service must ignore any
4539 // any credentials authenticating the request, except for the purpose of
4640 // accepting ProxySuppliedParams.
47- bool forwarded_by_proxy = 6 ;
48-
49- // HostParams holds parameters that are specific to host joining and
50- // irrelevant to bot joining.
51- message HostParams {
52- // HostName is the user-friendly node name for the host. This comes from
53- // teleport.nodename in the service configuration and defaults to the
54- // hostname. It is encoded as a valid principal in issued certificates.
55- string host_name = 1 ;
56- // AdditionalPrincipals is a list of additional principals requested.
57- repeated string additional_principals = 2 ;
58- // DnsNames is a list of DNS names requested for inclusion in the x509 certificate.
59- repeated string dns_names = 3 ;
60- }
61- optional HostParams host_params = 7 ;
62-
63- // BotParams holds parameters that are specific to bot joining and irrelevant
64- // to host joining.
65- message BotParams {
66- // Expires is a desired time of the expiry of the returned certificates.
67- optional google.protobuf.Timestamp expires = 9 ;
68- }
69- optional BotParams bot_params = 8 ;
41+ bool forwarded_by_proxy = 4 ;
7042
7143 // ProxySuppliedParams holds parameters set by the Proxy when nodes join
7244 // via the proxy address. They must only be trusted if the incoming join
@@ -78,13 +50,68 @@ message ClientInit {
7850 // ClientVersion is the Teleport version of the client attempting to join.
7951 string client_version = 2 ;
8052 }
81- optional ProxySuppliedParams proxy_supplied_parameters = 9 ;
53+ optional ProxySuppliedParams proxy_supplied_parameters = 5 ;
54+ }
55+
56+ // PublicKeys holds public keys sent by the client requested subject keys for
57+ // issued certificates.
58+ message PublicKeys {
59+ // PublicTlsKey is the public key requested for the subject of the x509 certificate.
60+ // It must be encoded in PKIX, ASN.1 DER form.
61+ bytes public_tls_key = 1 ;
62+ // PublicSshKey is the public key requested for the subject of the SSH certificate.
63+ // It must be encoded in SSH wire format.
64+ bytes public_ssh_key = 2 ;
65+ }
66+
67+ // HostParams holds parameters required for host joining.
68+ message HostParams {
69+ // PublicKeys holds the host public keys.
70+ PublicKeys public_keys = 1 ;
71+ // HostName is the user-friendly node name for the host. This comes from
72+ // teleport.nodename in the service configuration and defaults to the
73+ // hostname. It is encoded as a valid principal in issued certificates.
74+ string host_name = 2 ;
75+ // AdditionalPrincipals is a list of additional principals requested.
76+ repeated string additional_principals = 3 ;
77+ // DnsNames is a list of DNS names requested for inclusion in the x509 certificate.
78+ repeated string dns_names = 4 ;
79+ }
80+
81+ // BotParams holds parameters required for bot joining.
82+ message BotParams {
83+ // PublicKeys holds the bot public keys.
84+ PublicKeys public_keys = 1 ;
85+ // Expires is a desired time of the expiry of the returned certificates.
86+ optional google.protobuf.Timestamp expires = 2 ;
87+ }
88+
89+ // ClientParams holds either host or bot join parameters.
90+ message ClientParams {
91+ oneof payload {
92+ HostParams host_params = 1 ;
93+ BotParams bot_params = 2 ;
94+ }
95+ }
96+
97+ // TokenInit is sent by the client in response to the ServerInit message for
98+ // the Token join method.
99+ //
100+ // The Token method join flow is:
101+ // 1. client->server: ClientInit
102+ // 2. server->client: ServerInit
103+ // 3. client->server: TokenInit
104+ // 4. server->client: Result
105+ message TokenInit {
106+ // ClientParams holds parameters for the specific type of client trying to join.
107+ ClientParams client_params = 1 ;
82108}
83109
84110// JoinRequest is the message type sent from the joining client to the server.
85111message JoinRequest {
86112 oneof payload {
87113 ClientInit client_init = 1 ;
114+ TokenInit token_init = 2 ;
88115 }
89116}
90117
@@ -93,6 +120,9 @@ message JoinRequest {
93120message ServerInit {
94121 // JoinMethod is the name of the selected join method.
95122 string join_method = 1 ;
123+ // SignatureAlgorithmSuite is the name of the signature algorithm suite
124+ // currently configured for the cluster.
125+ string signature_algorithm_suite = 2 ;
96126}
97127
98128// Challenge is a challenge message sent from the server that the client must solve.
@@ -102,18 +132,38 @@ message Challenge {}
102132// contains the result of the joining process including the assigned host ID
103133// and issued certificates.
104134message Result {
135+ oneof payload {
136+ HostResult host_result = 1 ;
137+ BotResult bot_result = 2 ;
138+ }
139+ }
140+
141+ // Certificates holds issued certificates and cluster CAs.
142+ message Certificates {
105143 // TlsCert is an X.509 certificate encoded in ASN.1 DER form.
106144 bytes tls_cert = 1 ;
107- // TlsCaCerts is a list of TLS certificate authorities that the agent should trust.
145+ // TlsCaCerts is a list of TLS certificate authorities that the client should trust.
108146 // Each certificate is encoding in ASN.1 DER form.
109147 repeated bytes tls_ca_certs = 2 ;
110148 // SshCert is an SSH certificate encoded in SSH wire format.
111149 bytes ssh_cert = 3 ;
112- // SshCaKey is a list of SSH certificate authority public keys that the agent should trust.
150+ // SshCaKey is a list of SSH certificate authority public keys that the client should trust.
113151 // Each CA key is encoded in SSH wire format.
114152 repeated bytes ssh_ca_keys = 4 ;
153+ }
154+
155+ // HostResult holds results for host joining.
156+ message HostResult {
157+ // Certificates holds issued certificates and cluster CAs.
158+ Certificates certificates = 1 ;
115159 // HostId is the unique ID assigned to the host.
116- optional string host_id = 5 ;
160+ string host_id = 2 ;
161+ }
162+
163+ // HostResult holds results for bot joining.
164+ message BotResult {
165+ // Certificates holds issued certificates and cluster CAs.
166+ Certificates certificates = 1 ;
117167}
118168
119169// JoinResponse is the message type sent from the server to the joining client.
@@ -163,7 +213,7 @@ service JoinService {
163213 // The client must send an ClientInit message on the JoinRequest stream to
164214 // initiate the join flow.
165215 //
166- // The server will reply with a JoinResponse where the payload will vary
167- // based on the join method specified in the provision token .
216+ // The server will reply with a ServerInit message, and subsequent messages
217+ // on the stream will depend on the join method .
168218 rpc Join (stream JoinRequest ) returns (stream JoinResponse );
169219}
0 commit comments