From 7c7e24c43a59ac3e3b2c4bb17566eb9478099c21 Mon Sep 17 00:00:00 2001 From: joshua Date: Wed, 26 Mar 2025 16:10:54 -0400 Subject: [PATCH 1/9] Update dependencies --- dependencies/typedb/repositories.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies/typedb/repositories.bzl b/dependencies/typedb/repositories.bzl index 2855014..b375018 100644 --- a/dependencies/typedb/repositories.bzl +++ b/dependencies/typedb/repositories.bzl @@ -8,5 +8,5 @@ def typedb_dependencies(): git_repository( name = "typedb_dependencies", remote = "https://github.com/typedb/typedb-dependencies", - commit = "52191031bb1231c714a2f2017571d61c81b4a890", # sync-marker: do not remove this comment, this is used for sync-dependencies by @typedb_dependencies + commit = "cf9c1707c7896d61ff97bbf60b1880852ad42353", # sync-marker: do not remove this comment, this is used for sync-dependencies by @typedb_dependencies ) From 91fa29cd81c56752b6a71a4a6850a78f89f7521c Mon Sep 17 00:00:00 2001 From: Georgii Novoselov Date: Mon, 7 Apr 2025 15:08:53 +0100 Subject: [PATCH 2/9] Prepare for release 3.1.0 (#218) ## Release notes: usage and product changes Update dependencies and release notes ## Implementation --- RELEASE_NOTES_LATEST.md | 11 +++++------ VERSION | 2 +- dependencies/typedb/repositories.bzl | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/RELEASE_NOTES_LATEST.md b/RELEASE_NOTES_LATEST.md index cb713c4..7e51d55 100644 --- a/RELEASE_NOTES_LATEST.md +++ b/RELEASE_NOTES_LATEST.md @@ -7,7 +7,7 @@ Documentation: https://typedb.com/docs/clients/2.x/clients Available from https://crates.io/crates/typedb-protocol ```sh -cargo add typedb-protocol@3.0.0 +cargo add typedb-protocol@3.1.0 ``` #### For Node.js through npm @@ -15,19 +15,17 @@ cargo add typedb-protocol@3.0.0 Available from https://www.npmjs.com/package/typedb-protocol ```sh -npm install typedb-protocol@3.0.0 +npm install typedb-protocol@3.1.0 ``` or ```sh -yarn add typedb-protocol@3.0.0 +yarn add typedb-protocol@3.1.0 ``` ## New Features -- **Update protocol for TypeDB 3.0** - We introduce a new version of protocol to support TypeDB 3.0 with updated TypeQL and APIs. - + ## Bugs Fixed @@ -35,5 +33,6 @@ yarn add typedb-protocol@3.0.0 ## Other Improvements +- **Update dependencies** diff --git a/VERSION b/VERSION index 4a36342..fd2a018 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.0.0 +3.1.0 diff --git a/dependencies/typedb/repositories.bzl b/dependencies/typedb/repositories.bzl index b375018..b386888 100644 --- a/dependencies/typedb/repositories.bzl +++ b/dependencies/typedb/repositories.bzl @@ -8,5 +8,5 @@ def typedb_dependencies(): git_repository( name = "typedb_dependencies", remote = "https://github.com/typedb/typedb-dependencies", - commit = "cf9c1707c7896d61ff97bbf60b1880852ad42353", # sync-marker: do not remove this comment, this is used for sync-dependencies by @typedb_dependencies + commit = "6b9bc322bab187ebad65b192c129feffd6c704f4", # sync-marker: do not remove this comment, this is used for sync-dependencies by @typedb_dependencies ) From e06573b7037f3432c89efb453960f92430c9062c Mon Sep 17 00:00:00 2001 From: Georgii Novoselov Date: Wed, 12 Mar 2025 15:47:45 +0000 Subject: [PATCH 3/9] Add sign_in auth request --- proto/authentication.proto | 22 ++++++++++++++++++++++ proto/connection.proto | 2 -- proto/typedb-service.proto | 4 ++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 proto/authentication.proto diff --git a/proto/authentication.proto b/proto/authentication.proto new file mode 100644 index 0000000..99661f2 --- /dev/null +++ b/proto/authentication.proto @@ -0,0 +1,22 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +syntax = "proto3"; + +package typedb.protocol; + +message Authentication { + + // TODO: How to extend it if other credentials appear? Make SignInPassword + SignInXXX, or make username + password optional? + message SignIn { + message Req { + string username = 1; + string password = 2; + } + + message Res { + string token = 1; + } + } +} diff --git a/proto/connection.proto b/proto/connection.proto index b7f5105..27a5c21 100644 --- a/proto/connection.proto +++ b/proto/connection.proto @@ -22,8 +22,6 @@ message Connection { uint64 server_duration_millis = 1; ConnectionID connection_id = 2; - // TODO: initial Token - // pre-send all databases and replica info DatabaseManager.All.Res databases_all = 3; } diff --git a/proto/typedb-service.proto b/proto/typedb-service.proto index 4f693cd..4e9e62d 100644 --- a/proto/typedb-service.proto +++ b/proto/typedb-service.proto @@ -4,6 +4,7 @@ syntax = "proto3"; +import "proto/authentication.proto"; import "proto/connection.proto"; import "proto/database.proto"; import "proto/server.proto"; @@ -17,6 +18,9 @@ service TypeDB { // Connection API rpc connection_open (Connection.Open.Req) returns (Connection.Open.Res); + // Authentication API + rpc sign_in (Authentication.SignIn.Req) returns (Authentication.SignIn.Res); + // Server Manager API rpc servers_all (ServerManager.All.Req) returns (ServerManager.All.Res); From 474f3efaa0ed4b9ff07df8e30e4968ad21e54eab Mon Sep 17 00:00:00 2001 From: Georgii Novoselov Date: Wed, 12 Mar 2025 17:20:32 +0000 Subject: [PATCH 4/9] Refactor for extensibility --- proto/authentication.proto | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/proto/authentication.proto b/proto/authentication.proto index 99661f2..3aa8a02 100644 --- a/proto/authentication.proto +++ b/proto/authentication.proto @@ -8,11 +8,14 @@ package typedb.protocol; message Authentication { - // TODO: How to extend it if other credentials appear? Make SignInPassword + SignInXXX, or make username + password optional? message SignIn { message Req { - string username = 1; - string password = 2; + message Password { + string username = 1; + string password = 2; + } + + optional Password password = 1; } message Res { From 5086f963c55316432190eba747a8b3e0a7b14c2b Mon Sep 17 00:00:00 2001 From: Georgii Novoselov Date: Wed, 12 Mar 2025 17:44:46 +0000 Subject: [PATCH 5/9] Refactor + add the new proto file to the needed build files --- grpc/java/BUILD | 1 + grpc/nodejs/BUILD | 1 + grpc/rust/BUILD | 1 + proto/BUILD | 6 ++++++ proto/authentication.proto | 5 ++++- proto/query.proto | 1 - 6 files changed, 13 insertions(+), 2 deletions(-) diff --git a/grpc/java/BUILD b/grpc/java/BUILD index 33a8dc9..0ca5360 100644 --- a/grpc/java/BUILD +++ b/grpc/java/BUILD @@ -16,6 +16,7 @@ java_grpc_library( "//proto:answer-proto", "//proto:concept-proto", "//proto:connection-proto", + "//proto:authentication-proto", "//proto:logic-proto", "//proto:options-proto", "//proto:query-proto", diff --git a/grpc/nodejs/BUILD b/grpc/nodejs/BUILD index 6233662..74860c2 100644 --- a/grpc/nodejs/BUILD +++ b/grpc/nodejs/BUILD @@ -32,6 +32,7 @@ ts_grpc_compile( "//proto:answer-proto", "//proto:concept-proto", "//proto:connection-proto", + "//proto:authentication-proto", "//proto:logic-proto", "//proto:options-proto", "//proto:query-proto", diff --git a/grpc/rust/BUILD b/grpc/rust/BUILD index 5d608c9..2c98ea8 100644 --- a/grpc/rust/BUILD +++ b/grpc/rust/BUILD @@ -19,6 +19,7 @@ rust_tonic_compile( "//proto:answer-proto", "//proto:concept-proto", "//proto:connection-proto", + "//proto:authentication-proto", "//proto:logic-proto", "//proto:options-proto", "//proto:query-proto", diff --git a/proto/BUILD b/proto/BUILD index 9c9ec50..710d586 100644 --- a/proto/BUILD +++ b/proto/BUILD @@ -11,6 +11,7 @@ proto_library( srcs = [":typedb-service.proto"], deps = [ ":connection-proto", + ":authentication-proto", ":server-proto", ":user-proto", ":database-proto", @@ -39,6 +40,11 @@ proto_library( deps = [":concept-proto"], ) +proto_library( + name = "authentication-proto", + srcs = ["authentication.proto"], +) + proto_library( name = "concept-proto", srcs = ["concept.proto"], diff --git a/proto/authentication.proto b/proto/authentication.proto index 3aa8a02..cdb6ac5 100644 --- a/proto/authentication.proto +++ b/proto/authentication.proto @@ -15,7 +15,10 @@ message Authentication { string password = 2; } - optional Password password = 1; + oneof credentials { + Password password = 1; + // extend by other credential kinds + } } message Res { diff --git a/proto/query.proto b/proto/query.proto index bfae4c9..0ffc7a4 100644 --- a/proto/query.proto +++ b/proto/query.proto @@ -6,7 +6,6 @@ syntax = "proto3"; import "proto/answer.proto"; import "proto/options.proto"; -import "proto/concept.proto"; package typedb.protocol; From f0711d197c1e266891a5dbb434175dab1332fe41 Mon Sep 17 00:00:00 2001 From: Georgii Novoselov Date: Thu, 13 Mar 2025 11:15:12 +0000 Subject: [PATCH 6/9] Add authentication into connection --- proto/BUILD | 5 +++-- proto/connection.proto | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/proto/BUILD b/proto/BUILD index 710d586..756f318 100644 --- a/proto/BUILD +++ b/proto/BUILD @@ -54,8 +54,9 @@ proto_library( name = "connection-proto", srcs = ["connection.proto"], deps = [ - ":version-proto", - ":database-proto" + ":authentication-proto", + ":database-proto", + ":version-proto" ], ) diff --git a/proto/connection.proto b/proto/connection.proto index 27a5c21..d19c8fa 100644 --- a/proto/connection.proto +++ b/proto/connection.proto @@ -4,8 +4,9 @@ syntax = "proto3"; -import "proto/version.proto"; +import "proto/authentication.proto"; import "proto/database.proto"; +import "proto/version.proto"; package typedb.protocol; @@ -16,6 +17,8 @@ message Connection { Version version = 1; string driver_lang = 2; string driver_version = 3; + + Authentication.SignIn.Req authentication = 4; } message Res { @@ -24,6 +27,8 @@ message Connection { // pre-send all databases and replica info DatabaseManager.All.Res databases_all = 3; + + Authentication.SignIn.Res authentication = 4; } } } From f39182fdab483cf9dfd86ca089fbd1cf49e51762 Mon Sep 17 00:00:00 2001 From: Georgii Novoselov Date: Mon, 24 Mar 2025 10:05:37 +0000 Subject: [PATCH 7/9] Refactor SignIn to Token.Create --- proto/authentication.proto | 25 +++++++++++++------------ proto/connection.proto | 4 ++-- proto/typedb-service.proto | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/proto/authentication.proto b/proto/authentication.proto index cdb6ac5..5a93162 100644 --- a/proto/authentication.proto +++ b/proto/authentication.proto @@ -7,22 +7,23 @@ syntax = "proto3"; package typedb.protocol; message Authentication { + message Token { + message Create { + message Req { + message Password { + string username = 1; + string password = 2; + } - message SignIn { - message Req { - message Password { - string username = 1; - string password = 2; + oneof credentials { + Password password = 1; + // extend by other credential kinds + } } - oneof credentials { - Password password = 1; - // extend by other credential kinds + message Res { + string token = 1; } } - - message Res { - string token = 1; - } } } diff --git a/proto/connection.proto b/proto/connection.proto index d19c8fa..6123524 100644 --- a/proto/connection.proto +++ b/proto/connection.proto @@ -18,7 +18,7 @@ message Connection { string driver_lang = 2; string driver_version = 3; - Authentication.SignIn.Req authentication = 4; + Authentication.Token.Create.Req authentication = 4; } message Res { @@ -28,7 +28,7 @@ message Connection { // pre-send all databases and replica info DatabaseManager.All.Res databases_all = 3; - Authentication.SignIn.Res authentication = 4; + Authentication.Token.Create.Res authentication = 4; } } } diff --git a/proto/typedb-service.proto b/proto/typedb-service.proto index 4e9e62d..4b455bf 100644 --- a/proto/typedb-service.proto +++ b/proto/typedb-service.proto @@ -19,7 +19,7 @@ service TypeDB { rpc connection_open (Connection.Open.Req) returns (Connection.Open.Res); // Authentication API - rpc sign_in (Authentication.SignIn.Req) returns (Authentication.SignIn.Res); + rpc sign_in (Authentication.Token.Create.Req) returns (Authentication.Token.Create.Res); // Server Manager API rpc servers_all (ServerManager.All.Req) returns (ServerManager.All.Res); From 6cf67b5e93fc76d1b5c24d064b16c063a53b5e9c Mon Sep 17 00:00:00 2001 From: Georgii Novoselov Date: Mon, 24 Mar 2025 10:12:51 +0000 Subject: [PATCH 8/9] Rename sign_in to authentication_token_create --- proto/typedb-service.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/typedb-service.proto b/proto/typedb-service.proto index 4b455bf..beffa1b 100644 --- a/proto/typedb-service.proto +++ b/proto/typedb-service.proto @@ -19,7 +19,7 @@ service TypeDB { rpc connection_open (Connection.Open.Req) returns (Connection.Open.Res); // Authentication API - rpc sign_in (Authentication.Token.Create.Req) returns (Authentication.Token.Create.Res); + rpc authentication_token_create (Authentication.Token.Create.Req) returns (Authentication.Token.Create.Res); // Server Manager API rpc servers_all (ServerManager.All.Req) returns (ServerManager.All.Res); From c43acc88e676fad831d09491577e11fef12501be Mon Sep 17 00:00:00 2001 From: Georgii Novoselov Date: Tue, 8 Apr 2025 14:29:07 +0100 Subject: [PATCH 9/9] Update protocol version --- proto/version.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/version.proto b/proto/version.proto index 683ce5d..f414540 100644 --- a/proto/version.proto +++ b/proto/version.proto @@ -7,7 +7,7 @@ syntax = "proto3"; package typedb.protocol; enum Version { - reserved 1, 2, 3; // add past version numbers into the reserved range + reserved 1, 2, 3, 4; // add past version numbers into the reserved range UNSPECIFIED = 0; - VERSION = 4; + VERSION = 5; }