1/*
2 * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License, version 2.0,
6 * as published by the Free Software Foundation.
7 *
8 * This program is also distributed with certain software (including
9 * but not limited to OpenSSL) that is licensed under separate terms,
10 * as designated in a particular file or component or in included license
11 * documentation.  The authors of MySQL hereby grant you an additional
12 * permission to link the program and your derivative works with the
13 * separately licensed software that they have included with MySQL.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU General Public License, version 2.0, for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
23 */
24syntax = "proto2";
25
26import "mysqlx.proto"; // comment_out_if PROTOBUF_LITE
27
28// ifdef PROTOBUF_LITE: option optimize_for = LITE_RUNTIME;
29
30// Messages to manage Sessions
31//
32// .. uml::
33//
34//   == session start ==
35//   Client -> Server: AuthenticateStart
36//   opt
37//   Server --> Client: AuthenticateContinue
38//   Client --> Server: AuthenticateContinue
39//   end
40//   alt
41//   Server --> Client: AuthenticateOk
42//   else
43//   Server --> Client: Error
44//   end
45//   ...
46//   == session reset ==
47//   Client -> Server: Reset
48//   Server --> Client: Ok
49//   == session end ==
50//   Client -> Server: Close
51//   Server --> Client: Ok
52//
53package Mysqlx.Session;
54option java_package = "com.mysql.cj.x.protobuf";
55
56// the initial message send from the client to the server to start the
57// authentication proccess
58//
59// :param mech_name: authentication mechanism name
60// :param auth_data: authentication data
61// :param initial_response: initial response
62// :Returns: :protobuf:msg:`Mysqlx.Session::AuthenticateContinue`
63message AuthenticateStart {
64  required string mech_name = 1;
65  optional bytes auth_data = 2;
66  optional bytes initial_response = 3;
67
68  option (client_message_id) = SESS_AUTHENTICATE_START; // comment_out_if PROTOBUF_LITE
69}
70
71// send by client or server after a :protobuf:msg:`Mysqlx.Session::AuthenticateStart` to
72// exchange more auth data
73//
74// :param auth_data: authentication data
75// :Returns: :protobuf:msg:`Mysqlx.Session::AuthenticateContinue`
76message AuthenticateContinue {
77  required bytes auth_data = 1;
78
79  option (server_message_id) = SESS_AUTHENTICATE_CONTINUE; // comment_out_if PROTOBUF_LITE
80  option (client_message_id) = SESS_AUTHENTICATE_CONTINUE; // comment_out_if PROTOBUF_LITE
81}
82
83// sent by the server after successful authentication
84//
85// :param auth_data: authentication data
86message AuthenticateOk {
87  optional bytes auth_data = 1;
88
89  option (server_message_id) = SESS_AUTHENTICATE_OK; // comment_out_if PROTOBUF_LITE
90}
91
92// reset the current session
93// param keep_open: if is true the session will be reset, but stays authenticated.
94//       otherwise, the session will be closed and needs to be authenticated again.
95//
96// :Returns: :protobuf:msg:`Mysqlx::Ok`
97message Reset {
98  optional bool keep_open = 1 [ default = false ];
99
100  option (client_message_id) = SESS_RESET; // comment_out_if PROTOBUF_LITE
101}
102
103// close the current session
104//
105// :Returns: :protobuf:msg:`Mysqlx::Ok`
106message Close {
107  option (client_message_id) = SESS_CLOSE; // comment_out_if PROTOBUF_LITE
108}
109
110