From 2686d024a517bc8b1d04c1ae4ad013df8b1aab9e Mon Sep 17 00:00:00 2001 From: kelvinqian00 Date: Tue, 27 Aug 2024 11:12:24 -0400 Subject: [PATCH 1/5] Update gitignore for VSCode files --- .clj-kondo/config.edn | 1 + .gitignore | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 .clj-kondo/config.edn diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/.clj-kondo/config.edn @@ -0,0 +1 @@ +{} diff --git a/.gitignore b/.gitignore index 549d464b..18c6626e 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,7 @@ npm-debug.log package.json *.log /out_test +.calva/ +.clj-kondo/* +!.clj-kondo/config.edn +.lsp/ From 891fdd98f8d3891a778ee7b14d633effdd9507c5 Mon Sep 17 00:00:00 2001 From: kelvinqian00 Date: Tue, 27 Aug 2024 11:13:09 -0400 Subject: [PATCH 2/5] Update to latest xapi-schema Git SHA --- deps.edn | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deps.edn b/deps.edn index 3a6b89be..f16e6877 100644 --- a/deps.edn +++ b/deps.edn @@ -3,7 +3,9 @@ {org.clojure/clojure {:mvn/version "1.10.1"} org.clojure/clojurescript {:mvn/version "1.10.741"} org.clojure/core.async {:mvn/version "1.5.648"} - com.yetanalytics/xapi-schema {:mvn/version "1.3.0" + com.yetanalytics/xapi-schema {#_#_:mvn/version "1.3.0" + :git/sha "63614c73224ecb54843177ce8878a32fc9cabc50" + :git/url "https://github.com/yetanalytics/xapi-schema.git" :exclusions [org.clojure/clojurescript]} com.yetanalytics/gen-openapi {:mvn/version "0.0.5"} cheshire/cheshire {:mvn/version "5.10.1"} From 5972539de89c8ff3dda0a2cb60a9322c18747708 Mon Sep 17 00:00:00 2001 From: kelvinqian00 Date: Tue, 27 Aug 2024 11:13:32 -0400 Subject: [PATCH 3/5] Add empty statement store test --- src/test/com/yetanalytics/lrs_test.clj | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/test/com/yetanalytics/lrs_test.clj b/src/test/com/yetanalytics/lrs_test.clj index fb01a555..1c04d70b 100644 --- a/src/test/com/yetanalytics/lrs_test.clj +++ b/src/test/com/yetanalytics/lrs_test.clj @@ -54,12 +54,25 @@ lrs/authorize lrs/authorize-async]) +(def auth-id + {:auth {:no-op {}} + :prefix "" + :scopes #{:scope/all} + :agent {"mbox" "mailto:lrs@yetanalytics.io"}}) + +(deftest empty-store-test + (let [lrs (doto (mem/new-lrs {:statements-result-max 100}) + (lrs/store-statements auth-id [] [])) + ret-statements (get-in (lrs/get-statements lrs + auth-id + {:limit 100} + #{"en-US"}) + [:statement-result :statements])] + (is (s/valid? ::xs/statements ret-statements)) + (is (empty? ret-statements)))) + (deftest query-test - (let [auth-id {:auth {:no-op {}} - :prefix "" - :scopes #{:scope/all} - :agent {"mbox" "mailto:lrs@yetanalytics.io"}} - ;; The serialized state shouldn't be used for this, because we're + (let [;; The serialized state shouldn't be used for this, because we're ;; changing things around. ;; The datasim data is not currently normalized, but only happens at a ;; max precision of 1 ms. That's timestamps though, looks like we have @@ -75,8 +88,7 @@ [:statement-result :statements])) ret-statements (get-ss {:limit 100})] (testing (format "%s valid return statements?" (count ret-statements)) - (is (s/valid? (s/every ::xs/statement) - ret-statements))) + (is (s/valid? ::xs/statements ret-statements))) (testing "preserved?" (is (= (dissoc (first ret-statements) "authority" From 3327f6a675eb83327678cec4eeaaf2c984c71604 Mon Sep 17 00:00:00 2001 From: kelvinqian00 Date: Tue, 24 Sep 2024 15:05:25 -0400 Subject: [PATCH 4/5] Use new xapi-schema tagged version --- deps.edn | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/deps.edn b/deps.edn index f16e6877..b46da124 100644 --- a/deps.edn +++ b/deps.edn @@ -3,9 +3,7 @@ {org.clojure/clojure {:mvn/version "1.10.1"} org.clojure/clojurescript {:mvn/version "1.10.741"} org.clojure/core.async {:mvn/version "1.5.648"} - com.yetanalytics/xapi-schema {#_#_:mvn/version "1.3.0" - :git/sha "63614c73224ecb54843177ce8878a32fc9cabc50" - :git/url "https://github.com/yetanalytics/xapi-schema.git" + com.yetanalytics/xapi-schema {:mvn/version "1.4.0" :exclusions [org.clojure/clojurescript]} com.yetanalytics/gen-openapi {:mvn/version "0.0.5"} cheshire/cheshire {:mvn/version "5.10.1"} From 8549fd60e8acee10c03d9a2d58643b40404fe3b0 Mon Sep 17 00:00:00 2001 From: kelvinqian00 Date: Tue, 24 Sep 2024 15:14:08 -0400 Subject: [PATCH 5/5] Update CHANGELOG and retroactively include previous versions --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0e207e8..cc9ffe75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,33 @@ ## Unreleased +## [1.2.21] - 2024-09-24 +- Update xapi-schema to 1.4.0 to support empty statement batch POSTs +- Update GitHub actions to resolve Node deprecation warnings + +## [1.2.20] - 2024-07-25 +- Fix error in `/xapi/statements` POST OpenAPI spec + +## [1.2.19] - 2024-07-18 +- Implement OpenAPI annotations + +## [1.2.18] - 2024-05-20 +- Update xapi-schema to 1.3.0 +- Address Babel vulnerability + +## [1.2.17] - 2024-02-16 +- Changed Clojars deploy action + +## [1.2.16] - 2023-11-22 +- Support Attachment and Document Scanning + +## [1.2.15] - 2023-02-22 +- CVE-2023-24998: Update commons-fileupload to 1.5 +- Update package-lock for qs vulnerability + +## [1.2.14] - 2022-11-16 +- Exclude msgpack from dependencies to clear CVE-2022-41719 + ## [1.2.13] - 2022-10-24 - Update GitHub CI and CD to remove deprecation warnings