assertTextPresent( "Possible CSRF attack detected! Invalid token found in the request." );
}
- // TODO: TEMPORARILY DISABLED TO ADDRESS METHOD PARAMETER
- @Test(enabled = false)
public void testCSRFDisableProxyConnector()
{
getSelenium().open( baseUrl );
- getSelenium().open( baseUrl + "/admin/disableProxyConnector!disable.action?target=maven2-repository.dev.java.net&source=internal" );
+ getSelenium().open( baseUrl + "/admin/disableProxyConnector.action?target=maven2-repository.dev.java.net&source=internal" );
assertTextPresent( "Security Alert - Invalid Token Found" );
assertTextPresent( "Possible CSRF attack detected! Invalid token found in the request." );
}
- // TODO: TEMPORARILY DISABLED TO ADDRESS METHOD PARAMETER
- @Test(enabled = false)
public void testCSRFDeleteProxyConnector()
{
getSelenium().open( baseUrl );
- getSelenium().open( baseUrl + "/admin/deleteProxyConnector!delete.action?target=maven2-repository.dev.java.net&source=snapshots" );
+ getSelenium().open( baseUrl + "/admin/deleteProxyConnector.action?target=maven2-repository.dev.java.net&source=snapshots" );
assertTextPresent( "Security Alert - Invalid Token Found" );
assertTextPresent( "Possible CSRF attack detected! Invalid token found in the request." );
}
--- /dev/null
+package org.apache.archiva.web.test;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF 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.
+ */
+
+import org.apache.archiva.web.test.parent.AbstractRepositoryTest;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+@Test( groups = { "proxyConnector" } )
+public class ProxyConnectorTest
+ extends AbstractRepositoryTest
+{
+ @BeforeTest
+ public void setUp()
+ {
+ loginAsAdmin();
+ }
+
+ @AfterSuite
+ public void tearDown()
+ {
+ deleteProxyConnector( "snapshots", "central", false );
+ enableProxyConnector( "internal", "central", false );
+ }
+
+ public void add()
+ {
+ addProxyConnector( "snapshots", "central" );
+ }
+
+ @Test(dependsOnMethods = "add")
+ public void edit()
+ {
+ editProxyConnector( "snapshots", "central" );
+ }
+
+ @Test(dependsOnMethods = "edit")
+ public void delete()
+ {
+ deleteProxyConnector( "snapshots", "central", true );
+ }
+
+ public void disable()
+ {
+ disableProxyConnector( "internal", "central", true );
+ }
+
+ @Test(dependsOnMethods = "disable")
+ public void enable()
+ {
+ enableProxyConnector( "internal", "central", true );
+ }
+}
*/
import java.io.File;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
import org.testng.Assert;
public abstract class AbstractRepositoryTest
extends AbstractArchivaTest
{
- // Repository Groups
+
+ public static final String DEFAULT_NETWORK_PROXY = "(direct connection)";
+
+ // Repository Groups
public void goToRepositoryGroupsPage()
{
if( !getTitle().equals( "Apache Archiva \\ Administration - Repository Groups" ) )
///////////////////////////////
public void goToProxyConnectorsPage()
{
- clickLinkWithText( "Proxy Connectors" );
+ getSelenium().open( "/archiva/admin/proxyConnectors.action" );
assertProxyConnectorsPage();
}
public void assertAddProxyConnectorPage()
{
- assertPage( "Apache Archiva \\ Admin: Add Proxy Connector" );
- assertTextPresent( "Admin: Add Proxy Connector" );
+ assertAddProxyConnectorPageTitle();
+ assertTextPresent( "Admin: Add Proxy Connector" );
String proxy = "Network Proxy*:,Managed Repository*:,Remote Repository*:,Policies:,Return error when:,On remote error:,Releases:,Snapshots:,Checksum:,Cache failures:,Properties:,No properties have been set.,Black List:,No black list patterns have been set.,White List:,No white list patterns have been set.";
String[] arrayProxy = proxy.split( "," );
for ( String arrayproxy : arrayProxy )
assertButtonWithValuePresent( "Add Pattern" );
assertButtonWithValuePresent( "Add Proxy Connector" );
}
-
- // this only fills in the values of required fields in adding Proxy Connectors
- public void addProxyConnector( String networkProxy, String managedRepo, String remoteRepo )
+
+ private void assertAddProxyConnectorPageTitle()
+ {
+ assertPage( "Apache Archiva \\ Admin: Add Proxy Connector" );
+ }
+
+ public void addProxyConnector( String networkProxy, String managedRepo, String remoteRepo )
{
goToProxyConnectorsPage();
+ String xpath = getProxyConnectorXPath( managedRepo, remoteRepo );
+ assertElementNotPresent( "xpath=" + xpath );
+
clickLinkWithText( "Add" );
assertAddProxyConnectorPage();
- selectValue( "connector.proxyId" , networkProxy );
- selectValue( "connector.sourceRepoId" , managedRepo );
- selectValue( "connector.targetRepoId" , remoteRepo );
+ selectValue( "connector.proxyId", networkProxy );
+ selectValue( "connector.sourceRepoId", managedRepo );
+ selectValue( "connector.targetRepoId", remoteRepo );
+
+ selectValue( "policy_releases", "never" );
+
+ addProxyProperty( "a", "b" );
+ assertAddProxyConnectorPageTitle();
+ addProxyProperty( "x", "y" );
+
+ addPattern( "blackListPattern", "**/bad/**" );
+ assertAddProxyConnectorPageTitle();
+ addPattern( "whiteListPattern", "**/good/**" );
+ assertAddProxyConnectorPageTitle();
+
+ clickButtonWithValue( "Add Proxy Connector" );
+
+ assertProxyConnectorsPage();
+ assertElementPresent( xpath );
+
+ LinkedHashMap<String, String> properties = new LinkedHashMap<String, String>();
+ properties.put("a", "b");
+ properties.put("x", "y");
+ assertProxySettings( managedRepo, remoteRepo, "never", "**/bad/**", "**/good/**", properties );
+ }
+
+ public void editProxyConnector( String managedRepo, String remoteRepo )
+ {
+ goToProxyConnectorsPage();
+ String xpath = getProxyConnectorXPath( managedRepo, remoteRepo );
+
+ clickLinkWithXPath( xpath + "/..//a[@class='edit']" );
+
+ assertEditProxyConnectorPage();
+
+ selectValue( "policy_releases", "always" );
+
+ addProxyProperty( "c", "d" );
+ assertEditProxyConnectorPage();
+ editProxyProperty( "x", "z" );
+ assertEditProxyConnectorPage();
+ removeProxyProperty( "a" );
+ assertEditProxyConnectorPage();
+
+ removePattern( "blackListPattern", "**/bad/**" );
+ assertEditProxyConnectorPage();
+ removePattern( "whiteListPattern", "**/good/**" );
+ addPattern( "blackListPattern", "**/bad2/**" );
+ assertEditProxyConnectorPage();
+ addPattern( "whiteListPattern", "**/good2/**" );
+
+ clickButtonWithValue( "Save Proxy Connector" );
+
+ assertProxyConnectorsPage();
+ assertElementPresent( xpath );
+
+ LinkedHashMap<String, String> properties = new LinkedHashMap<String, String>();
+ properties.put("c", "d");
+ properties.put("x", "z");
+ assertProxySettings( managedRepo, remoteRepo, "always", "**/bad2/**", "**/good2/**", properties );
+ }
+
+ private void assertEditProxyConnectorPage()
+ {
+ assertPage( "Apache Archiva \\ Admin : Edit Proxy Connector" );
+ }
+
+ private void removeProxyProperty( String name )
+ {
+ clickLinkWithXPath( "//a[@title='Remove [" + name + "] Property']" );
+ }
+
+ private void editProxyProperty( String name, String value )
+ {
+ setFieldValue( "property_" + name, value );
+ }
+
+ private void addPattern( String pattern, String value )
+ {
+ setFieldValue( pattern, value );
+ clickLinkWithXPath( "//input[@name='" + pattern + "']/../input[@type='button']" );
+ }
+
+ private void removePattern( String pattern, String value )
+ {
+ setFieldValue( pattern, value );
+ clickLinkWithXPath( "//a[@title='Remove [" + value + "] Pattern']" );
+ }
+
+ private void addProxyProperty( String name, String value )
+ {
+ setFieldValue( "propertyKey", name );
+ setFieldValue( "propertyValue", value );
+ clickButtonWithValue( "Add Property" );
+ }
+
+ private void assertProxySettings( String managedRepoId, String remoteRepoId, String releasesPolicy,
+ String blackList, String whiteList, LinkedHashMap<String, String> properties )
+ {
+ String xpath = getProxyConnectorXPath( managedRepoId, remoteRepoId );
+ clickLinkWithXPath( xpath + "/ancestor::div[contains(@class,'connector')]//a[text()='Settings']", false );
+
+ String tableElement = "//table[@class='policies']";
+ int row = 2;
+ Assert.assertEquals( getCellValueFromTable( tableElement, row, 0 ), "releases" );
+ Assert.assertEquals( getCellValueFromTable( tableElement, row, 1 ), releasesPolicy );
+
+ Assert.assertEquals( getSelenium().getText( "//th[contains(text(), 'Black List')]/ancestor::tr/td/p" ),
+ "\"" + blackList + "\"" );
+ Assert.assertEquals( getSelenium().getText( "//th[contains(text(), 'White List')]/ancestor::tr/td/p" ),
+ "\"" + whiteList + "\"" );
+
+ tableElement = "//table[@class='props']";
+ row = 0;
+ for ( Map.Entry property : properties.entrySet() )
+ {
+ Assert.assertEquals( getCellValueFromTable( tableElement, row, 0 ), property.getKey() );
+ Assert.assertEquals( getCellValueFromTable( tableElement, row, 1 ), property.getValue() );
+ row = row + 1;
+ }
+ }
+
+ public void addProxyConnector( String managedRepo, String remoteRepo )
+ {
+ addProxyConnector( DEFAULT_NETWORK_PROXY, managedRepo, remoteRepo );
}
- public void deleteProxyConnector()
+ public void deleteProxyConnector( String managedRepoId, String remoteRepoId, boolean failIfMissing )
{
goToProxyConnectorsPage();
- clickLinkWithXPath( "//div[@id='contentArea']/div[2]/div[1]/div[2]/div[1]/a[3]/img" );
- assertPage( "Apache Archiva \\ Admin: Delete Proxy Connectors" );
- clickButtonWithValue( "Delete" );
- assertPage( "Apache Archiva \\ Administration - Proxy Connectors" );
+
+ String xpathBase = getProxyConnectorXPath( managedRepoId, remoteRepoId );
+ String xpath = xpathBase + "/..//a[@class='delete']";
+ if ( failIfMissing || isElementPresent( "xpath=" + xpath ))
+ {
+ clickLinkWithXPath( xpath );
+ assertPage( "Apache Archiva \\ Admin: Delete Proxy Connector" );
+ clickButtonWithValue( "Delete" );
+ assertPage( "Apache Archiva \\ Administration - Proxy Connectors" );
+
+ assertElementNotPresent( xpathBase );
+ }
}
-
- ///////////////////////////////
+
+ public void disableProxyConnector( String managedRepoId, String remoteRepoId, boolean failIfMissing )
+ {
+ toggleProxyConnector( managedRepoId, remoteRepoId, failIfMissing, "Disable" );
+ }
+
+ public void enableProxyConnector( String managedRepoId, String remoteRepoId, boolean failIfMissing )
+ {
+ toggleProxyConnector( managedRepoId, remoteRepoId, failIfMissing, "Enable" );
+ }
+
+ private void toggleProxyConnector( String managedRepoId, String remoteRepoId, boolean failIfMissing,
+ String operation )
+ {
+ goToProxyConnectorsPage();
+
+ String xpathBase = getProxyConnectorXPath( managedRepoId, remoteRepoId );
+ String xpath = xpathBase + "/..//a[@title='" + operation + " Proxy Connector']";
+ if ( failIfMissing || isElementPresent( "xpath=" + xpath ) )
+ {
+ clickLinkWithXPath( xpath );
+ assertPage( "Apache Archiva \\ Admin: " + operation + " Proxy Connector" );
+ clickButtonWithValue( operation );
+ assertPage( "Apache Archiva \\ Administration - Proxy Connectors" );
+ }
+ }
+
+ private String getProxyConnectorXPath( String managedRepoId, String remoteRepoId )
+ {
+ String managedRepoXpath = "//div[@class='managedRepo' and ./p[text()='" + managedRepoId + "']]";
+ String remoteRepoXpath = "//div[@class='remoteRepo' and ./p[text()='" + remoteRepoId + "']]";
+ return "//div[@id='contentArea']" + managedRepoXpath + "/.." + remoteRepoXpath;
+ }
+
+ ///////////////////////////////
// network proxies
///////////////////////////////
*/
private String target;
- @Override
- public void prepare()
- {
- super.prepare();
-
- connector = findProxyConnector( source, target );
- }
-
public String input()
{
+ connector = findProxyConnector( source, target );
if ( connector == null )
{
addActionError( "Unable to edit non existant proxy connector with source [" + source + "] and target ["
+ target + "]" );
return ERROR;
}
-
- if( connector != null )
- {
- // MRM-1135
- connector.setBlackListPatterns( escapePatterns( connector.getBlackListPatterns() ) );
- connector.setWhiteListPatterns( escapePatterns( connector.getWhiteListPatterns() ) );
- }
+
+ // MRM-1135
+ connector.setBlackListPatterns( escapePatterns( connector.getBlackListPatterns() ) );
+ connector.setWhiteListPatterns( escapePatterns( connector.getWhiteListPatterns() ) );
return INPUT;
}
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
</interceptor-stack>
-
- <interceptor-stack name="configuredPrepareParamsStack">
- <!-- <interceptor-ref name="prepare" /> -->
- <interceptor-ref name="params"/>
- <interceptor-ref name="configuredArchivaStack"/>
- </interceptor-stack>
</interceptors>
<!-- Default interceptor stack. -->
<result name="input">/WEB-INF/jsp/upload.jsp</result>
<result name="error">/WEB-INF/jsp/upload.jsp</result>
<result name="success">/WEB-INF/jsp/upload.jsp</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
<interceptor-ref name="fileUpload"/>
</action>
<result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
<result name="error">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
<result name="success" type="redirectAction">repositoryGroups</result>
- <interceptor-ref name="configuredPrepareParamsStack">
+ <interceptor-ref name="configuredArchivaStack">
<param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
<action name="confirmDeleteRepositoryGroup" class="deleteRepositoryGroupAction" method="confirmDelete">
<result name="input">/WEB-INF/jsp/admin/deleteRepositoryGroup.jsp</result>
- <interceptor-ref name="configuredPrepareParamsStack">
+ <interceptor-ref name="configuredArchivaStack">
<param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
<result name="input">/WEB-INF/jsp/admin/deleteRepositoryGroup.jsp</result>
<result name="error">/WEB-INF/jsp/admin/deleteRepositoryGroup.jsp</result>
<result name="success" type="redirectAction">repositoryGroups</result>
- <interceptor-ref name="configuredPrepareParamsStack">
+ <interceptor-ref name="configuredArchivaStack">
<param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
<result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
<result name="error">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
<result name="success" type="redirectAction">repositoryGroups</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="removeRepositoryFromGroup" class="repositoryGroupsAction" method="removeRepositoryFromGroup">
<result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
<result name="error">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
<result name="success" type="redirectAction">repositoryGroups</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="sortDownRepositoryFromGroup" class="sortRepositoriesAction" method="sortDown">
<result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
<result name="error">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
<result name="success" type="redirectAction">repositoryGroups</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="sortUpRepositoryFromGroup" class="sortRepositoriesAction" method="sortUp">
<result name="input">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
<result name="error">/WEB-INF/jsp/admin/repositoryGroups.jsp</result>
<result name="success" type="redirectAction">repositoryGroups</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<!-- .\ REPOSITORIES \.____________________________________________ -->
<result name="error">/WEB-INF/jsp/admin/addRepository.jsp</result>
<result name="confirm">/WEB-INF/jsp/admin/confirmAddRepository.jsp</result>
<result name="success" type="redirectAction">repositories</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="editRepository" class="editManagedRepositoryAction" method="input">
<result name="input">/WEB-INF/jsp/admin/editRepository.jsp</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="editRepository_commit" class="editManagedRepositoryAction" method="commit">
<result name="error">/WEB-INF/jsp/admin/editRepository.jsp</result>
<result name="success" type="redirectAction">repositories</result>
<result name="confirm">/WEB-INF/jsp/admin/confirmAddRepository.jsp</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="confirmDeleteRepository" class="deleteManagedRepositoryAction" method="confirmDelete">
<result name="input">/WEB-INF/jsp/admin/deleteRepository.jsp</result>
- <interceptor-ref name="configuredPrepareParamsStack">
+ <interceptor-ref name="configuredArchivaStack">
<param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
<result name="input">/WEB-INF/jsp/admin/deleteRepository.jsp</result>
<result name="error">/WEB-INF/jsp/admin/deleteRepository.jsp</result>
<result name="success" type="redirectAction">repositories</result>
- <interceptor-ref name="configuredPrepareParamsStack">
+ <interceptor-ref name="configuredArchivaStack">
<param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
<action name="addRemoteRepository" class="addRemoteRepositoryAction" method="input">
<result name="input">/WEB-INF/jsp/admin/addRemoteRepository.jsp</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="addRemoteRepository_commit" class="addRemoteRepositoryAction" method="commit">
<result name="input">/WEB-INF/jsp/admin/addRemoteRepository.jsp</result>
<result name="error">/WEB-INF/jsp/admin/addRemoteRepository.jsp</result>
<result name="success" type="redirectAction">repositories</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="editRemoteRepository" class="editRemoteRepositoryAction" method="input">
<result name="input">/WEB-INF/jsp/admin/editRemoteRepository.jsp</result>
<result name="error">/WEB-INF/jsp/admin/editRemoteRepository.jsp</result>
<result name="success" type="redirectAction">repositories</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="confirmDeleteRemoteRepository" class="deleteRemoteRepositoryAction" method="confirmDelete">
<result name="input">/WEB-INF/jsp/admin/deleteRemoteRepository.jsp</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="deleteRemoteRepository" class="deleteRemoteRepositoryAction" method="delete">
<result name="input">/WEB-INF/jsp/admin/deleteRemoteRepository.jsp</result>
<result name="error">/WEB-INF/jsp/admin/deleteRemoteRepository.jsp</result>
<result name="success" type="redirectAction">repositories</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<!-- .\ PROXY CONNECTORS \.________________________________________ -->
<action name="addProxyConnector" class="addProxyConnectorAction" method="input">
<result name="input">/WEB-INF/jsp/admin/addProxyConnector.jsp</result>
+ </action>
+
+ <action name="addProxyConnector_*" class="addProxyConnectorAction" method="{1}">
+ <result name="input">/WEB-INF/jsp/admin/addProxyConnector.jsp</result>
<result name="success" type="redirectAction">proxyConnectors</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
+ <interceptor-ref name="configuredArchivaStack">
+ <param name="params.acceptParamNames">\w+((\.\w+)|(\[\d+\])|(\(\d+\))|(\['[-\w]+'\])|(\('\w+'\)))*</param>
+ </interceptor-ref>
</action>
<action name="editProxyConnector" class="editProxyConnectorAction" method="input">
<result name="input">/WEB-INF/jsp/admin/editProxyConnector.jsp</result>
<result name="success" type="redirectAction">proxyConnectors</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
+ <interceptor-ref name="configuredArchivaStack">
+ <param name="params.acceptParamNames">\w+((\.\w+)|(\[\d+\])|(\(\d+\))|(\['[-\w]+'\])|(\('\w+'\)))*</param>
+ </interceptor-ref>
+ </action>
+
+ <action name="editProxyConnector_*" class="editProxyConnectorAction" method="{1}">
+ <result name="input">/WEB-INF/jsp/admin/editProxyConnector.jsp</result>
+ <result name="success" type="redirectAction">proxyConnectors</result>
+ <interceptor-ref name="configuredArchivaStack">
+ <param name="params.acceptParamNames">\w+((\.\w+)|(\[\d+\])|(\(\d+\))|(\['[-\w]+'\])|(\('\w+'\)))*</param>
+ </interceptor-ref>
</action>
<action name="sortUpProxyConnector" class="sortProxyConnectorsAction" method="sortUp">
<result name="input">/WEB-INF/jsp/admin/editProxyConnector.jsp</result>
<result name="success" type="redirectAction">proxyConnectors</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="sortDownProxyConnector" class="sortProxyConnectorsAction" method="sortDown">
<result name="input">/WEB-INF/jsp/admin/editProxyConnector.jsp</result>
<result name="success" type="redirectAction">proxyConnectors</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
- <action name="deleteProxyConnector" class="deleteProxyConnectorAction" method="confirm">
+ <action name="deleteProxyConnector_confirm" class="deleteProxyConnectorAction" method="confirmDelete">
<result name="input">/WEB-INF/jsp/admin/deleteProxyConnector.jsp</result>
- <result name="success" type="redirectAction">proxyConnectors</result>
- <interceptor-ref name="configuredPrepareParamsStack">
+ <interceptor-ref name="configuredArchivaStack">
<param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
- <action name="enableProxyConnector" class="enableProxyConnectorAction" method="confirm">
+ <action name="deleteProxyConnector" class="deleteProxyConnectorAction" method="delete">
+ <result name="input">/WEB-INF/jsp/admin/deleteProxyConnector.jsp</result>
+ <result name="success" type="redirectAction">proxyConnectors</result>
+ <interceptor-ref name="configuredArchivaStack">
+ <param name="tokenSession.includeMethods">*</param>
+ </interceptor-ref>
+ </action>
+
+ <action name="enableProxyConnector_confirm" class="enableProxyConnectorAction" method="confirmEnable">
+ <result name="input">/WEB-INF/jsp/admin/enableProxyConnector.jsp</result>
+ </action>
+
+ <action name="enableProxyConnector" class="enableProxyConnectorAction" method="enable">
<result name="input">/WEB-INF/jsp/admin/enableProxyConnector.jsp</result>
<result name="success" type="redirectAction">proxyConnectors</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
- <action name="disableProxyConnector" class="disableProxyConnectorAction" method="confirm">
+ <action name="disableProxyConnector_confirm" class="disableProxyConnectorAction" method="confirmDisable">
<result name="input">/WEB-INF/jsp/admin/disableProxyConnector.jsp</result>
- <result name="success" type="redirectAction">proxyConnectors</result>
- <interceptor-ref name="configuredPrepareParamsStack">
- <param name="tokenSession.includeMethods">*</param>
+ <interceptor-ref name="configuredArchivaStack">
+ <param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
+ <action name="disableProxyConnector" class="disableProxyConnectorAction" method="disable">
+ <result name="input">/WEB-INF/jsp/admin/disableProxyConnector.jsp</result>
+ <result name="success" type="redirectAction">proxyConnectors</result>
+ <interceptor-ref name="configuredArchivaStack">
+ <param name="tokenSession.includeMethods">*</param>
+ </interceptor-ref>
+ </action>
<!-- .\ NETWORK PROXIES \._________________________________________ -->
<action name="addNetworkProxy" class="configureNetworkProxyAction" method="add">
<result name="input">/WEB-INF/jsp/admin/editNetworkProxy.jsp</result>
<result name="success" type="redirectAction">networkProxies</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="editNetworkProxy" class="configureNetworkProxyAction" method="edit">
<result name="input">/WEB-INF/jsp/admin/editNetworkProxy.jsp</result>
<result name="success" type="redirectAction">networkProxies</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="saveNetworkProxy" class="configureNetworkProxyAction" method="save">
<result name="input">/WEB-INF/jsp/admin/editNetworkProxy.jsp</result>
<result name="success" type="redirectAction">networkProxies</result>
- <interceptor-ref name="configuredPrepareParamsStack">
+ <interceptor-ref name="configuredArchivaStack">
<param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
<action name="deleteNetworkProxy" class="configureNetworkProxyAction" method="confirm">
<result name="input">/WEB-INF/jsp/admin/deleteNetworkProxy.jsp</result>
- <interceptor-ref name="configuredPrepareParamsStack">
+ <interceptor-ref name="configuredArchivaStack">
<param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
<action name="deleteNetworkProxy_submit" class="configureNetworkProxyAction" method="delete">
<result name="input">/WEB-INF/jsp/admin/deleteNetworkProxy.jsp</result>
<result name="success" type="redirectAction">networkProxies</result>
- <interceptor-ref name="configuredPrepareParamsStack">
+ <interceptor-ref name="configuredArchivaStack">
<param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
<result name="input">/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp</result>
<result name="error">/WEB-INF/jsp/admin/addLegacyArtifactPath.jsp</result>
<result name="success" type="redirectAction">legacyArtifactPath</result>
- <interceptor-ref name="configuredPrepareParamsStack"/>
</action>
<action name="deleteLegacyArtifactPath" class="deleteLegacyArtifactPathAction" method="delete">
<result name="input">/WEB-INF/jsp/admin/legacyArtifactPath.jsp</result>
<result name="error">/WEB-INF/jsp/admin/legacyArtifactPath.jsp</result>
<result name="success" type="redirectAction">legacyArtifactPath</result>
- <interceptor-ref name="configuredPrepareParamsStack">
+ <interceptor-ref name="configuredArchivaStack">
<param name="tokenSession.includeMethods">*</param>
</interceptor-ref>
</action>
<s:actionerror/>
<s:actionmessage/>
- <s:form name="saveProxyConnector" method="post" action="addProxyConnector!commit" namespace="/admin" validate="true">
+ <s:form name="saveProxyConnector" method="post" action="addProxyConnector_commit" namespace="/admin" validate="true">
<%@ include file="/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf" %>
<s:submit value="Add Proxy Connector"/>
</s:form>
Are you sure you want to delete proxy connector <code>[ ${source} , ${target} ]</code> ?
</p>
- <s:form method="post" action="deleteProxyConnector!delete" namespace="/admin" validate="true">
+ <s:form method="post" action="deleteProxyConnector" namespace="/admin" validate="true">
<s:hidden name="target"/>
<s:hidden name="source"/>
<s:token/>
Are you sure you want to disable proxy connector <code>[ ${source} , ${target} ]</code> ?
</p>
- <s:form method="post" action="disableProxyConnector!disable" namespace="/admin" validate="true">
+ <s:form method="post" action="disableProxyConnector" namespace="/admin" validate="true">
<s:hidden name="target"/>
<s:hidden name="source"/>
<s:token/>
<s:actionerror/>
<s:actionmessage/>
- <s:form name="saveProxyConnector" method="post" action="editProxyConnector!commit" namespace="/admin" validate="true">
+ <s:form name="saveProxyConnector" method="post" action="editProxyConnector_commit" namespace="/admin" validate="true">
<%@ include file="/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf" %>
<s:submit value="Save Proxy Connector"/>
</s:form>
Are you sure you want to enable proxy connector <code>[ ${source} , ${target} ]</code> ?
</p>
- <s:form method="post" action="enableProxyConnector!enable" namespace="/admin" validate="true">
+ <s:form method="post" action="enableProxyConnector" namespace="/admin" validate="true">
<s:hidden name="target"/>
<s:hidden name="source"/>
<s:submit value="Enable"/>
</td>
<td>
<c:set var="value">
- <s:property id="value" value="%{#attr.connector.policies[#attr.policy.key]}" default="%{#attr.policy.value.defaultOption}" />
+ <s:property value="%{#attr.connector.policies[#attr.policy.key]}" default="%{#attr.policy.value.defaultOption}" />
</c:set>
<s:select name="connector.policies['%{#attr.policy.key}']"
list="%{#attr.policyMap[#attr.policy.key].options}"
<!--
function adjustActionMethod( action, method )
{
- var idx = action.indexOf( "!" );
- if( idx == (-1) )
- {
- // no "name!method.action" defined, split by ".action" instead.
- idx = action.indexOf( ".action" );
- }
-
- return action.substring( 0, idx ) + "!" + method + ".action";
+ return action.replace(/_commit\.action$/, "_" + method + ".action");
}
function setAndSubmit( id, value, method )
<s:param name="target" value="%{#attr.connector.targetRepoId}"/>
<s:param name="source" value="%{#attr.connector.sourceRepoId}"/>
</s:url>
- <s:url id="deleteProxyConnectorUrl" action="deleteProxyConnector" method="confirmDelete">
+ <s:url id="deleteProxyConnectorUrl" action="deleteProxyConnector_confirm">
<s:param name="source" value="%{#attr.connector.sourceRepoId}"/>
<s:param name="target" value="%{#attr.connector.targetRepoId}"/>
<s:param name="struts.token.name">token</s:param>
<s:param name="token"><s:property value="token"/></s:param>
</s:url>
- <s:url id="enableProxyConnectorUrl" action="enableProxyConnector" method="confirmEnable">
+ <s:url id="enableProxyConnectorUrl" action="enableProxyConnector_confirm">
<s:param name="source" value="%{#attr.connector.sourceRepoId}"/>
<s:param name="target" value="%{#attr.connector.targetRepoId}"/>
</s:url>
- <s:url id="disableProxyConnectorUrl" action="disableProxyConnector" method="confirmDisable">
+ <s:url id="disableProxyConnectorUrl" action="disableProxyConnector_confirm">
<s:param name="source" value="%{#attr.connector.sourceRepoId}"/>
<s:param name="target" value="%{#attr.connector.targetRepoId}"/>
<s:param name="struts.token.name">token</s:param>