From 4f220b3761007f12983bc92618e2b8090f112262 Mon Sep 17 00:00:00 2001
From: Kaitmazian Maksim <m.kaitmazian@picodata.io>
Date: Tue, 25 Jul 2023 17:23:40 +0300
Subject: [PATCH] update tarantool-sys submodule

---
 src/luamod.lua | 12 +++++++-----
 src/schema.rs  |  1 +
 tarantool-sys  |  2 +-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/luamod.lua b/src/luamod.lua
index af201d94f7..9a3114acb1 100644
--- a/src/luamod.lua
+++ b/src/luamod.lua
@@ -217,7 +217,8 @@ function pico.create_user(user, password, opts)
 
     -- XXX: we construct this closure every time the function is called,
     -- which is bad for performance/jit. Refactor if problems are discovered.
-    local auth_data = box.internal.prepare_auth("chap-sha1", password)
+    local auth_type = box.cfg.auth_type
+    local auth_data = box.internal.prepare_auth(auth_type, password, user)
     local function make_op_if_needed()
         local grantee_def = box.space._user.index.name:get(user)
         if grantee_def ~= nil then
@@ -239,7 +240,7 @@ function pico.create_user(user, password, opts)
                 name = user,
                 schema_version = next_schema_version(),
                 auth = {
-                    method = "chap-sha1",
+                    method = auth_type,
                     data = auth_data,
                 }
             }
@@ -296,7 +297,8 @@ function pico.change_password(user, password, opts)
 
     -- XXX: we construct this closure every time the function is called,
     -- which is bad for performance/jit. Refactor if problems are discovered.
-    local auth_data = box.internal.prepare_auth("chap-sha1", password)
+    local auth_type = box.cfg.auth_type
+    local auth_data = box.internal.prepare_auth(auth_type, password, user)
     local function make_op_if_needed()
         -- TODO: allow `user` to be a user id instead of name
         local user_def = box.space._pico_user.index.name:get(user)
@@ -304,7 +306,7 @@ function pico.change_password(user, password, opts)
             box.error(box.error.NO_SUCH_USER, user)
         end
 
-        if table.equals(user_def.auth, { ["chap-sha1"] = auth_data }) then
+        if table.equals(user_def.auth, { [auth_type] = auth_data }) then
             -- Password is already the one given, no op needed
             return nil
         end
@@ -315,7 +317,7 @@ function pico.change_password(user, password, opts)
             user_id = user_def.id,
             schema_version = next_schema_version(),
             auth = {
-                method = "chap-sha1",
+                method = auth_type,
                 data = auth_data,
             }
         }
diff --git a/src/schema.rs b/src/schema.rs
index 8ed1cb6ea0..dfaa165c79 100644
--- a/src/schema.rs
+++ b/src/schema.rs
@@ -198,6 +198,7 @@ pub struct AuthDef {
 ::tarantool::define_str_enum! {
     pub enum AuthMethod {
         ChapSha1 = "chap-sha1",
+        MD5 = "md5",
     }
 }
 
diff --git a/tarantool-sys b/tarantool-sys
index c764d80869..4056a2006d 160000
--- a/tarantool-sys
+++ b/tarantool-sys
@@ -1 +1 @@
-Subproject commit c764d808692f30dfda2a823f36bb10dd67619f12
+Subproject commit 4056a2006d93e2cd8a96a52b689deacab640d48e
-- 
GitLab