Skip to content

Commit ec89440

Browse files
author
Ganeshwara Hananda
authored
Improve the consistency of user authentication token (#146)
## What is the goal of this PR? We've improved the consistency of the architecture by moving user authentication token functionalities into the user protocol. ## What are the changes implemented in this PR? 1. Group user authentication token RPC calls together with other user RPC calls 2. Group user authentication token message with other user messages
1 parent ef5d08c commit ec89440

File tree

7 files changed

+11
-49
lines changed

7 files changed

+11
-49
lines changed

cluster/BUILD

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,12 @@ proto_library(
2323
name = "service-proto",
2424
srcs = [":cluster_service.proto"],
2525
deps = [
26-
":client-proto",
2726
":server-proto",
2827
":user-proto",
2928
":database-proto"
3029
],
3130
)
3231

33-
proto_library(
34-
name = "client-proto",
35-
srcs = [":cluster_user_token.proto"],
36-
)
37-
3832
proto_library(
3933
name = "server-proto",
4034
srcs = [":cluster_server.proto"],

cluster/cluster_service.proto

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ option java_generic_services = true;
2525
import "cluster/cluster_server.proto";
2626
import "cluster/cluster_user.proto";
2727
import "cluster/cluster_database.proto";
28-
import "cluster/cluster_user_token.proto";
2928

3029
package typedb.protocol;
3130

@@ -41,11 +40,9 @@ service TypeDBCluster {
4140

4241
// User API
4342
rpc user_password (ClusterUser.Password.Req) returns (ClusterUser.Password.Res);
43+
rpc user_token (ClusterUser.Token.Req) returns (ClusterUser.Token.Res);
4444
rpc user_delete (ClusterUser.Delete.Req) returns (ClusterUser.Delete.Res);
4545

46-
// User Token API
47-
rpc user_token_renew (ClusterUserToken.Renew.Req) returns (ClusterUserToken.Renew.Res);
48-
4946
// Database Manager API
5047
rpc databases_get (ClusterDatabaseManager.Get.Req) returns (ClusterDatabaseManager.Get.Res);
5148
rpc databases_all (ClusterDatabaseManager.All.Req) returns (ClusterDatabaseManager.All.Res);

cluster/cluster_user.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,16 @@ message ClusterUser {
5959
message Res {}
6060
}
6161

62+
message Token {
63+
message Req {
64+
string username = 1;
65+
}
66+
67+
message Res {
68+
string token = 1;
69+
}
70+
}
71+
6272
message Delete {
6373
message Req {
6474
string username = 1;

cluster/cluster_user_token.proto

Lines changed: 0 additions & 36 deletions
This file was deleted.

grpc/java/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ java_grpc_compile(
2727
name = "typedb-protocol-src",
2828
deps = [
2929
"//cluster:service-proto",
30-
"//cluster:client-proto",
3130
"//cluster:server-proto",
3231
"//cluster:user-proto",
3332
"//cluster:database-proto",

grpc/nodejs/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ nodejs_binary(
4141
ts_grpc_compile(
4242
name = "typedb-protocol-src",
4343
deps = [
44-
"//cluster:client-proto",
4544
"//cluster:server-proto",
4645
"//cluster:user-proto",
4746
"//cluster:database-proto",

grpc/python/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ load("@vaticle_dependencies//tool/checkstyle:rules.bzl", "checkstyle_test")
2525
python_grpc_compile(
2626
name = "typedb-protocol-src",
2727
deps = [
28-
"//cluster:client-proto",
2928
"//cluster:server-proto",
3029
"//cluster:user-proto",
3130
"//cluster:database-proto",

0 commit comments

Comments
 (0)