From 5060f68b9728bf94818ee985c16c25511f248143 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 20 Dec 2021 00:15:08 +0100 Subject: disallow extended API variables in links --- lib/Properties.hs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/Properties.hs') diff --git a/lib/Properties.hs b/lib/Properties.hs index a326e30..797a1d7 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -556,6 +556,7 @@ unwrapPath str f = case parsePath str of AbsolutePath -> forbid "absolute paths are disallowed. Use world:// instead." UnderscoreMapLink -> forbid "map links using /_/ are disallowed. Use world:// instead." AtMapLink -> forbid "map links using /@/ are disallowed. Use world:// instead." + PathVarsDisallowed -> forbid "extended API variables are not allowed in asset paths." unwrapBadgeToken :: Text -> (BadgeToken -> LintWriter a) -> LintWriter a unwrapBadgeToken str f = case parseToken str of @@ -583,6 +584,7 @@ unwrapURI sym p@(Property name _) f g = unwrapString p $ \link -> do \\"" <> name <> "\"; allowed " <> (if length allowed == 1 then "is " else "are ") <> intercalate ", " (fmap (<> "://") allowed) <> "." + VarsDisallowed -> "extended API links are disallowed in links" -- | just asserts that this is a string isString :: Property -> LintWriter a -- cgit v1.2.3