Skip to content

Commit 23f5b56

Browse files
authored
[alts] Update ALTS proto definitions to support ALPN negotiation (#169)
1 parent 2eb777a commit 23f5b56

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

grpc/gcp/handshaker.proto

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ option java_multiple_files = true;
2626
option java_outer_classname = "HandshakerProto";
2727
option java_package = "io.grpc.alts.internal";
2828

29-
3029
enum HandshakeProtocol {
3130
// Default value.
3231
HANDSHAKE_PROTOCOL_UNSPECIFIED = 0;
@@ -113,7 +112,10 @@ message StartClientHandshakeReq {
113112
// ALTS connections. The access token that should be used to authenticate to
114113
// the peer. The access token MUST be strongly bound to the ALTS credentials
115114
// used to establish the connection that the token is sent over.
116-
string access_token = 11 [debug_redact = true];
115+
string access_token = 11 [ debug_redact = true ];
116+
117+
// (Optional) Ordered transport protocol preferences supported by the client.
118+
TransportProtocolPreferences transport_protocol_preferences = 12;
117119
}
118120

119121
message ServerHandshakeParameters {
@@ -129,7 +131,7 @@ message ServerHandshakeParameters {
129131
// ALTS connections. The token should be used to authenticate to
130132
// the peer. The token MUST be strongly bound to the ALTS credentials
131133
// used to establish the connection that the token is sent over.
132-
optional string token = 3 [debug_redact = true];
134+
optional string token = 3 [ debug_redact = true ];
133135
}
134136

135137
message StartServerHandshakeReq {
@@ -161,6 +163,9 @@ message StartServerHandshakeReq {
161163

162164
// (Optional) Maximum frame size supported by the server.
163165
uint32 max_frame_size = 7;
166+
167+
// (Optional) Transport protocol preferences supported by the server.
168+
TransportProtocolPreferences transport_protocol_preferences = 8;
164169
}
165170

166171
message NextHandshakeMessageReq {
@@ -216,6 +221,9 @@ message HandshakerResult {
216221

217222
// The maximum frame size of the peer.
218223
uint32 max_frame_size = 8;
224+
225+
// (Optional) The transport protocol negotiated for this connection.
226+
NegotiatedTransportProtocol transport_protocol = 9;
219227
}
220228

221229
message HandshakerStatus {
@@ -254,7 +262,5 @@ service HandshakerService {
254262
// messages with next. Each time client sends a request, the handshaker
255263
// service expects to respond. Client does not have to wait for service's
256264
// response before sending next request.
257-
rpc DoHandshake(stream HandshakerReq)
258-
returns (stream HandshakerResp) {
259-
}
265+
rpc DoHandshake(stream HandshakerReq) returns (stream HandshakerResp) {}
260266
}

grpc/gcp/transport_security_common.proto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,10 @@ message RpcProtocolVersions {
4444
// Minimum supported RPC version.
4545
Version min_rpc_version = 2;
4646
}
47+
48+
// The ordered list of protocols that the client wishes to use, or the set
49+
// that the server supports.
50+
message TransportProtocolPreferences { repeated string transport_protocol = 1; }
51+
52+
// The negotiated transport protocol.
53+
message NegotiatedTransportProtocol { string transport_protocol = 1; }

0 commit comments

Comments
 (0)