--- /dev/null
+package org.apache.archiva.web.xmlrpc.api;
+
+/*
+ * 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 java.util.List;
+
+import com.atlassian.xmlrpc.ServiceObject;
+
+@ServiceObject( "Administration" )
+public interface AdministrationService
+{
+ public boolean executeRepositoryScanner( String repoId );
+
+ public boolean executeDatabaseScanner();
+
+ public List<String> getAllDatabaseConsumers();
+
+ public boolean configureDatabaseConsumer( String consumerId, boolean enable );
+
+ // TODO should we already implement config of consumers per repository?
+ public boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable );
+
+ public List<String> getAllRepositoryConsumers( String repoId );
+
+ public List<ManagedRepository> getAllManagedRepositories();
+
+ public List<RemoteRepository> getAllRemoteRepositories();
+
+ public boolean deleteArtifact( String repoId, String groupId, String artifactId, String version );
+}
--- /dev/null
+package org.apache.archiva.web.xmlrpc.api;
+
+/*
+ * 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 com.atlassian.xmlrpc.ServiceObject;
+
+@ServiceObject("Search")
+public interface SearchService
+{
+
+}
--- /dev/null
+package org.apache.archiva.web.xmlrpc.api;
+
+/*
+ * 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 com.atlassian.xmlrpc.ServiceObject;
+
+@ServiceObject("Test")
+public interface TestService
+{
+ public String ping();
+}
+++ /dev/null
-package org.apache.maven.archiva.web.xmlrpc.api;
-
-/*
- * 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 java.util.List;
-
-import com.atlassian.xmlrpc.ServiceObject;
-
-@ServiceObject( "Administration" )
-public interface AdministrationService
-{
- public boolean executeRepositoryScanner( String repoId );
-
- public boolean executeDatabaseScanner();
-
- public List<String> getAllDatabaseConsumers();
-
- public boolean configureDatabaseConsumer( String consumerId, boolean enable );
-
- // TODO should we already implement config of consumers per repository?
- public boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable );
-
- public List<String> getAllRepositoryConsumers( String repoId );
-
- public List<ManagedRepository> getAllManagedRepositories();
-
- public List<RemoteRepository> getAllRemoteRepositories();
-
- public boolean deleteArtifact( String repoId, String groupId, String artifactId, String version );
-}
+++ /dev/null
-package org.apache.maven.archiva.web.xmlrpc.api;
-
-/*
- * 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 com.atlassian.xmlrpc.ServiceObject;
-
-@ServiceObject("Search")
-public interface SearchService
-{
-
-}
+++ /dev/null
-package org.apache.maven.archiva.web.xmlrpc.api;
-
-/*
- * 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 com.atlassian.xmlrpc.ServiceObject;
-
-@ServiceObject("Test")
-public interface TestService
-{
- public String ping();
-}
<defaults>
<default>
<key>package</key>
- <value>org.apache.maven.archiva.web.xmlrpc.api</value>
+ <value>org.apache.archiva.web.xmlrpc.api</value>
</default>
</defaults>
<classes>
--- /dev/null
+package org.apache.archiva.web.xmlrpc.security;\r
+\r
+/*\r
+ * Licensed to the Apache Software Foundation (ASF) under one\r
+ * or more contributor license agreements. See the NOTICE file\r
+ * distributed with this work for additional information\r
+ * regarding copyright ownership. The ASF licenses this file\r
+ * to you under the Apache License, Version 2.0 (the\r
+ * "License"); you may not use this file except in compliance\r
+ * with the License. You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing,\r
+ * software distributed under the License is distributed on an\r
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
+ * KIND, either express or implied. See the License for the\r
+ * specific language governing permissions and limitations\r
+ * under the License.\r
+ */\r
+\r
+import org.apache.maven.archiva.security.ArchivaRoleConstants;\r
+import org.apache.xmlrpc.XmlRpcException;\r
+import org.apache.xmlrpc.XmlRpcRequest;\r
+import org.apache.xmlrpc.common.XmlRpcHttpRequestConfigImpl;\r
+import org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.AuthenticationHandler;\r
+import org.codehaus.plexus.redback.authentication.AuthenticationException;\r
+import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;\r
+import org.codehaus.plexus.redback.authorization.AuthorizationException;\r
+import org.codehaus.plexus.redback.authorization.AuthorizationResult;\r
+import org.codehaus.plexus.redback.policy.AccountLockedException;\r
+import org.codehaus.plexus.redback.system.SecuritySession;\r
+import org.codehaus.plexus.redback.system.SecuritySystem;\r
+import org.codehaus.plexus.redback.users.UserNotFoundException;\r
+\r
+public class XmlRpcAuthenticator\r
+ implements AuthenticationHandler\r
+{\r
+ private final SecuritySystem securitySystem;\r
+\r
+ public XmlRpcAuthenticator( SecuritySystem securitySystem )\r
+ {\r
+ this.securitySystem = securitySystem;\r
+ }\r
+\r
+ public boolean isAuthorized( XmlRpcRequest pRequest )\r
+ throws XmlRpcException\r
+ {\r
+ if ( pRequest.getConfig() instanceof XmlRpcHttpRequestConfigImpl )\r
+ {\r
+ XmlRpcHttpRequestConfigImpl config = (XmlRpcHttpRequestConfigImpl) pRequest.getConfig();\r
+ SecuritySession session =\r
+ authenticate( new PasswordBasedAuthenticationDataSource( config.getBasicUserName(),\r
+ config.getBasicPassword() ) );\r
+ AuthorizationResult result = authorize( session );\r
+ return result.isAuthorized();\r
+ }\r
+\r
+ throw new XmlRpcException( "Unsupported transport (must be http)" );\r
+ }\r
+\r
+ private SecuritySession authenticate( PasswordBasedAuthenticationDataSource authenticationDataSource )\r
+ throws XmlRpcException\r
+ {\r
+ try\r
+ {\r
+ return securitySystem.authenticate( authenticationDataSource );\r
+ }\r
+ catch ( AccountLockedException e )\r
+ {\r
+ throw new XmlRpcException( 401, e.getMessage(), e );\r
+ }\r
+ catch ( AuthenticationException e )\r
+ {\r
+ throw new XmlRpcException( 401, e.getMessage(), e );\r
+ }\r
+ catch ( UserNotFoundException e )\r
+ {\r
+ throw new XmlRpcException( 401, e.getMessage(), e );\r
+ }\r
+ }\r
+\r
+ private AuthorizationResult authorize( SecuritySession session )\r
+ throws XmlRpcException\r
+ {\r
+ try\r
+ {\r
+ //TODO authorization/permissions should be checked depending on the service being accessed\r
+ \r
+ return securitySystem.authorize( session, ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE );\r
+ }\r
+ catch ( AuthorizationException e )\r
+ {\r
+ throw new XmlRpcException( 401, e.getMessage(), e );\r
+ }\r
+ }\r
+}\r
+++ /dev/null
-package org.apache.maven.archiva.xmlrpc.security;\r
-\r
-/*\r
- * Licensed to the Apache Software Foundation (ASF) under one\r
- * or more contributor license agreements. See the NOTICE file\r
- * distributed with this work for additional information\r
- * regarding copyright ownership. The ASF licenses this file\r
- * to you under the Apache License, Version 2.0 (the\r
- * "License"); you may not use this file except in compliance\r
- * with the License. You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing,\r
- * software distributed under the License is distributed on an\r
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
- * KIND, either express or implied. See the License for the\r
- * specific language governing permissions and limitations\r
- * under the License.\r
- */\r
-\r
-import org.apache.maven.archiva.security.ArchivaRoleConstants;\r
-import org.apache.xmlrpc.XmlRpcException;\r
-import org.apache.xmlrpc.XmlRpcRequest;\r
-import org.apache.xmlrpc.common.XmlRpcHttpRequestConfigImpl;\r
-import org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.AuthenticationHandler;\r
-import org.codehaus.plexus.redback.authentication.AuthenticationException;\r
-import org.codehaus.plexus.redback.authentication.PasswordBasedAuthenticationDataSource;\r
-import org.codehaus.plexus.redback.authorization.AuthorizationException;\r
-import org.codehaus.plexus.redback.authorization.AuthorizationResult;\r
-import org.codehaus.plexus.redback.policy.AccountLockedException;\r
-import org.codehaus.plexus.redback.system.SecuritySession;\r
-import org.codehaus.plexus.redback.system.SecuritySystem;\r
-import org.codehaus.plexus.redback.users.UserNotFoundException;\r
-\r
-public class XmlRpcAuthenticator\r
- implements AuthenticationHandler\r
-{\r
- private final SecuritySystem securitySystem;\r
-\r
- public XmlRpcAuthenticator( SecuritySystem securitySystem )\r
- {\r
- this.securitySystem = securitySystem;\r
- }\r
-\r
- public boolean isAuthorized( XmlRpcRequest pRequest )\r
- throws XmlRpcException\r
- {\r
- if ( pRequest.getConfig() instanceof XmlRpcHttpRequestConfigImpl )\r
- {\r
- XmlRpcHttpRequestConfigImpl config = (XmlRpcHttpRequestConfigImpl) pRequest.getConfig();\r
- SecuritySession session =\r
- authenticate( new PasswordBasedAuthenticationDataSource( config.getBasicUserName(),\r
- config.getBasicPassword() ) );\r
- AuthorizationResult result = authorize( session );\r
- return result.isAuthorized();\r
- }\r
-\r
- throw new XmlRpcException( "Unsupported transport (must be http)" );\r
- }\r
-\r
- private SecuritySession authenticate( PasswordBasedAuthenticationDataSource authenticationDataSource )\r
- throws XmlRpcException\r
- {\r
- try\r
- {\r
- return securitySystem.authenticate( authenticationDataSource );\r
- }\r
- catch ( AccountLockedException e )\r
- {\r
- throw new XmlRpcException( 401, e.getMessage(), e );\r
- }\r
- catch ( AuthenticationException e )\r
- {\r
- throw new XmlRpcException( 401, e.getMessage(), e );\r
- }\r
- catch ( UserNotFoundException e )\r
- {\r
- throw new XmlRpcException( 401, e.getMessage(), e );\r
- }\r
- }\r
-\r
- private AuthorizationResult authorize( SecuritySession session )\r
- throws XmlRpcException\r
- {\r
- try\r
- {\r
- //TODO authorization/permissions should be checked depending on the service being accessed\r
- \r
- return securitySystem.authorize( session, ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE );\r
- }\r
- catch ( AuthorizationException e )\r
- {\r
- throw new XmlRpcException( 401, e.getMessage(), e );\r
- }\r
- }\r
-}\r
--- /dev/null
+package org.apache.archiva.xmlrpc.security;\r
+\r
+/*\r
+ * Licensed to the Apache Software Foundation (ASF) under one\r
+ * or more contributor license agreements. See the NOTICE file\r
+ * distributed with this work for additional information\r
+ * regarding copyright ownership. The ASF licenses this file\r
+ * to you under the Apache License, Version 2.0 (the\r
+ * "License"); you may not use this file except in compliance\r
+ * with the License. You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing,\r
+ * software distributed under the License is distributed on an\r
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
+ * KIND, either express or implied. See the License for the\r
+ * specific language governing permissions and limitations\r
+ * under the License.\r
+ */\r
+\r
+import org.apache.archiva.web.xmlrpc.security.XmlRpcAuthenticator;\r
+import org.apache.maven.archiva.security.ArchivaRoleConstants;\r
+import org.apache.xmlrpc.XmlRpcRequest;\r
+import org.apache.xmlrpc.common.XmlRpcHttpRequestConfigImpl;\r
+import org.codehaus.plexus.redback.role.RoleManager;\r
+import org.codehaus.plexus.redback.system.SecuritySystem;\r
+import org.codehaus.plexus.redback.users.User;\r
+import org.codehaus.plexus.redback.users.UserManager;\r
+import org.codehaus.plexus.redback.users.UserNotFoundException;\r
+import org.codehaus.plexus.spring.PlexusInSpringTestCase;\r
+import org.easymock.MockControl;\r
+import org.easymock.classextension.MockClassControl;\r
+\r
+/**\r
+ * XmlRpcAuthenticatorTest\r
+ * \r
+ * @version $Id XmlRpcAuthenticatorTest.java\r
+ */\r
+public class XmlRpcAuthenticatorTest\r
+//extends AbstractDependencyInjectionSpringContextTests\r
+ extends PlexusInSpringTestCase\r
+{\r
+ protected static final String USER_GUEST = "guest";\r
+\r
+ protected static final String USER_ADMIN = "admin";\r
+\r
+ protected static final String USER_ALPACA = "alpaca";\r
+\r
+ private static final String PASSWORD = "password123";\r
+\r
+ protected SecuritySystem securitySystem;\r
+\r
+ protected RoleManager roleManager;\r
+ \r
+ private MockControl xmlRpcRequestControl;\r
+ \r
+ private XmlRpcRequest xmlRpcRequest;\r
+ \r
+ private XmlRpcAuthenticator authenticator;\r
+ \r
+ private MockControl configControl;\r
+ \r
+ private XmlRpcHttpRequestConfigImpl config; \r
+ \r
+ public void setUp()\r
+ throws Exception\r
+ {\r
+ super.setUp();\r
+ \r
+ securitySystem = (SecuritySystem) lookup( SecuritySystem.class, "testable" ); \r
+ roleManager = (RoleManager) lookup( RoleManager.class, "default" );\r
+ \r
+ // Some basic asserts.\r
+ assertNotNull( securitySystem ); \r
+ assertNotNull( roleManager );\r
+ \r
+ // Setup Admin User.\r
+ User adminUser = createUser( USER_ADMIN, "Admin User", null );\r
+ roleManager.assignRole( ArchivaRoleConstants.TEMPLATE_SYSTEM_ADMIN, adminUser.getPrincipal().toString() );\r
+\r
+ // Setup Guest User.\r
+ User guestUser = createUser( USER_GUEST, "Guest User", null );\r
+ roleManager.assignRole( ArchivaRoleConstants.TEMPLATE_GUEST, guestUser.getPrincipal().toString() );\r
+ \r
+ configControl = MockClassControl.createControl( XmlRpcHttpRequestConfigImpl.class );\r
+ config = ( XmlRpcHttpRequestConfigImpl ) configControl.getMock();\r
+ \r
+ xmlRpcRequestControl = MockControl.createControl( XmlRpcRequest.class );\r
+ xmlRpcRequest = ( XmlRpcRequest ) xmlRpcRequestControl.getMock(); \r
+ \r
+ authenticator = new XmlRpcAuthenticator( securitySystem ); \r
+ }\r
+ \r
+ private User createUser( String principal, String fullname, String password )\r
+ throws UserNotFoundException\r
+ {\r
+ UserManager userManager = securitySystem.getUserManager();\r
+ \r
+ User user = userManager.createUser( principal, fullname, principal + "@testable.archiva.apache.org" );\r
+ securitySystem.getPolicy().setEnabled( false );\r
+ userManager.addUser( user );\r
+ securitySystem.getPolicy().setEnabled( true );\r
+ \r
+ user.setPassword( password ); \r
+ userManager.updateUser( user );\r
+ \r
+ return user;\r
+ }\r
+ \r
+ public void testIsAuthorizedUserExistsButNotAuthorized()\r
+ throws Exception\r
+ {\r
+ createUser( USER_ALPACA, "Al 'Archiva' Paca", PASSWORD );\r
+ \r
+ UserManager userManager = securitySystem.getUserManager();\r
+ try\r
+ {\r
+ User user = userManager.findUser( USER_ALPACA );\r
+ assertEquals( USER_ALPACA, user.getPrincipal() );\r
+ }\r
+ catch ( UserNotFoundException e )\r
+ {\r
+ fail( "User should exist in the database." ); \r
+ }\r
+ \r
+ xmlRpcRequestControl.expectAndReturn( xmlRpcRequest.getConfig(), config, 2 );\r
+ \r
+ configControl.expectAndReturn( config.getBasicUserName(), USER_ALPACA );\r
+ \r
+ configControl.expectAndReturn( config.getBasicPassword(), PASSWORD );\r
+ \r
+ xmlRpcRequestControl.replay();\r
+ configControl.replay();\r
+ \r
+ boolean isAuthorized = authenticator.isAuthorized( xmlRpcRequest );\r
+ \r
+ xmlRpcRequestControl.verify();\r
+ configControl.verify();\r
+ \r
+ assertFalse( isAuthorized );\r
+ }\r
+ \r
+ public void testIsAuthorizedUserExistsAndAuthorized()\r
+ throws Exception\r
+ {\r
+ createUser( USER_ALPACA, "Al 'Archiva' Paca", PASSWORD );\r
+ \r
+ UserManager userManager = securitySystem.getUserManager();\r
+ try\r
+ {\r
+ User user = userManager.findUser( USER_ALPACA );\r
+ assertEquals( USER_ALPACA, user.getPrincipal() );\r
+ }\r
+ catch ( UserNotFoundException e )\r
+ {\r
+ fail( "User should exist in the database." ); \r
+ }\r
+ \r
+ //TODO cannot assign global repo manager role - it says role does not exist :|\r
+ \r
+ //roleManager.assignRole( ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE, USER_ALPACA );\r
+ \r
+ xmlRpcRequestControl.expectAndReturn( xmlRpcRequest.getConfig(), config, 2 );\r
+ \r
+ configControl.expectAndReturn( config.getBasicUserName(), USER_ALPACA );\r
+ \r
+ configControl.expectAndReturn( config.getBasicPassword(), PASSWORD );\r
+ \r
+ xmlRpcRequestControl.replay();\r
+ configControl.replay();\r
+ \r
+ boolean isAuthorized = authenticator.isAuthorized( xmlRpcRequest );\r
+ \r
+ xmlRpcRequestControl.verify();\r
+ configControl.verify();\r
+ \r
+ //assertTrue( isAuthorized );\r
+ }\r
+ \r
+ public void testIsAuthorizedUserDoesNotExist()\r
+ throws Exception\r
+ { \r
+ UserManager userManager = securitySystem.getUserManager();\r
+ try\r
+ {\r
+ userManager.findUser( USER_ALPACA );\r
+ fail( "User should not exist in the database." );\r
+ }\r
+ catch ( UserNotFoundException e )\r
+ {\r
+ assertEquals( "Unable to find user 'alpaca'", e.getMessage() ); \r
+ }\r
+ \r
+ xmlRpcRequestControl.expectAndReturn( xmlRpcRequest.getConfig(), config, 2 );\r
+ \r
+ configControl.expectAndReturn( config.getBasicUserName(), USER_ALPACA );\r
+ \r
+ configControl.expectAndReturn( config.getBasicPassword(), PASSWORD );\r
+ \r
+ xmlRpcRequestControl.replay();\r
+ configControl.replay();\r
+ \r
+ boolean isAuthorized = authenticator.isAuthorized( xmlRpcRequest );\r
+ \r
+ xmlRpcRequestControl.verify();\r
+ configControl.verify();\r
+ \r
+ assertFalse( isAuthorized );\r
+ } \r
+}\r
+++ /dev/null
-package org.apache.maven.archiva.xmlrpc.security;\r
-\r
-/*\r
- * Licensed to the Apache Software Foundation (ASF) under one\r
- * or more contributor license agreements. See the NOTICE file\r
- * distributed with this work for additional information\r
- * regarding copyright ownership. The ASF licenses this file\r
- * to you under the Apache License, Version 2.0 (the\r
- * "License"); you may not use this file except in compliance\r
- * with the License. You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing,\r
- * software distributed under the License is distributed on an\r
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
- * KIND, either express or implied. See the License for the\r
- * specific language governing permissions and limitations\r
- * under the License.\r
- */\r
-\r
-import org.apache.maven.archiva.security.ArchivaRoleConstants;\r
-import org.apache.xmlrpc.XmlRpcRequest;\r
-import org.apache.xmlrpc.common.XmlRpcHttpRequestConfigImpl;\r
-import org.codehaus.plexus.redback.role.RoleManager;\r
-import org.codehaus.plexus.redback.system.SecuritySystem;\r
-import org.codehaus.plexus.redback.users.User;\r
-import org.codehaus.plexus.redback.users.UserManager;\r
-import org.codehaus.plexus.redback.users.UserNotFoundException;\r
-import org.codehaus.plexus.spring.PlexusInSpringTestCase;\r
-import org.easymock.MockControl;\r
-import org.easymock.classextension.MockClassControl;\r
-\r
-/**\r
- * XmlRpcAuthenticatorTest\r
- * \r
- * @version $Id XmlRpcAuthenticatorTest.java\r
- */\r
-public class XmlRpcAuthenticatorTest\r
-//extends AbstractDependencyInjectionSpringContextTests\r
- extends PlexusInSpringTestCase\r
-{\r
- protected static final String USER_GUEST = "guest";\r
-\r
- protected static final String USER_ADMIN = "admin";\r
-\r
- protected static final String USER_ALPACA = "alpaca";\r
-\r
- private static final String PASSWORD = "password123";\r
-\r
- protected SecuritySystem securitySystem;\r
-\r
- protected RoleManager roleManager;\r
- \r
- private MockControl xmlRpcRequestControl;\r
- \r
- private XmlRpcRequest xmlRpcRequest;\r
- \r
- private XmlRpcAuthenticator authenticator;\r
- \r
- private MockControl configControl;\r
- \r
- private XmlRpcHttpRequestConfigImpl config; \r
- \r
- public void setUp()\r
- throws Exception\r
- {\r
- super.setUp();\r
- \r
- securitySystem = (SecuritySystem) lookup( SecuritySystem.class, "testable" ); \r
- roleManager = (RoleManager) lookup( RoleManager.class, "default" );\r
- \r
- // Some basic asserts.\r
- assertNotNull( securitySystem ); \r
- assertNotNull( roleManager );\r
- \r
- // Setup Admin User.\r
- User adminUser = createUser( USER_ADMIN, "Admin User", null );\r
- roleManager.assignRole( ArchivaRoleConstants.TEMPLATE_SYSTEM_ADMIN, adminUser.getPrincipal().toString() );\r
-\r
- // Setup Guest User.\r
- User guestUser = createUser( USER_GUEST, "Guest User", null );\r
- roleManager.assignRole( ArchivaRoleConstants.TEMPLATE_GUEST, guestUser.getPrincipal().toString() );\r
- \r
- configControl = MockClassControl.createControl( XmlRpcHttpRequestConfigImpl.class );\r
- config = ( XmlRpcHttpRequestConfigImpl ) configControl.getMock();\r
- \r
- xmlRpcRequestControl = MockControl.createControl( XmlRpcRequest.class );\r
- xmlRpcRequest = ( XmlRpcRequest ) xmlRpcRequestControl.getMock(); \r
- \r
- authenticator = new XmlRpcAuthenticator( securitySystem ); \r
- }\r
- \r
- private User createUser( String principal, String fullname, String password )\r
- throws UserNotFoundException\r
- {\r
- UserManager userManager = securitySystem.getUserManager();\r
- \r
- User user = userManager.createUser( principal, fullname, principal + "@testable.archiva.apache.org" );\r
- securitySystem.getPolicy().setEnabled( false );\r
- userManager.addUser( user );\r
- securitySystem.getPolicy().setEnabled( true );\r
- \r
- user.setPassword( password ); \r
- userManager.updateUser( user );\r
- \r
- return user;\r
- }\r
- \r
- public void testIsAuthorizedUserExistsButNotAuthorized()\r
- throws Exception\r
- {\r
- createUser( USER_ALPACA, "Al 'Archiva' Paca", PASSWORD );\r
- \r
- UserManager userManager = securitySystem.getUserManager();\r
- try\r
- {\r
- User user = userManager.findUser( USER_ALPACA );\r
- assertEquals( USER_ALPACA, user.getPrincipal() );\r
- }\r
- catch ( UserNotFoundException e )\r
- {\r
- fail( "User should exist in the database." ); \r
- }\r
- \r
- xmlRpcRequestControl.expectAndReturn( xmlRpcRequest.getConfig(), config, 2 );\r
- \r
- configControl.expectAndReturn( config.getBasicUserName(), USER_ALPACA );\r
- \r
- configControl.expectAndReturn( config.getBasicPassword(), PASSWORD );\r
- \r
- xmlRpcRequestControl.replay();\r
- configControl.replay();\r
- \r
- boolean isAuthorized = authenticator.isAuthorized( xmlRpcRequest );\r
- \r
- xmlRpcRequestControl.verify();\r
- configControl.verify();\r
- \r
- assertFalse( isAuthorized );\r
- }\r
- \r
- public void testIsAuthorizedUserExistsAndAuthorized()\r
- throws Exception\r
- {\r
- createUser( USER_ALPACA, "Al 'Archiva' Paca", PASSWORD );\r
- \r
- UserManager userManager = securitySystem.getUserManager();\r
- try\r
- {\r
- User user = userManager.findUser( USER_ALPACA );\r
- assertEquals( USER_ALPACA, user.getPrincipal() );\r
- }\r
- catch ( UserNotFoundException e )\r
- {\r
- fail( "User should exist in the database." ); \r
- }\r
- \r
- //TODO cannot assign global repo manager role - it says role does not exist :|\r
- \r
- //roleManager.assignRole( ArchivaRoleConstants.GLOBAL_REPOSITORY_MANAGER_ROLE, USER_ALPACA );\r
- \r
- xmlRpcRequestControl.expectAndReturn( xmlRpcRequest.getConfig(), config, 2 );\r
- \r
- configControl.expectAndReturn( config.getBasicUserName(), USER_ALPACA );\r
- \r
- configControl.expectAndReturn( config.getBasicPassword(), PASSWORD );\r
- \r
- xmlRpcRequestControl.replay();\r
- configControl.replay();\r
- \r
- boolean isAuthorized = authenticator.isAuthorized( xmlRpcRequest );\r
- \r
- xmlRpcRequestControl.verify();\r
- configControl.verify();\r
- \r
- //assertTrue( isAuthorized );\r
- }\r
- \r
- public void testIsAuthorizedUserDoesNotExist()\r
- throws Exception\r
- { \r
- UserManager userManager = securitySystem.getUserManager();\r
- try\r
- {\r
- userManager.findUser( USER_ALPACA );\r
- fail( "User should not exist in the database." );\r
- }\r
- catch ( UserNotFoundException e )\r
- {\r
- assertEquals( "Unable to find user 'alpaca'", e.getMessage() ); \r
- }\r
- \r
- xmlRpcRequestControl.expectAndReturn( xmlRpcRequest.getConfig(), config, 2 );\r
- \r
- configControl.expectAndReturn( config.getBasicUserName(), USER_ALPACA );\r
- \r
- configControl.expectAndReturn( config.getBasicPassword(), PASSWORD );\r
- \r
- xmlRpcRequestControl.replay();\r
- configControl.replay();\r
- \r
- boolean isAuthorized = authenticator.isAuthorized( xmlRpcRequest );\r
- \r
- xmlRpcRequestControl.verify();\r
- configControl.verify();\r
- \r
- assertFalse( isAuthorized );\r
- } \r
-}\r
--- /dev/null
+<?xml version="1.0" ?>
+<component-set>
+ <components>
+
+ <!-- x
+ <component>
+ <role>org.apache.maven.archiva.security.UserRepositories</role>
+ <role-hint>default</role-hint>
+ <implementation>org.apache.maven.archiva.security.DefaultUserRepositories</implementation>
+ <description>DefaultUserRepositories</description>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.redback.system.SecuritySystem</role>
+ <role-hint>testable</role-hint>
+ <field-name>securitySystem</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+ <role-hint>memory</role-hint>
+ <field-name>rbacManager</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.role.RoleManager</role>
+ <role-hint>default</role-hint>
+ <field-name>roleManager</field-name>
+ </requirement>
+ <requirement>
+ <role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role>
+ <field-name>archivaConfiguration</field-name>
+ </requirement>
+ </requirements>
+ </component>
+ -->
+
+ <component>
+ <role>org.codehaus.plexus.redback.system.SecuritySystem</role>
+ <role-hint>testable</role-hint>
+ <implementation>org.codehaus.plexus.redback.system.DefaultSecuritySystem</implementation>
+ <description>DefaultSecuritySystem:</description>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.redback.authentication.AuthenticationManager</role>
+ <field-name>authnManager</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.authorization.Authorizer</role>
+ <role-hint>rbac</role-hint>
+ <field-name>authorizer</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.users.UserManager</role>
+ <role-hint>memory</role-hint>
+ <field-name>userManager</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.keys.KeyManager</role>
+ <role-hint>memory</role-hint>
+ <field-name>keyManager</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.policy.UserSecurityPolicy</role>
+ <field-name>policy</field-name>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.codehaus.plexus.redback.authorization.Authorizer</role>
+ <role-hint>rbac</role-hint>
+ <implementation>org.codehaus.plexus.redback.authorization.rbac.RbacAuthorizer</implementation>
+ <description>RbacAuthorizer:</description>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+ <role-hint>memory</role-hint>
+ <field-name>manager</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.users.UserManager</role>
+ <role-hint>memory</role-hint>
+ <field-name>userManager</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator</role>
+ <role-hint>default</role-hint>
+ <field-name>evaluator</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
+ <role-hint>default</role-hint>
+ <field-name>config</field-name>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator</role>
+ <role-hint>default</role-hint>
+ <implementation>org.codehaus.plexus.redback.authorization.rbac.evaluator.DefaultPermissionEvaluator</implementation>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.redback.users.UserManager</role>
+ <role-hint>memory</role-hint>
+ <field-name>userManager</field-name>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.codehaus.plexus.redback.role.RoleManager</role>
+ <role-hint>default</role-hint>
+ <implementation>org.codehaus.plexus.redback.role.DefaultRoleManager</implementation>
+ <description>RoleProfileManager:</description>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.redback.role.validator.RoleModelValidator</role>
+ <role-hint>default</role-hint>
+ <field-name>modelValidator</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.role.processor.RoleModelProcessor</role>
+ <role-hint>default</role-hint>
+ <field-name>modelProcessor</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.role.template.RoleTemplateProcessor</role>
+ <role-hint>default</role-hint>
+ <field-name>templateProcessor</field-name>
+ </requirement>
+ <requirement>
+ <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+ <role-hint>memory</role-hint>
+ <field-name>rbacManager</field-name>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.codehaus.plexus.redback.role.processor.RoleModelProcessor</role>
+ <role-hint>default</role-hint>
+ <implementation>org.codehaus.plexus.redback.role.processor.DefaultRoleModelProcessor</implementation>
+ <description>DefaultRoleModelProcessor: inserts the components of the model that can be populated into the rbac manager</description>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+ <role-hint>memory</role-hint>
+ <field-name>rbacManager</field-name>
+ </requirement>
+ </requirements>
+ </component>
+
+ <component>
+ <role>org.codehaus.plexus.redback.role.template.RoleTemplateProcessor</role>
+ <role-hint>default</role-hint>
+ <implementation>org.codehaus.plexus.redback.role.template.DefaultRoleTemplateProcessor</implementation>
+ <description>DefaultRoleTemplateProcessor: inserts the components of a template into the rbac manager</description>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
+ <role-hint>memory</role-hint>
+ <field-name>rbacManager</field-name>
+ </requirement>
+ </requirements>
+ </component>
+
+ <!--
+ <component>
+ <role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role>
+ <implementation>org.apache.maven.archiva.configuration.DefaultArchivaConfiguration</implementation>
+ <requirements>
+ <requirement>
+ <role>org.codehaus.plexus.registry.Registry</role>
+ <role-hint>configured</role-hint>
+ </requirement>
+ </requirements>
+ </component>
+ <component>
+ <role>org.codehaus.plexus.registry.Registry</role>
+ <role-hint>configured</role-hint>
+ <implementation>org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry</implementation>
+ <configuration>
+ <properties>
+ <system/>
+ <xml fileName="${basedir}/target/test-conf/archiva.xml"
+ config-name="org.apache.maven.archiva.base" config-at="org.apache.maven.archiva"/>
+ </properties>
+ </configuration>
+ </component>
+ -->
+
+ </components>
+</component-set>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" ?>
-<component-set>
- <components>
-
- <!-- x
- <component>
- <role>org.apache.maven.archiva.security.UserRepositories</role>
- <role-hint>default</role-hint>
- <implementation>org.apache.maven.archiva.security.DefaultUserRepositories</implementation>
- <description>DefaultUserRepositories</description>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.redback.system.SecuritySystem</role>
- <role-hint>testable</role-hint>
- <field-name>securitySystem</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
- <role-hint>memory</role-hint>
- <field-name>rbacManager</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.role.RoleManager</role>
- <role-hint>default</role-hint>
- <field-name>roleManager</field-name>
- </requirement>
- <requirement>
- <role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role>
- <field-name>archivaConfiguration</field-name>
- </requirement>
- </requirements>
- </component>
- -->
-
- <component>
- <role>org.codehaus.plexus.redback.system.SecuritySystem</role>
- <role-hint>testable</role-hint>
- <implementation>org.codehaus.plexus.redback.system.DefaultSecuritySystem</implementation>
- <description>DefaultSecuritySystem:</description>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.redback.authentication.AuthenticationManager</role>
- <field-name>authnManager</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.authorization.Authorizer</role>
- <role-hint>rbac</role-hint>
- <field-name>authorizer</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.users.UserManager</role>
- <role-hint>memory</role-hint>
- <field-name>userManager</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.keys.KeyManager</role>
- <role-hint>memory</role-hint>
- <field-name>keyManager</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.policy.UserSecurityPolicy</role>
- <field-name>policy</field-name>
- </requirement>
- </requirements>
- </component>
-
- <component>
- <role>org.codehaus.plexus.redback.authorization.Authorizer</role>
- <role-hint>rbac</role-hint>
- <implementation>org.codehaus.plexus.redback.authorization.rbac.RbacAuthorizer</implementation>
- <description>RbacAuthorizer:</description>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
- <role-hint>memory</role-hint>
- <field-name>manager</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.users.UserManager</role>
- <role-hint>memory</role-hint>
- <field-name>userManager</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator</role>
- <role-hint>default</role-hint>
- <field-name>evaluator</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.configuration.UserConfiguration</role>
- <role-hint>default</role-hint>
- <field-name>config</field-name>
- </requirement>
- </requirements>
- </component>
-
- <component>
- <role>org.codehaus.plexus.redback.authorization.rbac.evaluator.PermissionEvaluator</role>
- <role-hint>default</role-hint>
- <implementation>org.codehaus.plexus.redback.authorization.rbac.evaluator.DefaultPermissionEvaluator</implementation>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.redback.users.UserManager</role>
- <role-hint>memory</role-hint>
- <field-name>userManager</field-name>
- </requirement>
- </requirements>
- </component>
-
- <component>
- <role>org.codehaus.plexus.redback.role.RoleManager</role>
- <role-hint>default</role-hint>
- <implementation>org.codehaus.plexus.redback.role.DefaultRoleManager</implementation>
- <description>RoleProfileManager:</description>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.redback.role.validator.RoleModelValidator</role>
- <role-hint>default</role-hint>
- <field-name>modelValidator</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.role.processor.RoleModelProcessor</role>
- <role-hint>default</role-hint>
- <field-name>modelProcessor</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.role.template.RoleTemplateProcessor</role>
- <role-hint>default</role-hint>
- <field-name>templateProcessor</field-name>
- </requirement>
- <requirement>
- <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
- <role-hint>memory</role-hint>
- <field-name>rbacManager</field-name>
- </requirement>
- </requirements>
- </component>
-
- <component>
- <role>org.codehaus.plexus.redback.role.processor.RoleModelProcessor</role>
- <role-hint>default</role-hint>
- <implementation>org.codehaus.plexus.redback.role.processor.DefaultRoleModelProcessor</implementation>
- <description>DefaultRoleModelProcessor: inserts the components of the model that can be populated into the rbac manager</description>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
- <role-hint>memory</role-hint>
- <field-name>rbacManager</field-name>
- </requirement>
- </requirements>
- </component>
-
- <component>
- <role>org.codehaus.plexus.redback.role.template.RoleTemplateProcessor</role>
- <role-hint>default</role-hint>
- <implementation>org.codehaus.plexus.redback.role.template.DefaultRoleTemplateProcessor</implementation>
- <description>DefaultRoleTemplateProcessor: inserts the components of a template into the rbac manager</description>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.redback.rbac.RBACManager</role>
- <role-hint>memory</role-hint>
- <field-name>rbacManager</field-name>
- </requirement>
- </requirements>
- </component>
-
- <!--
- <component>
- <role>org.apache.maven.archiva.configuration.ArchivaConfiguration</role>
- <implementation>org.apache.maven.archiva.configuration.DefaultArchivaConfiguration</implementation>
- <requirements>
- <requirement>
- <role>org.codehaus.plexus.registry.Registry</role>
- <role-hint>configured</role-hint>
- </requirement>
- </requirements>
- </component>
- <component>
- <role>org.codehaus.plexus.registry.Registry</role>
- <role-hint>configured</role-hint>
- <implementation>org.codehaus.plexus.registry.commons.CommonsConfigurationRegistry</implementation>
- <configuration>
- <properties>
- <system/>
- <xml fileName="${basedir}/target/test-conf/archiva.xml"
- config-name="org.apache.maven.archiva.base" config-at="org.apache.maven.archiva"/>
- </properties>
- </configuration>
- </component>
- -->
-
- </components>
-</component-set>
\ No newline at end of file
--- /dev/null
+package org.apache.archiva.web.xmlrpc.services;
+
+/*
+ * 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 java.util.List;
+
+import org.apache.archiva.web.xmlrpc.api.AdministrationService;
+import org.apache.archiva.web.xmlrpc.api.ManagedRepository;
+import org.apache.archiva.web.xmlrpc.api.RemoteRepository;
+
+public class AdministrationServiceImpl
+ implements AdministrationService
+{
+
+ public boolean configureDatabaseConsumer( String consumerId, boolean enable )
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable )
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean deleteArtifact( String repoId, String groupId, String artifactId, String version )
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean executeDatabaseScanner()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean executeRepositoryScanner( String repoId )
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public List<String> getAllDatabaseConsumers()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<String> getAllRepositoryConsumers( String repoId )
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<ManagedRepository> getAllManagedRepositories()
+ {
+ return null;
+ }
+
+ public List<RemoteRepository> getAllRemoteRepositories()
+ {
+ return null;
+ }
+}
--- /dev/null
+package org.apache.archiva.web.xmlrpc.services;\r
+\r
+/*\r
+ * Licensed to the Apache Software Foundation (ASF) under one\r
+ * or more contributor license agreements. See the NOTICE file\r
+ * distributed with this work for additional information\r
+ * regarding copyright ownership. The ASF licenses this file\r
+ * to you under the Apache License, Version 2.0 (the\r
+ * "License"); you may not use this file except in compliance\r
+ * with the License. You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing,\r
+ * software distributed under the License is distributed on an\r
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
+ * KIND, either express or implied. See the License for the\r
+ * specific language governing permissions and limitations\r
+ * under the License.\r
+ */\r
+\r
+import org.apache.archiva.web.xmlrpc.api.TestService;\r
+\r
+public class PingServiceImpl implements TestService\r
+{\r
+ public String ping()\r
+ {\r
+ return "pong";\r
+ }\r
+}\r
+++ /dev/null
-package org.apache.maven.archiva.web.xmlrpc.services;
-
-/*
- * 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 java.util.List;
-
-import org.apache.maven.archiva.web.xmlrpc.api.AdministrationService;
-import org.apache.maven.archiva.web.xmlrpc.api.ManagedRepository;
-import org.apache.maven.archiva.web.xmlrpc.api.RemoteRepository;
-
-public class AdministrationServiceImpl
- implements AdministrationService
-{
-
- public boolean configureDatabaseConsumer( String consumerId, boolean enable )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean configureRepositoryConsumer( String repoId, String consumerId, boolean enable )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean deleteArtifact( String repoId, String groupId, String artifactId, String version )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean executeDatabaseScanner()
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public boolean executeRepositoryScanner( String repoId )
- {
- // TODO Auto-generated method stub
- return false;
- }
-
- public List<String> getAllDatabaseConsumers()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<String> getAllRepositoryConsumers( String repoId )
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- public List<ManagedRepository> getAllManagedRepositories()
- {
- return null;
- }
-
- public List<RemoteRepository> getAllRemoteRepositories()
- {
- return null;
- }
-}
+++ /dev/null
-package org.apache.maven.archiva.web.xmlrpc.services;\r
-\r
-/*\r
- * Licensed to the Apache Software Foundation (ASF) under one\r
- * or more contributor license agreements. See the NOTICE file\r
- * distributed with this work for additional information\r
- * regarding copyright ownership. The ASF licenses this file\r
- * to you under the Apache License, Version 2.0 (the\r
- * "License"); you may not use this file except in compliance\r
- * with the License. You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing,\r
- * software distributed under the License is distributed on an\r
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r
- * KIND, either express or implied. See the License for the\r
- * specific language governing permissions and limitations\r
- * under the License.\r
- */\r
-\r
-import org.apache.maven.archiva.web.xmlrpc.api.TestService;\r
-\r
-public class PingServiceImpl implements TestService\r
-{\r
- public String ping()\r
- {\r
- return "pong";\r
- }\r
-}\r