diff options
author | Olivier Lamy <olamy@apache.org> | 2011-09-05 08:31:35 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2011-09-05 08:31:35 +0000 |
commit | 4f42feb44f17daa9c8cc4a73b3858c886cfc0cad (patch) | |
tree | ddeeb4436a3ff4de1b32efdfc7f0dde6d45db407 /archiva-modules | |
parent | 0a1b1d317f0dfcd8d0929c3a69bc612c7bdc1326 (diff) | |
download | archiva-4f42feb44f17daa9c8cc4a73b3858c886cfc0cad.tar.gz archiva-4f42feb44f17daa9c8cc4a73b3858c886cfc0cad.zip |
[MRM-1504] Add a new module for repository administration management : move redback configuration and role constants to a new module in archiva-base called archiva-security-common
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1165203 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
9 files changed, 112 insertions, 72 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/pom.xml b/archiva-modules/archiva-base/archiva-repository-admin/pom.xml index 5f004f8e5..43abeecdc 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/pom.xml +++ b/archiva-modules/archiva-base/archiva-repository-admin/pom.xml @@ -32,12 +32,9 @@ <groupId>org.apache.archiva</groupId> <artifactId>archiva-configuration</artifactId> </dependency> - <!-- FIXME should not be a dependency role constants must be moved in a new module - archiva-security-common - --> <dependency> <groupId>org.apache.archiva</groupId> - <artifactId>archiva-security</artifactId> + <artifactId>archiva-security-common</artifactId> </dependency> <dependency> <groupId>org.apache.archiva</groupId> diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java index cbf56542e..692669f2b 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/src/main/java/org/apache/archiva/admin/repository/managed/DefaultManagedRepositoryAdmin.java @@ -29,7 +29,7 @@ import org.apache.archiva.metadata.repository.RepositorySessionFactory; import org.apache.archiva.metadata.repository.stats.RepositoryStatisticsManager; import org.apache.archiva.scheduler.repository.RepositoryArchivaTaskScheduler; import org.apache.archiva.scheduler.repository.RepositoryTask; -import org.apache.archiva.security.ArchivaRoleConstants; +import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.apache.commons.validator.GenericValidator; diff --git a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java index 581660251..cedbc98a4 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/src/test/java/org/apache/archiva/admin/repository/managed/ManagedRepositoryAdminTest.java @@ -18,16 +18,12 @@ package org.apache.archiva.admin.repository.managed; * under the License. */ -import org.apache.archiva.admin.AuditInformation; -import org.apache.archiva.admin.mock.MockAuditListener; import org.apache.archiva.admin.repository.AbstractRepositoryAdminTest; import org.apache.archiva.audit.AuditEvent; -import org.apache.archiva.security.ArchivaRoleConstants; +import org.apache.archiva.security.common.ArchivaRoleConstants; import org.apache.commons.io.FileUtils; import org.apache.commons.lang.StringUtils; import org.codehaus.plexus.redback.role.RoleManager; -import org.codehaus.plexus.redback.users.User; -import org.codehaus.plexus.redback.users.memory.SimpleUser; import org.junit.Test; import javax.inject.Inject; diff --git a/archiva-modules/archiva-base/archiva-security-common/pom.xml b/archiva-modules/archiva-base/archiva-security-common/pom.xml new file mode 100644 index 000000000..722f7e701 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-security-common/pom.xml @@ -0,0 +1,13 @@ +<?xml version="1.0"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>archiva-base</artifactId> + <groupId>org.apache.archiva</groupId> + <version>1.4-SNAPSHOT</version> + </parent> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-security-common</artifactId> + <name>archiva-security-common</name> +</project> diff --git a/archiva-modules/archiva-base/archiva-security-common/src/main/java/org/apache/archiva/security/common/ArchivaRoleConstants.java b/archiva-modules/archiva-base/archiva-security-common/src/main/java/org/apache/archiva/security/common/ArchivaRoleConstants.java new file mode 100644 index 000000000..334bb8d27 --- /dev/null +++ b/archiva-modules/archiva-base/archiva-security-common/src/main/java/org/apache/archiva/security/common/ArchivaRoleConstants.java @@ -0,0 +1,86 @@ +package org.apache.archiva.security.common; + +/* + * 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. + */ + +public class ArchivaRoleConstants +{ + public static final String DELIMITER = " - "; + + // globalish roles + public static final String SYSTEM_ADMINISTRATOR_ROLE = "System Administrator"; + + public static final String USER_ADMINISTRATOR_ROLE = "User Administrator"; + + public static final String GLOBAL_REPOSITORY_MANAGER_ROLE = "Global Repository Manager"; + + public static final String GLOBAL_REPOSITORY_OBSERVER_ROLE = "Global Repository Observer"; + + public static final String REGISTERED_USER_ROLE = "Registered User"; + + public static final String GUEST_ROLE = "Guest"; + + // dynamic role prefixes + public static final String REPOSITORY_MANAGER_ROLE_PREFIX = "Repository Manager"; + + public static final String REPOSITORY_OBSERVER_ROLE_PREFIX = "Repository Observer"; + + // operations + public static final String OPERATION_MANAGE_USERS = "archiva-manage-users"; + + public static final String OPERATION_MANAGE_CONFIGURATION = "archiva-manage-configuration"; + + public static final String OPERATION_ACTIVE_GUEST = "archiva-guest"; + + public static final String OPERATION_RUN_INDEXER = "archiva-run-indexer"; + + public static final String OPERATION_REGENERATE_INDEX = "archiva-regenerate-index"; + + public static final String OPERATION_ACCESS_REPORT = "archiva-access-reports"; + + public static final String OPERATION_ADD_REPOSITORY = "archiva-add-repository"; + + public static final String OPERATION_REPOSITORY_ACCESS = "archiva-read-repository"; + + public static final String OPERATION_DELETE_REPOSITORY = "archiva-delete-repository"; + + public static final String OPERATION_EDIT_REPOSITORY = "archiva-edit-repository"; + + public static final String OPERATION_REPOSITORY_UPLOAD = "archiva-upload-repository"; + + public static final String OPERATION_REPOSITORY_DELETE = "archiva-delete-artifact"; + + public static final String OPERATION_VIEW_AUDIT_LOG = "archiva-view-audit-logs"; + + // Role templates + public static final String TEMPLATE_REPOSITORY_MANAGER = "archiva-repository-manager"; + + public static final String TEMPLATE_REPOSITORY_OBSERVER = "archiva-repository-observer"; + + public static final String TEMPLATE_GLOBAL_REPOSITORY_OBSERVER = "archiva-global-repository-observer"; + + public static final String TEMPLATE_SYSTEM_ADMIN = "archiva-system-administrator"; + + public static final String TEMPLATE_GUEST = "archiva-guest"; + + public static String toRepositoryObserverRoleName( String repoId ) + { + return REPOSITORY_OBSERVER_ROLE_PREFIX + " - " + repoId; + } +} diff --git a/archiva-modules/archiva-web/archiva-security/src/main/resources/META-INF/redback/redback.xml b/archiva-modules/archiva-base/archiva-security-common/src/main/resources/META-INF/redback/redback.xml index e771f165c..e771f165c 100644 --- a/archiva-modules/archiva-web/archiva-security/src/main/resources/META-INF/redback/redback.xml +++ b/archiva-modules/archiva-base/archiva-security-common/src/main/resources/META-INF/redback/redback.xml diff --git a/archiva-modules/archiva-base/pom.xml b/archiva-modules/archiva-base/pom.xml index 2336b2262..de0a44f24 100644 --- a/archiva-modules/archiva-base/pom.xml +++ b/archiva-modules/archiva-base/pom.xml @@ -47,5 +47,6 @@ <module>archiva-repository-scanner</module> <module>archiva-proxy-common</module> <module>archiva-repository-admin</module> + <module>archiva-security-common</module> </modules> </project>
\ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-security/pom.xml b/archiva-modules/archiva-web/archiva-security/pom.xml index 66f55d8c4..424ba398b 100644 --- a/archiva-modules/archiva-web/archiva-security/pom.xml +++ b/archiva-modules/archiva-web/archiva-security/pom.xml @@ -33,6 +33,10 @@ <artifactId>archiva-configuration</artifactId> </dependency> <dependency> + <groupId>org.apache.archiva</groupId> + <artifactId>archiva-security-common</artifactId> + </dependency> + <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <scope>provided</scope> diff --git a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaRoleConstants.java b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaRoleConstants.java index 1f8ca53b4..511c9a44e 100644 --- a/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaRoleConstants.java +++ b/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/archiva/security/ArchivaRoleConstants.java @@ -19,68 +19,11 @@ package org.apache.archiva.security; * under the License. */ +/** + * @deprecated you must now use org.apache.archiva.security.common.ArchivaRoleConstants + */ public class ArchivaRoleConstants + extends org.apache.archiva.security.common.ArchivaRoleConstants { - public static final String DELIMITER = " - "; - - // globalish roles - public static final String SYSTEM_ADMINISTRATOR_ROLE = "System Administrator"; - - public static final String USER_ADMINISTRATOR_ROLE = "User Administrator"; - - public static final String GLOBAL_REPOSITORY_MANAGER_ROLE = "Global Repository Manager"; - - public static final String GLOBAL_REPOSITORY_OBSERVER_ROLE = "Global Repository Observer"; - - public static final String REGISTERED_USER_ROLE = "Registered User"; - - public static final String GUEST_ROLE = "Guest"; - - // dynamic role prefixes - public static final String REPOSITORY_MANAGER_ROLE_PREFIX = "Repository Manager"; - - public static final String REPOSITORY_OBSERVER_ROLE_PREFIX = "Repository Observer"; - - // operations - public static final String OPERATION_MANAGE_USERS = "archiva-manage-users"; - - public static final String OPERATION_MANAGE_CONFIGURATION = "archiva-manage-configuration"; - - public static final String OPERATION_ACTIVE_GUEST = "archiva-guest"; - - public static final String OPERATION_RUN_INDEXER = "archiva-run-indexer"; - - public static final String OPERATION_REGENERATE_INDEX = "archiva-regenerate-index"; - - public static final String OPERATION_ACCESS_REPORT = "archiva-access-reports"; - - public static final String OPERATION_ADD_REPOSITORY = "archiva-add-repository"; - - public static final String OPERATION_REPOSITORY_ACCESS = "archiva-read-repository"; - - public static final String OPERATION_DELETE_REPOSITORY = "archiva-delete-repository"; - - public static final String OPERATION_EDIT_REPOSITORY = "archiva-edit-repository"; - - public static final String OPERATION_REPOSITORY_UPLOAD = "archiva-upload-repository"; - - public static final String OPERATION_REPOSITORY_DELETE = "archiva-delete-artifact"; - - public static final String OPERATION_VIEW_AUDIT_LOG = "archiva-view-audit-logs"; - - // Role templates - public static final String TEMPLATE_REPOSITORY_MANAGER = "archiva-repository-manager"; - - public static final String TEMPLATE_REPOSITORY_OBSERVER = "archiva-repository-observer"; - - public static final String TEMPLATE_GLOBAL_REPOSITORY_OBSERVER = "archiva-global-repository-observer"; - - public static final String TEMPLATE_SYSTEM_ADMIN = "archiva-system-administrator"; - - public static final String TEMPLATE_GUEST = "archiva-guest"; - - public static String toRepositoryObserverRoleName( String repoId ) - { - return REPOSITORY_OBSERVER_ROLE_PREFIX + " - " + repoId; - } + // no op only here for backward comp } |