From d87ee843d867785a7b33ae6479de50bce5e197d5 Mon Sep 17 00:00:00 2001 From: tmakar Date: Fri, 21 Apr 2023 23:57:17 +0200 Subject: [PATCH 01/10] feat(elektrad,webd): implement request to add multiple metakeys (metaSetBulk) --- src/tools/elektrad/meta_handler.go | 115 ++++++++++++++++++++++--- src/tools/elektrad/router.go | 1 + src/tools/webd/package-lock.json | 4 +- src/tools/webd/src/connector.js | 13 ++- src/tools/webd/src/routes/instances.js | 18 ++++ 5 files changed, 138 insertions(+), 13 deletions(-) diff --git a/src/tools/elektrad/meta_handler.go b/src/tools/elektrad/meta_handler.go index fe57b639f4b..36639ccf4ab 100644 --- a/src/tools/elektrad/meta_handler.go +++ b/src/tools/elektrad/meta_handler.go @@ -12,17 +12,23 @@ type keyValueBody struct { Value *string `json:"value"` } +type metaKeySet struct { + MetaSet []keyValueBody `json:"metaSet"` +} + // postMetaHandler sets a Meta value on a key if a value was passed, // and deletes the existing Meta value if not. // // Arguments: -// keyName the name of the key. URL path param. -// key the name of the metaKey. Passed through the key field of the JSON body. -// value the value of the metaKey. Passed through the `value` field of the JSON body. +// +// keyName the name of the key. URL path param. +// key the name of the metaKey. Passed through the key field of the JSON body. +// value the value of the metaKey. Passed through the `value` field of the JSON body. // // Response Code: -// 201 No Content if the request is successfull. -// 401 Bad Request if no key name was passed - or the key name is invalid. +// +// 201 No Content if the request is successful. +// 401 Bad Request if no key name was passed - or the key name is invalid. // // Example: `curl -X POST -d '{ "key": "hello", "value": "world" }' localhost:33333/kdbMeta/user/test/hello` func (s *server) postMetaHandler(w http.ResponseWriter, r *http.Request) { @@ -96,16 +102,105 @@ func (s *server) postMetaHandler(w http.ResponseWriter, r *http.Request) { noContent(w) } +// postMetaBulkHandler sets a whole set of metadata. In case there is a metakey with empty value it deletes the existing +// Meta value. +// +// Arguments: +// +// keyName the name of the key. URL path param. +// metaSet the set of metakeys for the given keyName +// +// Response Code: +// +// 201 No Content if the request is successful. +// 401 Bad Request if no key name was passed - or the key name is invalid. +// +// Example: `curl -X POST -d '{ metaSet: [{"key": "hello", "value": "world"}] }' localhost:33333/kdbMeta/user/test/hello` +func (s *server) postMetaBulkHandler(w http.ResponseWriter, r *http.Request) { + var metaKeySet metaKeySet + + keyName := parseKeyNameFromURL(r) + + decoder := json.NewDecoder(r.Body) + if err := decoder.Decode(&metaKeySet); err != nil { + writeError(w, err) + return + } + + if metaKeySet.MetaSet == nil { + badRequest(w) + return + } + + errKey, err := elektra.NewKey(keyName) + + if err != nil { + internalServerError(w) + return + } + + defer errKey.Close() + + parentKey, err := elektra.NewKey(keyName) + + if err != nil { + badRequest(w) + return + } + + defer parentKey.Close() + + handle, ks := getHandle(r) + + _, err = handle.Get(ks, errKey) + + if err != nil { + writeError(w, err) + return + } + + k := ks.LookupByName(keyName) + + if k == nil { + k = parentKey + ks.AppendKey(parentKey) + } + + for _, meta := range metaKeySet.MetaSet { + if meta.Value == nil { + err = k.RemoveMeta(meta.Key) + } else { + err = k.SetMeta(meta.Key, *meta.Value) + } + + if err != nil { + writeError(w, err) + return + } + + err = set(handle, ks, errKey) + + if err != nil { + writeError(w, err) + return + } + } + + noContent(w) +} + // deleteMetaHandler deletes a Meta key. // // Arguments: -// keyName the name of the Key. -// key the name of the metaKey. Passed through the key field of the JSON body. +// +// keyName the name of the Key. +// key the name of the metaKey. Passed through the key field of the JSON body. // // Response Code: -// 201 No Content if the request is successfull. -// 401 Bad Request if no key name was passed - or the key name is invalid. -// 404 Not Found if the key was not found. +// +// 201 No Content if the request is successful. +// 401 Bad Request if no key name was passed - or the key name is invalid. +// 404 Not Found if the key was not found. // // Example: `curl -X DELETE -d '{ "key": "hello" }' localhost:33333/kdbMeta/user/test/hello` func (s *server) deleteMetaHandler(w http.ResponseWriter, r *http.Request) { diff --git a/src/tools/elektrad/router.go b/src/tools/elektrad/router.go index 7766f3ad5f4..9978b2f056a 100644 --- a/src/tools/elektrad/router.go +++ b/src/tools/elektrad/router.go @@ -30,6 +30,7 @@ func setupRouter(app *server) http.Handler { // r.HandleFunc("/kdbCp/{path:.*", app.postCopyHandler).Methods("POST") r.HandleFunc("/kdbMeta/{path:.*}", app.postMetaHandler).Methods("POST") + r.HandleFunc("/kdbMetaBulk/{path:.*}", app.postMetaBulkHandler).Methods("POST") r.HandleFunc("/kdbMeta/{path:.*}", app.deleteMetaHandler).Methods("DELETE") return r diff --git a/src/tools/webd/package-lock.json b/src/tools/webd/package-lock.json index 9a2e076b29d..bec86a4c497 100644 --- a/src/tools/webd/package-lock.json +++ b/src/tools/webd/package-lock.json @@ -1,12 +1,12 @@ { "name": "@elektra-web/webd", - "version": "1.6.0", + "version": "2.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@elektra-web/webd", - "version": "1.6.0", + "version": "2.0.0", "license": "SEE LICENSE IN ../../../LICENSE.md", "dependencies": { "body-parser": "^1.20.0", diff --git a/src/tools/webd/src/connector.js b/src/tools/webd/src/connector.js index e8d14de59e3..cec119798c6 100644 --- a/src/tools/webd/src/connector.js +++ b/src/tools/webd/src/connector.js @@ -86,6 +86,17 @@ const setmeta = (host, path, key, value) => return { status: res.status }; }); +const setmetabulk = (host, path, keySet) => + fetch(`${host}/kdbMetaBulk/${encodePath(path)}`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(keySet), + }).then((res) => { + return { status: res.status }; + }) + const rmmeta = (host, path, key) => fetch(`${host}/kdbMeta/${encodePath(path)}`, { method: "DELETE", @@ -97,4 +108,4 @@ const rmmeta = (host, path, key) => return { status: res.status }; }); -export default { version, get, set, rm, mv, cp, setmeta, rmmeta, find }; +export default { version, get, set, rm, mv, cp, setmeta, setmetabulk, rmmeta, find }; diff --git a/src/tools/webd/src/routes/instances.js b/src/tools/webd/src/routes/instances.js index 35926affae8..9b172fd76fc 100644 --- a/src/tools/webd/src/routes/instances.js +++ b/src/tools/webd/src/routes/instances.js @@ -225,4 +225,22 @@ export default function initInstanceRoutes(app) { .then(() => res.status(204).send()) .catch((err) => errorResponse(res, err)) ); + + app + .route("/api/instances/:id/kdbMetaBulk/*") + .post((req, res) => + getInstance(req.params.id) + .then((instance) => + remoteKdb.setmetabulk( + instance.host, + req.params[0], + req.body + ) + ) + .then((instanceRes) => + setSessionID(req.params.id, req.session, instanceRes) + ) + .then(() => res.status(204).send()) + .catch((err) => errorResponse(res, err)) + ); } From df4a45c582168863f77afaa9538c25a62f2ff93f Mon Sep 17 00:00:00 2001 From: tmakar Date: Fri, 21 Apr 2023 23:58:02 +0200 Subject: [PATCH 02/10] fix(install-webui): use correct key name in shell recorder test --- doc/tutorials/install-webui.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/tutorials/install-webui.md b/doc/tutorials/install-webui.md index d1055848f11..350b22ca341 100644 --- a/doc/tutorials/install-webui.md +++ b/doc/tutorials/install-webui.md @@ -132,7 +132,7 @@ First create a new key-value pair `user:/test` and set its value to 5. This can ``` - through the rest API using curl ```sh - curl -X PUT -H "Content-Type: text/plain" --data "5" http://localhost:33333/kdb/user/test + curl -X PUT -H "Content-Type: text/plain" --data "5" http://localhost:33333/kdb/user:/test ``` The output of the commandline tool will be `Set string to "5"` if the key did not exist before. @@ -142,8 +142,8 @@ Elektrad will respond with code `200`. The command ```sh -curl http://localhost:33333/kdb/user/test -#> {"exists":true,"name":"test","path":"user/test","ls":["user/test"],"value":"5","meta":""} +curl http://localhost:33333/kdb/user:/test +#> {"exists":true,"name":"test","path":"user:/test","ls":["user:/test"],"value":"5","meta":""} ``` will now return the value of the specified key `user:/test`, which is stored in the database. From 010103ee6eab3e09b101b497423d679b9525644b Mon Sep 17 00:00:00 2001 From: tmakar Date: Sat, 22 Apr 2023 00:06:57 +0200 Subject: [PATCH 03/10] test(install-webui): add shell-recorder test in readme for request with multiple metakeys --- doc/tutorials/install-webui.md | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/doc/tutorials/install-webui.md b/doc/tutorials/install-webui.md index 350b22ca341..76a4480bab1 100644 --- a/doc/tutorials/install-webui.md +++ b/doc/tutorials/install-webui.md @@ -165,6 +165,44 @@ will now return the value of the specified key `user:/test`, which is stored in +The command + +```sh +curl -X POST -H "Content-Type: application/json" -d '{"metaSet": [{"key": "metakey1", "value": "value1"},{"key": "metakey2", "value": "value2"}]}' http://localhost:33333/kdbMetaBulk/user:/test +``` + +will now create multiple metakeys at once. +In this case, it will create two (`metakey1` and `metakey2`). + +The command + +```sh +curl http://localhost:33333/kdb/user:/test +#> {"exists":true,"name":"test","path":"user:/test","ls":["user:/test"],"value":"1","meta":{"metakey1":"value1","metakey2":"value2"}} +``` + +will now also return the two metakeys. + + + +```json +{ + "exists": true, + "name": "test", + "path": "user:/test", + "ls": [ + "user:/test" + ], + "value": "5", + "meta": { + "metakey1": "value1", + "metakey2": "value2" + } +} +``` + + + ## Auth Currently, webd does not support authentication. The best way to work around From bafb82c0f34bc10885b7584a131fc8f1b6b51725 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 21 Apr 2023 22:08:32 +0000 Subject: [PATCH 04/10] Restyled by prettier --- src/tools/webd/src/connector.js | 31 +++++++++++++++++--------- src/tools/webd/src/routes/instances.js | 28 +++++++++-------------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/src/tools/webd/src/connector.js b/src/tools/webd/src/connector.js index cec119798c6..7824e4a5efd 100644 --- a/src/tools/webd/src/connector.js +++ b/src/tools/webd/src/connector.js @@ -87,15 +87,15 @@ const setmeta = (host, path, key, value) => }); const setmetabulk = (host, path, keySet) => - fetch(`${host}/kdbMetaBulk/${encodePath(path)}`, { - method: "POST", - headers: { - "Content-Type": "application/json", - }, - body: JSON.stringify(keySet), - }).then((res) => { - return { status: res.status }; - }) + fetch(`${host}/kdbMetaBulk/${encodePath(path)}`, { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(keySet), + }).then((res) => { + return { status: res.status }; + }); const rmmeta = (host, path, key) => fetch(`${host}/kdbMeta/${encodePath(path)}`, { @@ -108,4 +108,15 @@ const rmmeta = (host, path, key) => return { status: res.status }; }); -export default { version, get, set, rm, mv, cp, setmeta, setmetabulk, rmmeta, find }; +export default { + version, + get, + set, + rm, + mv, + cp, + setmeta, + setmetabulk, + rmmeta, + find, +}; diff --git a/src/tools/webd/src/routes/instances.js b/src/tools/webd/src/routes/instances.js index 9b172fd76fc..740553d0067 100644 --- a/src/tools/webd/src/routes/instances.js +++ b/src/tools/webd/src/routes/instances.js @@ -226,21 +226,15 @@ export default function initInstanceRoutes(app) { .catch((err) => errorResponse(res, err)) ); - app - .route("/api/instances/:id/kdbMetaBulk/*") - .post((req, res) => - getInstance(req.params.id) - .then((instance) => - remoteKdb.setmetabulk( - instance.host, - req.params[0], - req.body - ) - ) - .then((instanceRes) => - setSessionID(req.params.id, req.session, instanceRes) - ) - .then(() => res.status(204).send()) - .catch((err) => errorResponse(res, err)) - ); + app.route("/api/instances/:id/kdbMetaBulk/*").post((req, res) => + getInstance(req.params.id) + .then((instance) => + remoteKdb.setmetabulk(instance.host, req.params[0], req.body) + ) + .then((instanceRes) => + setSessionID(req.params.id, req.session, instanceRes) + ) + .then(() => res.status(204).send()) + .catch((err) => errorResponse(res, err)) + ); } From cbcf4e66c785043584c4fcfb382322723e439c93 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 21 Apr 2023 22:08:35 +0000 Subject: [PATCH 05/10] Restyled by prettier-markdown --- doc/tutorials/install-webui.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/tutorials/install-webui.md b/doc/tutorials/install-webui.md index 76a4480bab1..ec6477b7d57 100644 --- a/doc/tutorials/install-webui.md +++ b/doc/tutorials/install-webui.md @@ -171,7 +171,7 @@ The command curl -X POST -H "Content-Type: application/json" -d '{"metaSet": [{"key": "metakey1", "value": "value1"},{"key": "metakey2", "value": "value2"}]}' http://localhost:33333/kdbMetaBulk/user:/test ``` -will now create multiple metakeys at once. +will now create multiple metakeys at once. In this case, it will create two (`metakey1` and `metakey2`). The command From 113410cf619221ab42eba6cbcde949e225d4f242 Mon Sep 17 00:00:00 2001 From: tmakar Date: Sat, 22 Apr 2023 00:20:40 +0200 Subject: [PATCH 06/10] doc: add release notes for newly created request (webd, elektrad) --- doc/news/_preparation_next_release.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index a2c9c3078e5..2f1286460aa 100755 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -276,15 +276,15 @@ This section keeps you up-to-date with the multi-language support provided by El ## Tools -### <> +### elektrad -- <> +- Implemented new request to add multiple metakeys for one key _(Tomislav Makar @tmakar)_ - <> - <> -### <> +### webd -- <> +- Implemented new request to add multiple metakeys for one key _(Tomislav Makar @tmakar)_ - <> - <> @@ -339,6 +339,8 @@ This section keeps you up-to-date with the multi-language support provided by El - Added Hannes Laimer to `AUTHORS.md` _(Hannes Laimer @hannes99)_ - Add README to tools/kdb _(Hannes Laimer @hannes99)_ - <> +- Fixed shel-recorder test in [`install-webui.md`](../tutorials/install-webui.md) _(Tomislav Makar @tmakar)_ +- Add new shell-recorder test in [`install-webui.md`](../tutorials/install-webui.md) for newly implemented request for adding multiple metakeys for one key _(Tomislav Makar @tmakar)_ - <> - <> - <> From 0c285cd6ae65bd23cc196387bc568a621184a098 Mon Sep 17 00:00:00 2001 From: tmakar Date: Sat, 22 Apr 2023 00:30:41 +0200 Subject: [PATCH 07/10] refactor(elektrad): rename metaSet to meta --- doc/tutorials/install-webui.md | 2 +- src/tools/elektrad/meta_handler.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/tutorials/install-webui.md b/doc/tutorials/install-webui.md index ec6477b7d57..102d6afa71a 100644 --- a/doc/tutorials/install-webui.md +++ b/doc/tutorials/install-webui.md @@ -168,7 +168,7 @@ will now return the value of the specified key `user:/test`, which is stored in The command ```sh -curl -X POST -H "Content-Type: application/json" -d '{"metaSet": [{"key": "metakey1", "value": "value1"},{"key": "metakey2", "value": "value2"}]}' http://localhost:33333/kdbMetaBulk/user:/test +curl -X POST -H "Content-Type: application/json" -d '{"meta": [{"key": "metakey1", "value": "value1"},{"key": "metakey2", "value": "value2"}]}' http://localhost:33333/kdbMetaBulk/user:/test ``` will now create multiple metakeys at once. diff --git a/src/tools/elektrad/meta_handler.go b/src/tools/elektrad/meta_handler.go index 36639ccf4ab..84d46f47e4a 100644 --- a/src/tools/elektrad/meta_handler.go +++ b/src/tools/elektrad/meta_handler.go @@ -13,7 +13,7 @@ type keyValueBody struct { } type metaKeySet struct { - MetaSet []keyValueBody `json:"metaSet"` + Meta []keyValueBody `json:"meta"` } // postMetaHandler sets a Meta value on a key if a value was passed, @@ -115,7 +115,7 @@ func (s *server) postMetaHandler(w http.ResponseWriter, r *http.Request) { // 201 No Content if the request is successful. // 401 Bad Request if no key name was passed - or the key name is invalid. // -// Example: `curl -X POST -d '{ metaSet: [{"key": "hello", "value": "world"}] }' localhost:33333/kdbMeta/user/test/hello` +// Example: `curl -X POST -d '{ meta: [{"key": "hello", "value": "world"}] }' localhost:33333/kdbMetaBulk/user/test/hello` func (s *server) postMetaBulkHandler(w http.ResponseWriter, r *http.Request) { var metaKeySet metaKeySet @@ -166,7 +166,7 @@ func (s *server) postMetaBulkHandler(w http.ResponseWriter, r *http.Request) { ks.AppendKey(parentKey) } - for _, meta := range metaKeySet.MetaSet { + for _, meta := range metaKeySet.Meta { if meta.Value == nil { err = k.RemoveMeta(meta.Key) } else { From eeddc0be5082b9a72bce4a889a504b207cd6de58 Mon Sep 17 00:00:00 2001 From: tmakar Date: Sat, 22 Apr 2023 14:31:29 +0200 Subject: [PATCH 08/10] refactor(elektrad): extract metakey removal or set to separate function --- src/tools/elektrad/meta_handler.go | 64 +++++++++++++++++------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/src/tools/elektrad/meta_handler.go b/src/tools/elektrad/meta_handler.go index 84d46f47e4a..6aad6f6e40d 100644 --- a/src/tools/elektrad/meta_handler.go +++ b/src/tools/elektrad/meta_handler.go @@ -81,20 +81,8 @@ func (s *server) postMetaHandler(w http.ResponseWriter, r *http.Request) { ks.AppendKey(parentKey) } - if meta.Value == nil { - err = k.RemoveMeta(meta.Key) - } else { - err = k.SetMeta(meta.Key, *meta.Value) - } - - if err != nil { - writeError(w, err) - return - } - - err = set(handle, ks, errKey) - - if err != nil { + metaKeys := []keyValueBody{meta} + if err = removeOrSetMetaKeys(k, errKey, handle, ks, metaKeySet{metaKeys}); err != nil { writeError(w, err) return } @@ -127,7 +115,7 @@ func (s *server) postMetaBulkHandler(w http.ResponseWriter, r *http.Request) { return } - if metaKeySet.MetaSet == nil { + if metaKeySet.Meta == nil { badRequest(w) return } @@ -152,9 +140,7 @@ func (s *server) postMetaBulkHandler(w http.ResponseWriter, r *http.Request) { handle, ks := getHandle(r) - _, err = handle.Get(ks, errKey) - - if err != nil { + if _, err = handle.Get(ks, errKey); err != nil { writeError(w, err) return } @@ -166,7 +152,31 @@ func (s *server) postMetaBulkHandler(w http.ResponseWriter, r *http.Request) { ks.AppendKey(parentKey) } - for _, meta := range metaKeySet.Meta { + if err = removeOrSetMetaKeys(k, errKey, handle, ks, metaKeySet); err != nil { + writeError(w, err) + return + } + + noContent(w) +} + +// removeOrSetMetaKeys removes or sets a set of metakeys for a given k +// +// Arguments: +// +// k the key to append metakeys too +// errKey the key to append errors too +// handle the KDB handle +// ks the KeySet the key is located in +// metaKeys the set of metakeys to append to k +// +// Return: +// +// error in case it case the set metakey operation failed +func removeOrSetMetaKeys(k elektra.Key, errKey elektra.Key, handle elektra.KDB, ks elektra.KeySet, metaKeys metaKeySet) error { + var err error + + for _, meta := range metaKeys.Meta { if meta.Value == nil { err = k.RemoveMeta(meta.Key) } else { @@ -174,19 +184,17 @@ func (s *server) postMetaBulkHandler(w http.ResponseWriter, r *http.Request) { } if err != nil { - writeError(w, err) - return - } + return err + } - err = set(handle, ks, errKey) + err = set(handle, ks, errKey) - if err != nil { - writeError(w, err) - return - } + if err != nil { + return err + } } - noContent(w) + return err } // deleteMetaHandler deletes a Meta key. From ce70a985b91eb3dad573fe931a923a8c0474c7b3 Mon Sep 17 00:00:00 2001 From: tmakar Date: Sat, 22 Apr 2023 16:27:55 +0200 Subject: [PATCH 09/10] test(elektrad): add request test for bulk add for meta keys on key --- src/tools/elektrad/helper_test.go | 19 +++++++++++++++++++ src/tools/elektrad/meta_handler_test.go | 24 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/src/tools/elektrad/helper_test.go b/src/tools/elektrad/helper_test.go index 9e8689116d0..4778e54727c 100644 --- a/src/tools/elektrad/helper_test.go +++ b/src/tools/elektrad/helper_test.go @@ -183,3 +183,22 @@ func getKey(t *testing.T, keyName string) elektra.Key { return ks.Lookup(parentKey) } + +func containsMeta(t *testing.T, keyName string, expectedMeta []keyValueBody) { + key := getKey(t, keyName) + removeKey(t, keyName) + + for _, actualMeta := range key.MetaSlice() { + metaName := actualMeta.Name() + metaValue := actualMeta.String() + + found := false + for _, expectedMeta := range expectedMeta { + if expectedMeta.Key == metaName && *expectedMeta.Value == metaValue { + found = true + } + } + + Assertf(t, found, "Expected meta name %s with value %s not found", metaName, metaValue) + } +} diff --git a/src/tools/elektrad/meta_handler_test.go b/src/tools/elektrad/meta_handler_test.go index 12d78341470..8088fe8ace3 100644 --- a/src/tools/elektrad/meta_handler_test.go +++ b/src/tools/elektrad/meta_handler_test.go @@ -28,6 +28,30 @@ func TestPostMeta(t *testing.T) { Assert(t, key.Meta("postmeta") == value, "key has wrong meta value") } +func TestPostMetaBulk(t *testing.T) { + keyName := "user:/tests/elektrad/kdbmetabulk/post" + value := "Bulk set meta keys test value" + + metaOne := keyValueBody{ + Key: "postmetabulkone", + Value: &value, + } + metaTwo := keyValueBody{ + Key: "postmetabulktwo", + Value: &value, + } + + setupKey(t, keyName) + + metaSet := []keyValueBody{metaOne, metaTwo} + + w := testPost(t, "/kdbMetaBulk/"+keyName, metaKeySet{metaSet}) + code := w.Result().StatusCode + Assertf(t, code == http.StatusNoContent, "wrong status code: %v", code) + + containsMeta(t, keyName, metaSet) +} + func TestDeleteMetaHandler(t *testing.T) { keyName := "user:/tests/elektrad/kdbmeta/delete/test" value := "value" From 984f986a035611d13306f55a206dd3b62b522944 Mon Sep 17 00:00:00 2001 From: Markus Raab Date: Mon, 1 May 2023 16:43:18 +0200 Subject: [PATCH 10/10] fixed typo --- doc/news/_preparation_next_release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/news/_preparation_next_release.md b/doc/news/_preparation_next_release.md index 2f1286460aa..370afe03721 100755 --- a/doc/news/_preparation_next_release.md +++ b/doc/news/_preparation_next_release.md @@ -339,7 +339,7 @@ This section keeps you up-to-date with the multi-language support provided by El - Added Hannes Laimer to `AUTHORS.md` _(Hannes Laimer @hannes99)_ - Add README to tools/kdb _(Hannes Laimer @hannes99)_ - <> -- Fixed shel-recorder test in [`install-webui.md`](../tutorials/install-webui.md) _(Tomislav Makar @tmakar)_ +- Fixed shell-recorder test in [`install-webui.md`](../tutorials/install-webui.md) _(Tomislav Makar @tmakar)_ - Add new shell-recorder test in [`install-webui.md`](../tutorials/install-webui.md) for newly implemented request for adding multiple metakeys for one key _(Tomislav Makar @tmakar)_ - <> - <>