From 07bb1db91b6d775244190541f8bfd53835c404a6 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 20 Dec 2021 00:28:00 +0100 Subject: forbid opening local html files in iframes --- lib/Properties.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Properties.hs b/lib/Properties.hs index 797a1d7..05020f5 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -225,7 +225,9 @@ checkLayer = do checkObjectProperty :: Object -> Property -> LintWriter Layer checkObjectProperty obj p@(Property name _) = case name of - "url" -> pure () + "url" -> unwrapURI (Proxy @"website") p + (dependsOn . Link) + (const $ forbid "using \"url\" to open local html files is disallowed.") "allowApi" -> forbidProperty name "getBadge" -> do when (1 /= length (getProperties obj)) @@ -329,7 +331,7 @@ checkTileLayerProperty p@(Property name _value) = case name of suggestProperty $ Property "openWebsiteTrigger" (StrProp "onaction") unwrapURI (Proxy @"website") p (dependsOn . Link) - (dependsOn . Local) + (const $ forbid "using openWebsite to access local html files is disallowed.") "openWebsiteTrigger" -> do isString p requireProperty "openWebsite" -- cgit v1.2.3 From 8b4dacb1844279dfbefa01af6d11e44e3067892c Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 20 Dec 2021 10:08:37 +0000 Subject: run pipeline only on main --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 79b5e36..144ac73 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,7 @@ stages: - build build-job: + only: main stage: build script: - stack build -- cgit v1.2.3 From ae49488e97c878c246431eba69b0f2869a6f78b6 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 20 Dec 2021 10:09:25 +0000 Subject: Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 144ac73..268570b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,7 +4,8 @@ stages: - build build-job: - only: main + only: + refs: main stage: build script: - stack build -- cgit v1.2.3 From 5c843aec6f9aafb37cf5d166e6ae74974e773daf Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 20 Dec 2021 10:09:51 +0000 Subject: Update .gitlab-ci.yml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 268570b..a74364b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,8 @@ stages: build-job: only: - refs: main + refs: + - main stage: build script: - stack build -- cgit v1.2.3