From 9a1d5fd8c16b0330d4694d3f35d49f2a3dba09ed Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Tue, 18 Jun 2024 11:10:35 -0400 Subject: [PATCH 1/4] UI no longer cares about HTML --- src/main/lrsql/admin/interceptors/ui.clj | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/lrsql/admin/interceptors/ui.clj b/src/main/lrsql/admin/interceptors/ui.clj index 4786101ad..565dcf238 100644 --- a/src/main/lrsql/admin/interceptors/ui.clj +++ b/src/main/lrsql/admin/interceptors/ui.clj @@ -33,7 +33,6 @@ :enter (fn get-env [ctx] (let [{url-prefix ::i/path-prefix - enable-stmt-html ::i/statement-html? oidc-env ::oidc-i/admin-env} ctx] (assoc ctx :response @@ -42,7 +41,6 @@ (merge (cond-> {:url-prefix url-prefix :proxy-path proxy-path - :enable-stmt-html (some? enable-stmt-html) :enable-admin-delete-actor enable-admin-delete-actor :enable-admin-status enable-admin-status :enable-reactions enable-reactions From 33266a3dba0673754f48a36496a440f3c7affd47 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Tue, 18 Jun 2024 11:31:42 -0400 Subject: [PATCH 2/4] review changes --- doc/env_vars.md | 2 +- src/test/lrsql/admin/route_test.clj | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/env_vars.md b/doc/env_vars.md index bf8e95aa5..6ed85f194 100644 --- a/doc/env_vars.md +++ b/doc/env_vars.md @@ -201,7 +201,7 @@ These config vars enable and configure browser security response headers from th | `LRSQL_ENABLE_ADMIN_DELETE_ACTOR` | `enableAdminDeleteActor` | Whether or not to enable the route and UI for deleting actors and related documents | `false` | | `LRSQL_ENABLE_ADMIN_UI` | `enableAdminUi` | Whether or not to serve the administrative UI at `/admin` | `true` | | `LRSQL_ENABLE_ADMIN_STATUS` | `enableAdminStatus` | Whether or not to serve admin system status data that queries the database. | `true` | -| `LRSQL_ENABLE_STMT_HTML` | `enableStmtHtml` | Whether or not HTML data is returned in the LRS HTTP response. If `false` disables HTML rendering even if `LRSQL_ENABLE_ADMIN_UI` is `true`. In that case the UI will not display the Statement Browser feature. | `true` | +| `LRSQL_ENABLE_STMT_HTML` | `enableStmtHtml` | Whether or not HTML data is returned in the LRS HTTP response if the Accept type is specified as text/html. If `false` disables HTML rendering regardless of Accept type. | `true` | | `LRSQL_ADMIN_LANGUAGE` | `adminLanguage` | Allows override of default RFC5646 language code (`en-US`). May require that you add new language map entries to `resources/lrsql/localization/language.json` to add a new language. | `en-US` | [<- Back to Index](index.md) diff --git a/src/test/lrsql/admin/route_test.clj b/src/test/lrsql/admin/route_test.clj index 5c1bcce2a..8ec278a5b 100644 --- a/src/test/lrsql/admin/route_test.clj +++ b/src/test/lrsql/admin/route_test.clj @@ -142,8 +142,7 @@ (let [{:keys [status body]} (get-env content-type) edn-body (u/parse-json body)] (is (= 200 status)) - (is (= (get edn-body "url-prefix") "/xapi")) - (is (= (get edn-body "enable-stmt-html") true)))) + (is (= (get edn-body "url-prefix") "/xapi")))) (testing "create account with username `myname` and password `swordfish`" (let [{:keys [status body]} (create-account headers req-body) From 2f4198cf77871f6cdd1091f2ee54fd4b9999d49d Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Tue, 18 Jun 2024 12:11:17 -0400 Subject: [PATCH 3/4] UI version bump and more docs --- Makefile | 3 ++- doc/endpoints.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4166e60b8..d5c69dbb0 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Version of LRS Admin UI to use -LRS_ADMIN_UI_VERSION ?= v0.1.20 +LRS_ADMIN_UI_VERSION ?= v0.1.21 LRS_ADMIN_UI_LOCATION ?= https://github.com/yetanalytics/lrs-admin-ui/releases/download/${LRS_ADMIN_UI_VERSION}/lrs-admin-ui.zip LRS_ADMIN_ZIPFILE ?= lrs-admin-ui-${LRS_ADMIN_UI_VERSION}.zip @@ -273,6 +273,7 @@ run-jar-sqlite: target/bundle LRSQL_ADMIN_PASS_DEFAULT=password \ LRSQL_API_KEY_DEFAULT=username \ LRSQL_API_SECRET_DEFAULT=password \ + LRSQL_ENABLE_STMT_HTML=false \ bin/run_sqlite.sh # NOTE: Requires a running Postgres instance! diff --git a/doc/endpoints.md b/doc/endpoints.md index 32f77557e..29bbcf557 100644 --- a/doc/endpoints.md +++ b/doc/endpoints.md @@ -41,7 +41,7 @@ The response body contains a newly generated JSON Web Token (JWT) on success. A #### Misc Admin Routes -- `GET http://example.org/admin/env`: Get select environment variables about the configuration which may aid in client-side operations. Currently returns a map containing the configuration variables `urlPrefix` and `enableStmtHtml`. +- `GET http://example.org/admin/env`: Get select environment variables about the configuration which may aid in client-side operations. - `DELETE http://example.org/admin/agents`: Runs a *hard delete* of all records of an actor, and associated records (statements, attachments, etc). Intended for privacy purposes like GDPR. Body should be a JSON object of form `{"actor-ifi":}`. Disabled unless the configuration variable enableAdminDeleteActor to be set to `true`. ### Reaction Management Routes From 23af8f20fb32abad4586e0cfce14bb8c8a29f219 Mon Sep 17 00:00:00 2001 From: Cliff Casey Date: Tue, 18 Jun 2024 12:13:10 -0400 Subject: [PATCH 4/4] removed test arg --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index d5c69dbb0..77f670005 100644 --- a/Makefile +++ b/Makefile @@ -273,7 +273,6 @@ run-jar-sqlite: target/bundle LRSQL_ADMIN_PASS_DEFAULT=password \ LRSQL_API_KEY_DEFAULT=username \ LRSQL_API_SECRET_DEFAULT=password \ - LRSQL_ENABLE_STMT_HTML=false \ bin/run_sqlite.sh # NOTE: Requires a running Postgres instance!