From 441a83e9e2a13177c8eb6f59bbafebc265ff974c Mon Sep 17 00:00:00 2001 From: C Beach Date: Mon, 9 Mar 2020 21:49:03 -0500 Subject: [PATCH 1/7] chore: more autotest fixes due to old project --- .../itemdefinition/2/2406791c-0f71-4059-8e3e-2a3c529e23e1.xml | 4 ++-- .../29/4f1739d7-dadf-4d97-8259-e224b9459f18.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/autotest/Tests/tests/asc/institution/itemdefinition/2/2406791c-0f71-4059-8e3e-2a3c529e23e1.xml b/autotest/Tests/tests/asc/institution/itemdefinition/2/2406791c-0f71-4059-8e3e-2a3c529e23e1.xml index 30dae6538e..425ac5e18b 100644 --- a/autotest/Tests/tests/asc/institution/itemdefinition/2/2406791c-0f71-4059-8e3e-2a3c529e23e1.xml +++ b/autotest/Tests/tests/asc/institution/itemdefinition/2/2406791c-0f71-4059-8e3e-2a3c529e23e1.xml @@ -179,7 +179,7 @@ StoreJs if (request.get('doit') == 'Create binary file') { - var connection = utils.getConnection("https://github.com/equella/Equella/blob/cfd7f9027de68635d73b60958079196bab165ead/Installer/resources/images/logo.gif?raw=true"); + var connection = utils.getConnection("https://raw.githubusercontent.com/openequella/openEQUELLA/develop/Installer/resources/images/logo.gif?raw=true"); var response = connection.getResponse(true); staging.writeBinaryFile("equellaLogo.gif ",response.getAsBinaryData()); } @@ -350,4 +350,4 @@ if(request.get("doit") == 'Get File Details') false - \ No newline at end of file + diff --git a/autotest/Tests/tests/asc/institution/itemdefinition/29/4f1739d7-dadf-4d97-8259-e224b9459f18.xml b/autotest/Tests/tests/asc/institution/itemdefinition/29/4f1739d7-dadf-4d97-8259-e224b9459f18.xml index d23a18ef1b..773519aa56 100644 --- a/autotest/Tests/tests/asc/institution/itemdefinition/29/4f1739d7-dadf-4d97-8259-e224b9459f18.xml +++ b/autotest/Tests/tests/asc/institution/itemdefinition/29/4f1739d7-dadf-4d97-8259-e224b9459f18.xml @@ -143,7 +143,7 @@ if(request.get('doit') == 'Edit text file') if (request.get('doit') == 'Create binary attachment') { - var response = utils.getConnection("https://github.com/equella/Equella/blob/cfd7f9027de68635d73b60958079196bab165ead/Installer/resources/images/logo.gif?raw=true").getResponse(true); + var response = utils.getConnection("https://raw.githubusercontent.com/openequella/openEQUELLA/develop/Installer/resources/images/logo.gif?raw=true").getResponse(true); attachments.createBinaryFileAttachment("equellaLogo.gif ","EQUELLA Logo",response.getAsBinaryData()); attachments.addExistingFileAsAttachment("equellaLogo.gif ","EQUELLA Logo"); @@ -362,4 +362,4 @@ Contents: false - \ No newline at end of file + From 83e55fb4a1e10a40e474e7deeaaec7313daebcc1 Mon Sep 17 00:00:00 2001 From: PenghaiZhang <47203811+PenghaiZhang@users.noreply.github.com> Date: Wed, 18 Mar 2020 09:57:58 +1100 Subject: [PATCH 2/7] Remove the usage of Youtube attachment/tool for three auto-tests (#1542) * Update MaxAttachmentsTest and its testing Collection * Update ItemUnlock Test and its testing Collection * Update ViewerTest and its testing Item --- .../webtests/test/contribute/ItemUnlock.java | 19 +++---- .../controls/MaxAttachmentsTest.java | 18 +++--- .../tle/webtests/test/viewing/ViewerTest.java | 2 +- .../items/{2/217346.xml => 108/682604.xml} | 56 +++++++++---------- .../{2/217346 => 108/682604}/_ITEM/item.xml | 0 .../f63c0eff-e9b9-4d60-a690-baa8638f051c.xml | 39 ++++++++++--- .../99c20331-4a92-4b87-b6b3-1366a5148370.xml | 32 +++++++++-- 7 files changed, 100 insertions(+), 66 deletions(-) rename autotest/Tests/tests/contribute/institution/items/{2/217346.xml => 108/682604.xml} (81%) rename autotest/Tests/tests/contribute/institution/items/{2/217346 => 108/682604}/_ITEM/item.xml (100%) diff --git a/autotest/OldTests/src/test/java/com/tle/webtests/test/contribute/ItemUnlock.java b/autotest/OldTests/src/test/java/com/tle/webtests/test/contribute/ItemUnlock.java index 269baea1aa..a69c1118a5 100644 --- a/autotest/OldTests/src/test/java/com/tle/webtests/test/contribute/ItemUnlock.java +++ b/autotest/OldTests/src/test/java/com/tle/webtests/test/contribute/ItemUnlock.java @@ -9,16 +9,15 @@ import com.tle.webtests.pageobject.wizard.ContributePage; import com.tle.webtests.pageobject.wizard.WizardPageTab; import com.tle.webtests.pageobject.wizard.controls.UniversalControl; -import com.tle.webtests.pageobject.wizard.controls.universal.YouTubeUniversalControlType; +import com.tle.webtests.pageobject.wizard.controls.universal.UrlUniversalControlType; import com.tle.webtests.test.AbstractCleanupTest; import org.testng.annotations.Test; @TestInstitution("fiveo") public class ItemUnlock extends AbstractCleanupTest { - private static final String RENAMED_NAME = "A Video"; - private static final String ORIGINAL_NAME = - "What is a function? | Functions and their graphs | Algebra II | Khan Academy"; - private static final String DISPLAY_NAME = "Original Displayname"; + private static final String RENAMED_NAME = "Google Renamed"; + private static final String DISPLAY_NAME = "Google"; + private final String LINK_ATTACHMENT_URL = "https://www.google.com"; @Test public void unlockAndResumeItem() { @@ -30,10 +29,10 @@ public void unlockAndResumeItem() { new ContributePage(context).load().openWizard("Youtube Channel Testing Collection"); wizard.editbox(1, itemName); UniversalControl control = wizard.universalControl(2); - YouTubeUniversalControlType youtube = - control.addDefaultResource(new YouTubeUniversalControlType(control)); - youtube.search("Functions and their graphs", "The Khan Academy").selectVideo(1, ORIGINAL_NAME); - control.editResource(youtube.editPage(), ORIGINAL_NAME).setDisplayName(DISPLAY_NAME).save(); + + UrlUniversalControlType urlControl = + control.addDefaultResource(new UrlUniversalControlType(control)); + urlControl.addUrl(LINK_ATTACHMENT_URL, DISPLAY_NAME); SummaryPage item = wizard.save().publish(); assertTrue(item.attachments().attachmentExists(DISPLAY_NAME)); @@ -49,7 +48,7 @@ public void unlockAndResumeItem() { control = wizard.universalControl(2); control - .editResource(new YouTubeUniversalControlType(control), DISPLAY_NAME) + .editResource(new UrlUniversalControlType(control), DISPLAY_NAME) .setDisplayName(RENAMED_NAME) .save(); diff --git a/autotest/OldTests/src/test/java/com/tle/webtests/test/contribute/controls/MaxAttachmentsTest.java b/autotest/OldTests/src/test/java/com/tle/webtests/test/contribute/controls/MaxAttachmentsTest.java index 2fc05df984..e8e57a6325 100644 --- a/autotest/OldTests/src/test/java/com/tle/webtests/test/contribute/controls/MaxAttachmentsTest.java +++ b/autotest/OldTests/src/test/java/com/tle/webtests/test/contribute/controls/MaxAttachmentsTest.java @@ -4,7 +4,7 @@ import com.tle.webtests.pageobject.wizard.ContributePage; import com.tle.webtests.pageobject.wizard.WizardPageTab; import com.tle.webtests.pageobject.wizard.controls.UniversalControl; -import com.tle.webtests.pageobject.wizard.controls.universal.YouTubeUniversalControlType; +import com.tle.webtests.pageobject.wizard.controls.universal.UrlUniversalControlType; import com.tle.webtests.test.AbstractCleanupAutoTest; import com.tle.webtests.test.files.Attachments; import java.net.URL; @@ -15,8 +15,8 @@ public class MaxAttachmentsTest extends AbstractCleanupAutoTest { private static final String COLLECTION = "Max attachments restriction"; private final URL[] ATTACHMENTS = {Attachments.get("page.html"), Attachments.get("pageB.html")}; - private final String ORIGINAL_TITLE = "Peter Andre - Mysterious Girl (Official Music Video)"; - private final String YOUTUBE_TITLE = "good song"; + private final String LINK_ATTACHMENT_URL = "https://www.google.com"; + private final String LINK_ATTACHMENT_NAME = "Google"; @Test public void maxFiles() { @@ -25,19 +25,15 @@ public void maxFiles() { wizard.editbox(1, fullName); UniversalControl control = wizard.universalControl(2); - YouTubeUniversalControlType youTubeControl = - control.addResource(new YouTubeUniversalControlType(control)); - youTubeControl.search("mysterious girl peter andre", null).selectVideo(1, ORIGINAL_TITLE); - control - .editResource(youTubeControl.editPage(), ORIGINAL_TITLE) - .setDisplayName(YOUTUBE_TITLE) - .save(); + UrlUniversalControlType urlControl = control.addResource(new UrlUniversalControlType(control)); + urlControl.addUrl(LINK_ATTACHMENT_URL, LINK_ATTACHMENT_NAME); + wizard.addFiles(2, false, ATTACHMENTS); wizard.save().finishInvalid(wizard); Assert.assertEquals( wizard.getErrorMessage(2), "This control is restricted to a maximum of 2 attachments. Please remove 1 attachment(s)."); - control.deleteResource(YOUTUBE_TITLE); + control.deleteResource(LINK_ATTACHMENT_NAME); wizard.save().publish(); } } diff --git a/autotest/OldTests/src/test/java/com/tle/webtests/test/viewing/ViewerTest.java b/autotest/OldTests/src/test/java/com/tle/webtests/test/viewing/ViewerTest.java index f913adcacc..972f9fc7fb 100644 --- a/autotest/OldTests/src/test/java/com/tle/webtests/test/viewing/ViewerTest.java +++ b/autotest/OldTests/src/test/java/com/tle/webtests/test/viewing/ViewerTest.java @@ -84,7 +84,7 @@ public void testHtml5Player() { public void testLTIViewer() { SummaryPage summary = SearchPage.searchAndView(context, "lti viewer item"); LTIViewerPage lti = - summary.attachments().viewAttachment("youtube tool", new LTIViewerPage(context)); + summary.attachments().viewAttachment("Vimeo tool", new LTIViewerPage(context)); lti.searchYoutube("ghosts"); lti.embedYTResult(4); } diff --git a/autotest/Tests/tests/contribute/institution/items/2/217346.xml b/autotest/Tests/tests/contribute/institution/items/108/682604.xml similarity index 81% rename from autotest/Tests/tests/contribute/institution/items/2/217346.xml rename to autotest/Tests/tests/contribute/institution/items/108/682604.xml index 430705359b..d8ea5bad19 100644 --- a/autotest/Tests/tests/contribute/institution/items/2/217346.xml +++ b/autotest/Tests/tests/contribute/institution/items/108/682604.xml @@ -1,32 +1,28 @@ - 217346 + 682604 2c5be16d-90ec-46ba-b137-724d595f838b 1 adfcaf58-241b-4eca-9740-6a26d1c3dd58 - 2015-05-18 10:49:14.041 + 2020-03-17 16:13:10.392 2013-12-17 13:59:20.29 - 2015-05-18 10:49:14.041 + 2020-03-17 16:13:10.392 -1.0 false LIVE - 217365 + 682610 9b246ac5-1916-4ec7-8209-04e7e252479b - youtube tool + Vimeo tool lti - https://www.edu-apps.org/tools/youtube/icon.png + https://www.edu-apps.org/assets/lti_public_resources/vimeo_icon.png SHARED_SECRET secret - - ICON_URL - https://www.edu-apps.org/assets/lti_public_resources/youtube_icon.png - SHARE_EMAIL true @@ -35,17 +31,13 @@ CONSUMER_KEY key - - CUSTOM_PARAMS - - SHARE_NAME true LAUNCH_URL - https://www.edu-apps.org/lti_public_resources/?tool_id=youtube + https://www.edu-apps.org/lti_public_resources/?tool_id=vimeo EXTERNAL_TOOL_PROVIDER_UUID @@ -60,7 +52,7 @@ - 217353 + 682607 2013-12-17 13:59:20.28 2013-12-17 14:44:26.98 2013-12-17 13:59:20.28 @@ -72,7 +64,7 @@ - 217369 + 682611 adfcaf58-241b-4eca-9740-6a26d1c3dd58 2013-12-17 13:59:20.28 false @@ -80,7 +72,7 @@ DRAFT - 217371 + 682612 adfcaf58-241b-4eca-9740-6a26d1c3dd58 2013-12-17 13:59:20.28 false @@ -88,7 +80,7 @@ DRAFT - 217373 + 682613 adfcaf58-241b-4eca-9740-6a26d1c3dd58 2013-12-17 13:59:20.28 false @@ -96,7 +88,7 @@ LIVE - 217374 + 682614 adfcaf58-241b-4eca-9740-6a26d1c3dd58 2014-01-08 11:15:19.267 false @@ -104,13 +96,21 @@ LIVE - 217494 + 682615 adfcaf58-241b-4eca-9740-6a26d1c3dd58 2015-05-18 10:49:14.041 false edit LIVE + + 682721 + TLE_ADMINISTRATOR + 2020-03-17 16:13:10.392 + false + edit + LIVE + @@ -118,13 +118,13 @@ - 217355 + 682608 - en_US + en_GB - 217496 - en_US + 682722 + en_GB 2 lti viewer item @@ -132,10 +132,6 @@ - - 217495 - - 0 false @@ -143,4 +139,4 @@ false default - \ No newline at end of file + diff --git a/autotest/Tests/tests/contribute/institution/items/2/217346/_ITEM/item.xml b/autotest/Tests/tests/contribute/institution/items/108/682604/_ITEM/item.xml similarity index 100% rename from autotest/Tests/tests/contribute/institution/items/2/217346/_ITEM/item.xml rename to autotest/Tests/tests/contribute/institution/items/108/682604/_ITEM/item.xml diff --git a/autotest/Tests/tests/fiveo/institution/itemdefinition/0/f63c0eff-e9b9-4d60-a690-baa8638f051c.xml b/autotest/Tests/tests/fiveo/institution/itemdefinition/0/f63c0eff-e9b9-4d60-a690-baa8638f051c.xml index 87eddd7531..4c8b1b68ea 100644 --- a/autotest/Tests/tests/fiveo/institution/itemdefinition/0/f63c0eff-e9b9-4d60-a690-baa8638f051c.xml +++ b/autotest/Tests/tests/fiveo/institution/itemdefinition/0/f63c0eff-e9b9-4d60-a690-baa8638f051c.xml @@ -1,16 +1,16 @@ - 215972 + 679872 f63c0eff-e9b9-4d60-a690-baa8638f051c adfcaf58-241b-4eca-9740-6a26d1c3dd58 - 2011-08-23 13:14:26.556 + 2020-03-17 15:38:48.317 2011-08-23 13:14:26.556 - 215973 + 679873 en - 215974 + 679874 en 1 This collection is for testing the youtube channel. @@ -20,12 +20,12 @@ - 215975 + 679875 en - 215976 + 679876 en 1 Youtube Channel Testing Collection @@ -41,8 +41,9 @@ Wizard -2147483648 - 215977 + 679877 + @@ -126,6 +127,14 @@ universal + + EnableMaxFiles + false + + + AllowPreviews + false + AllowChannel true @@ -154,13 +163,21 @@ AttachmentTypes - youTubeHandler + urlHandler + + MaxFiles + 0 + OptionAllowChannel true + + LINK_DUPLICATION_CHECK + false + OptionRestrictChannel false @@ -175,6 +192,12 @@ false false + + STRUCTURED + false + false + false + diff --git a/autotest/Tests/tests/fiveo/institution/itemdefinition/95/99c20331-4a92-4b87-b6b3-1366a5148370.xml b/autotest/Tests/tests/fiveo/institution/itemdefinition/95/99c20331-4a92-4b87-b6b3-1366a5148370.xml index 856e362bb7..e827aafe8e 100644 --- a/autotest/Tests/tests/fiveo/institution/itemdefinition/95/99c20331-4a92-4b87-b6b3-1366a5148370.xml +++ b/autotest/Tests/tests/fiveo/institution/itemdefinition/95/99c20331-4a92-4b87-b6b3-1366a5148370.xml @@ -1,16 +1,16 @@ - 215996 + 678574 99c20331-4a92-4b87-b6b3-1366a5148370 TLE_ADMINISTRATOR - 2015-03-20 10:08:41.852 + 2020-03-17 15:17:51.464 2015-03-20 10:08:41.852 - 215997 + 678575 en - 215998 + 678576 en 1 Max attachments restriction @@ -26,7 +26,7 @@ Basic -2147483648 - 215999 + 678577 @@ -116,14 +116,26 @@ EnableMaxFiles true + + FILE_SCORM_PACKAGE + false + FILE_NOUNZIP false + + FILE_MAXFILESIZE + 0 + YoutubeChannels + + FILE_RESTRICTSIZE + false + FILE_QTI_PACKAGE false @@ -132,13 +144,21 @@ AttachmentTypes fileHandler - youTubeHandler + urlHandler + + LINK_DUPLICATION_CHECK + false + OptionRestrictChannel false + + FILE_DUPLICATION_CHECK + false + AllowPreviews false From 39d4ad2493cbde70b858f36081e90fc3cec681dc Mon Sep 17 00:00:00 2001 From: Chris Beach Date: Tue, 3 Mar 2020 21:39:57 -0600 Subject: [PATCH 3/7] Release/2020.1.0 chore/update tomcat to 8 5 51 (#1521) * Update Apache Tomcat packages to v8.5.51 and #1520 Disable required secret Co-authored-by: WhiteSource Renovate --- .../src/com/tle/tomcat/service/impl/TomcatServiceImpl.java | 1 + Source/Server/equellaserver/build.sbt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/service/impl/TomcatServiceImpl.java b/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/service/impl/TomcatServiceImpl.java index c352d1ad0b..8600da4ff2 100644 --- a/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/service/impl/TomcatServiceImpl.java +++ b/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/service/impl/TomcatServiceImpl.java @@ -182,6 +182,7 @@ public void startup() { if (ajpPort != -1) { Connector connector = new Connector(useBio ? BIO_AJP : "AJP/1.3"); connector.setPort(ajpPort); + connector.setAttribute("requiredSecret", false); connector.setAttribute("tomcatAuthentication", false); connector.setAttribute("packetSize", "65536"); setConnector(connector); diff --git a/Source/Server/equellaserver/build.sbt b/Source/Server/equellaserver/build.sbt index 183e13f7cc..316e477a8a 100644 --- a/Source/Server/equellaserver/build.sbt +++ b/Source/Server/equellaserver/build.sbt @@ -17,8 +17,8 @@ unmanagedClasspath in Runtime += (baseDirectory in LocalProject("learningedge_co val jacksonVersion = "2.9.9" val axis2Version = "1.6.2" -val TomcatVersion = "8.5.41" -val SwaggerVersion = "1.5.22" +val TomcatVersion = "8.5.51" +val SwaggerVersion = "1.5.24" val RestEasyVersion = "3.5.0.Final" val simpledbaVersion = "0.1.9" val circeVersion = "0.11.1" From 8bd26cc175b615d3b9b10c0e5fcf32e265a33f11 Mon Sep 17 00:00:00 2001 From: Chris Beach Date: Mon, 30 Mar 2020 22:00:18 -0500 Subject: [PATCH 4/7] Follow ups to GhostCat - AJP connector (#1583) * #1533 Added in ajp.secret and ajp.secret.required --- .../src/com/tle/tomcat/guice/TomcatModule.java | 5 +++++ .../tomcat/service/impl/TomcatServiceImpl.java | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/guice/TomcatModule.java b/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/guice/TomcatModule.java index 80a9685c6a..3be19e90a7 100644 --- a/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/guice/TomcatModule.java +++ b/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/guice/TomcatModule.java @@ -28,6 +28,11 @@ protected void configure() { bindInt("http.port", -1); bindInt("https.port", -1); bindInt("ajp.port", -1); + bindProp("ajp.address", "127.0.0.1"); + // Makes sense for this to be in mandatory-config, but we have to provide a default, non-null + // value + bindProp("ajp.secret", "ignore"); + bindBoolean("ajp.secret.required", true); bindInt("tomcat.max.threads", -2); install(new TomcatOptionalModule()); } diff --git a/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/service/impl/TomcatServiceImpl.java b/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/service/impl/TomcatServiceImpl.java index 8600da4ff2..a623d3c76d 100644 --- a/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/service/impl/TomcatServiceImpl.java +++ b/Source/Plugins/Core/com.equella.core/src/com/tle/tomcat/service/impl/TomcatServiceImpl.java @@ -83,6 +83,18 @@ public class TomcatServiceImpl implements TomcatService, StartupBean, TomcatRest @Named("ajp.port") private int ajpPort; + @Inject + @Named("ajp.address") + private String ajpAddress; + + @Inject + @Named("ajp.secret") + private String ajpSecret; + + @Inject + @Named("ajp.secret.required") + private boolean ajpSecretRequired; + @Inject @Named("tomcat.max.threads") private int maxThreads; @@ -182,9 +194,13 @@ public void startup() { if (ajpPort != -1) { Connector connector = new Connector(useBio ? BIO_AJP : "AJP/1.3"); connector.setPort(ajpPort); - connector.setAttribute("requiredSecret", false); + if (!ajpSecret.equals("ignore")) { + connector.setAttribute("secret", ajpSecret); + } + connector.setAttribute("secretRequired", ajpSecretRequired); connector.setAttribute("tomcatAuthentication", false); connector.setAttribute("packetSize", "65536"); + connector.setAttribute("address", ajpAddress); setConnector(connector); } From d414a35340da60abbff8890f5119be2e59cc3431 Mon Sep 17 00:00:00 2001 From: PenghaiZhang <47203811+PenghaiZhang@users.noreply.github.com> Date: Fri, 27 Mar 2020 17:47:10 +1100 Subject: [PATCH 5/7] Bugfix/fix samesite issue for cookies (#1585) Add SameSiteFilter to set 'SameSite=None' and 'Secure' for JSESSIONID cookie --- .../Core/com.equella.core/plugin-jpf.xml | 5 ++ .../tle/web/core/filter/SameSiteFilter.java | 53 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 Source/Plugins/Core/com.equella.core/src/com/tle/web/core/filter/SameSiteFilter.java diff --git a/Source/Plugins/Core/com.equella.core/plugin-jpf.xml b/Source/Plugins/Core/com.equella.core/plugin-jpf.xml index 9bc4798abe..0664ed4021 100644 --- a/Source/Plugins/Core/com.equella.core/plugin-jpf.xml +++ b/Source/Plugins/Core/com.equella.core/plugin-jpf.xml @@ -4784,6 +4784,11 @@ + + + + + diff --git a/Source/Plugins/Core/com.equella.core/src/com/tle/web/core/filter/SameSiteFilter.java b/Source/Plugins/Core/com.equella.core/src/com/tle/web/core/filter/SameSiteFilter.java new file mode 100644 index 0000000000..9aad622649 --- /dev/null +++ b/Source/Plugins/Core/com.equella.core/src/com/tle/web/core/filter/SameSiteFilter.java @@ -0,0 +1,53 @@ +/* + * Licensed to The Apereo Foundation under one or more contributor license + * agreements. See the NOTICE file distributed with this work for additional + * information regarding copyright ownership. + * + * The Apereo Foundation licenses this file to you under the Apache License, + * Version 2.0, (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.tle.web.core.filter; + +import com.tle.core.guice.Bind; +import com.tle.web.dispatcher.AbstractWebFilter; +import com.tle.web.dispatcher.FilterResult; +import java.io.IOException; +import java.util.Collection; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.core.HttpHeaders; + +@Bind +public class SameSiteFilter extends AbstractWebFilter { + + @Override + public FilterResult filterRequest(HttpServletRequest request, HttpServletResponse response) + throws IOException, ServletException { + if (request.isSecure()) { + Collection headers = response.getHeaders(HttpHeaders.SET_COOKIE); + boolean firstHeader = true; + for (String header : headers) { + if (firstHeader) { + response.setHeader( + HttpHeaders.SET_COOKIE, String.format("%s; %s", header, "SameSite=None")); + firstHeader = false; + continue; + } + response.addHeader( + HttpHeaders.SET_COOKIE, String.format("%s; %s", header, "SameSite=None")); + } + } + return FilterResult.FILTER_CONTINUE; + } +} From 47df1b97d4adf482133ec2122ba919fe786315d5 Mon Sep 17 00:00:00 2001 From: Penghai Date: Wed, 1 Apr 2020 13:45:35 +1100 Subject: [PATCH 6/7] Update version to 2019.1.5 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 5920c5d56b..b5a5e552dd 100644 --- a/build.sbt +++ b/build.sbt @@ -113,7 +113,7 @@ name := "Equella" equellaMajor in ThisBuild := 2019 equellaMinor in ThisBuild := 1 -equellaPatch in ThisBuild := 4 +equellaPatch in ThisBuild := 5 equellaStream in ThisBuild := "Stable" equellaBuild in ThisBuild := buildConfig.value.getString("build.buildname") From 9318889273d717f66758ec7a0abfcd86d3c705a1 Mon Sep 17 00:00:00 2001 From: Penghai Date: Thu, 2 Apr 2020 09:09:21 +1100 Subject: [PATCH 7/7] Update the expired date of the testing activate request --- .../cal/institution/items/90/63706-extra/activations.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autotest/Tests/tests/cal/institution/items/90/63706-extra/activations.xml b/autotest/Tests/tests/cal/institution/items/90/63706-extra/activations.xml index 8932d8ee7f..b770727369 100644 --- a/autotest/Tests/tests/cal/institution/items/90/63706-extra/activations.xml +++ b/autotest/Tests/tests/cal/institution/items/90/63706-extra/activations.xml @@ -8,9 +8,9 @@ 0 2009-04-16 15:49:02.687 - 2020-04-01 11:00:00.0 + 2100-12-31 11:00:00.0 Harvard , 'Part Two' in - \ No newline at end of file +