This is an automated email from the ASF dual-hosted git repository.
haonan pushed a commit to branch rel/0.13
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/0.13 by this push:
new a01237dc01 [To rel/0.13][IOTDB-5136] Set "username" to be required
(#8386)
a01237dc01 is described below
commit a01237dc01a3628c9f6ec90c4a8b96324ecee6d4
Author: 马子坤 <[email protected]>
AuthorDate: Fri Dec 9 13:56:08 2022 +0800
[To rel/0.13][IOTDB-5136] Set "username" to be required (#8386)
---
cluster/src/main/java/org/apache/iotdb/cluster/ClientMain.java | 8 +++++++-
thrift-influxdb/src/main/thrift/influxdb.thrift | 2 +-
thrift/src/main/thrift/rpc.thrift | 2 +-
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/cluster/src/main/java/org/apache/iotdb/cluster/ClientMain.java
b/cluster/src/main/java/org/apache/iotdb/cluster/ClientMain.java
index e3a13dbb93..a67c185524 100644
--- a/cluster/src/main/java/org/apache/iotdb/cluster/ClientMain.java
+++ b/cluster/src/main/java/org/apache/iotdb/cluster/ClientMain.java
@@ -264,9 +264,15 @@ public class ClientMain {
}
private static long connectClient(Client client) throws TException {
+ /*
TSOpenSessionReq openReq =
new TSOpenSessionReq(
- TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3,
ZoneId.systemDefault().getId());
+ TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3,
ZoneId.systemDefault().getId(), "root");
+ */
+ TSOpenSessionReq openReq = new TSOpenSessionReq();
+
+ openReq.setClient_protocol(TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3);
+ openReq.setZoneId(ZoneId.systemDefault().getId());
openReq.setUsername("root");
openReq.setPassword("root");
TSOpenSessionResp openResp = client.openSession(openReq);
diff --git a/thrift-influxdb/src/main/thrift/influxdb.thrift
b/thrift-influxdb/src/main/thrift/influxdb.thrift
index 4ab0a19a0b..3d2591f7c7 100644
--- a/thrift-influxdb/src/main/thrift/influxdb.thrift
+++ b/thrift-influxdb/src/main/thrift/influxdb.thrift
@@ -46,7 +46,7 @@ struct TSOpenSessionResp {
// Open a session (connection) on the server against which operations may be
executed.
struct TSOpenSessionReq {
2: required string zoneId
- 3: optional string username
+ 3: required string username
4: optional string password
5: optional map<string, string> configuration
}
diff --git a/thrift/src/main/thrift/rpc.thrift
b/thrift/src/main/thrift/rpc.thrift
index 830bede11b..22ba914c35 100644
--- a/thrift/src/main/thrift/rpc.thrift
+++ b/thrift/src/main/thrift/rpc.thrift
@@ -104,7 +104,7 @@ struct TSOpenSessionResp {
struct TSOpenSessionReq {
1: required TSProtocolVersion client_protocol =
TSProtocolVersion.IOTDB_SERVICE_PROTOCOL_V3
2: required string zoneId
- 3: optional string username
+ 3: required string username
4: optional string password
5: optional map<string, string> configuration
}