]> source.dussan.org Git - archiva.git/commitdiff
package move to o.a.a.r module redback-system
authorOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 23:18:32 +0000 (23:18 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 7 Apr 2012 23:18:32 +0000 (23:18 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1310917 13f79535-47bb-0310-9956-ffa450edef68

61 files changed:
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/checks/ExpectedJsps.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/checks/security/AdminAutoCreateCheck.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/checks/security/GuestUserEnvironmentCheck.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/checks/security/LockedAdminEnvironmentCheck.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/checks/security/RequiredRolesEnvironmentCheck.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/filter/authentication/HttpAuthenticator.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/filter/authentication/basic/HttpBasicAuthentication.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/filter/authorization/SimpleAuthorizationFilter.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/mail/MailerImpl.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/reports/CsvRolesMatrix.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/reports/CsvUserList.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/taglib/jsp/IfAnyAuthorizedTag.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/taglib/jsp/IfAuthorizedTag.java
redback-integrations/redback-common-integrations/src/main/java/org/codehaus/redback/integration/util/AutoLoginCookies.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/DefaultLoginService.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/DefaultPasswordService.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/DefaultUserService.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/interceptors/AuthenticationInterceptor.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/interceptors/PermissionsInterceptor.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/utils/EnvironmentChecker.java
redback-integrations/redback-rest/redback-rest-services/src/main/java/org/codehaus/redback/rest/services/utils/PasswordValidator.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/AbstractSecurityAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/AbstractUserCredentialsAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/AccountAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/LoginAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/PasswordAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/PasswordResetAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/AddAdminUserAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/SystemInfoAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/UserEditAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/action/admin/UserListAction.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/checks/ExpectedXworkActions.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/checks/ExpectedXworkConfiguration.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/interceptor/AutoLoginInterceptor.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/interceptor/EnvironmentCheckInterceptor.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/interceptor/ForceAdminUserInterceptor.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/interceptor/PolicyEnforcementInterceptor.java
redback-integrations/redback-struts2/redback-struts2-integration/src/main/java/org/codehaus/plexus/redback/struts2/interceptor/SecureActionInterceptor.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/LoginActionTest.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/admin/AbstractUserCredentialsActionTest.java
redback-integrations/redback-struts2/redback-struts2-integration/src/test/java/org/codehaus/plexus/redback/struts2/action/admin/UserEditActionTest.java
redback-system/src/main/java/org/apache/archiva/redback/system/DefaultSecuritySession.java [new file with mode: 0644]
redback-system/src/main/java/org/apache/archiva/redback/system/DefaultSecuritySystem.java [new file with mode: 0644]
redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySession.java [new file with mode: 0644]
redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySystem.java [new file with mode: 0644]
redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySystemConstants.java [new file with mode: 0644]
redback-system/src/main/java/org/apache/archiva/redback/system/check/EnvironmentCheck.java [new file with mode: 0644]
redback-system/src/main/java/org/codehaus/plexus/redback/system/DefaultSecuritySession.java [deleted file]
redback-system/src/main/java/org/codehaus/plexus/redback/system/DefaultSecuritySystem.java [deleted file]
redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySession.java [deleted file]
redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySystem.java [deleted file]
redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySystemConstants.java [deleted file]
redback-system/src/main/java/org/codehaus/plexus/redback/system/check/EnvironmentCheck.java [deleted file]
redback-system/src/main/resources/META-INF/spring-context.xml
redback-system/src/test/java/org/apache/archiva/redback/system/DefaultSecureApplication.java [new file with mode: 0644]
redback-system/src/test/java/org/apache/archiva/redback/system/SecureApplication.java [new file with mode: 0644]
redback-system/src/test/java/org/apache/archiva/redback/system/TestAuthenticationManager.java [new file with mode: 0644]
redback-system/src/test/java/org/codehaus/plexus/redback/system/DefaultSecureApplication.java [deleted file]
redback-system/src/test/java/org/codehaus/plexus/redback/system/SecureApplication.java [deleted file]
redback-system/src/test/java/org/codehaus/plexus/redback/system/TestAuthenticationManager.java [deleted file]
redback-system/src/test/resources/spring-context.xml

index 3dc388a615297cb97909fee9e9fd1a6c527d4617..f26831745b7f086e58dece981078244a27055191 100644 (file)
@@ -21,7 +21,7 @@ package org.codehaus.redback.integration.checks;
 
 import java.util.List;
 
-import org.codehaus.plexus.redback.system.check.EnvironmentCheck;
+import org.apache.archiva.redback.system.check.EnvironmentCheck;
 import org.springframework.stereotype.Service;
 
 /**
index f8ff763f83c19c48d66257df6c42b2df58ee9af6..65267bc5135593898d6154d6bfc25ba88f6f9008 100644 (file)
@@ -28,9 +28,9 @@ import org.apache.archiva.redback.configuration.UserConfiguration;
 import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.apache.archiva.redback.rbac.Role;
 import org.apache.archiva.redback.role.RoleManager;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
-import org.codehaus.plexus.redback.system.check.EnvironmentCheck;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.check.EnvironmentCheck;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
 import org.codehaus.plexus.util.IOUtil;
index 1bd5464806e5c71eb03cb84159be046ae8cf25d7..284734074dc50471d953f3579a7cf7a2456cf2ab 100644 (file)
@@ -24,8 +24,8 @@ import org.apache.archiva.redback.role.RoleManagerException;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.role.RoleManager;
-import org.codehaus.plexus.redback.system.SecuritySystem;
-import org.codehaus.plexus.redback.system.check.EnvironmentCheck;
+import org.apache.archiva.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.check.EnvironmentCheck;
 import org.apache.archiva.redback.users.UserManager;
 import org.springframework.stereotype.Service;
 
index f47e4742189dbd8d5e33599e08fb652855c007af..15aa7ed144bf34012774a8677344ce61bc466c3d 100644 (file)
@@ -20,10 +20,10 @@ package org.codehaus.redback.integration.checks.security;
  */
 
 import org.apache.archiva.redback.rbac.RbacManagerException;
+import org.apache.archiva.redback.system.check.EnvironmentCheck;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.rbac.RBACManager;
 import org.apache.archiva.redback.rbac.UserAssignment;
-import org.codehaus.plexus.redback.system.check.EnvironmentCheck;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
 import org.codehaus.redback.integration.role.RoleConstants;
index b8792e70b0da989485607ef7ed7437eb54b490b5..0fbd1eb9d05327668880fa1be751a9ca1517758d 100644 (file)
@@ -25,7 +25,7 @@ import javax.inject.Inject;
 
 import org.apache.archiva.redback.role.RoleManager;
 import org.apache.archiva.redback.role.RoleManagerException;
-import org.codehaus.plexus.redback.system.check.EnvironmentCheck;
+import org.apache.archiva.redback.system.check.EnvironmentCheck;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
index 5cab6e27918619b695168ed26f9b8f3e8c582db7..0453ad3a9252698378f7354d802a3641f41ec270 100644 (file)
@@ -26,9 +26,9 @@ import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.authentication.AuthenticationDataSource;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.policy.AccountLockedException;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 6423949632377ee26065309898d292a8e9f225d4..42565b50a3790a38a82c6904ee3bb13d0ba52853 100644 (file)
@@ -31,7 +31,7 @@ import org.apache.archiva.redback.policy.MustChangePasswordException;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
-import org.codehaus.plexus.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySession;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.filter.authentication.HttpAuthenticator;
 import org.springframework.stereotype.Service;
index 3c4c8eef82e7258fb42c00371a8f0582fe572469..64c5eefcf467918d33ba61f206ee829ac832eee3 100644 (file)
@@ -20,8 +20,8 @@ package org.codehaus.redback.integration.filter.authorization;
  */
 
 import org.apache.archiva.redback.authorization.AuthorizationException;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.filter.SpringServletFilter;
 import org.slf4j.Logger;
index 7d1081b9d754dfd6fbcd738182b7f1377b53ad08..2dd587a2d8f183113f41dd2715a37891ec6a7df7 100644 (file)
@@ -37,7 +37,7 @@ import org.apache.archiva.redback.configuration.UserConfiguration;
 import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.policy.UserSecurityPolicy;
 import org.apache.archiva.redback.policy.UserValidationSettings;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 4c7f5f345270759bf7a2b8ae636cf1d7cb36a914..3ebb74fd4875069cce64b6b9abe6aaee698e7ae2 100644 (file)
@@ -24,7 +24,7 @@ import org.apache.archiva.redback.rbac.Role;
 import org.apache.archiva.redback.rbac.UserAssignment;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.commons.lang.StringEscapeUtils;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.apache.archiva.redback.users.User;
 import org.codehaus.redback.integration.util.RoleSorter;
 import org.codehaus.redback.integration.util.UserComparator;
index a71313869d6d9d2eb2b5496ab685d62e9cf8ff8c..3ea2f52b856de9fcab58dd628dd59d596aa5b790 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.lang.StringEscapeUtils;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.codehaus.redback.integration.util.UserComparator;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 8f551f05e024c6c97100f095885f04133dd8b07f..688e1eb54604dc32ede59d908c7d488290822ddc 100644 (file)
@@ -20,9 +20,9 @@ package org.codehaus.redback.integration.taglib.jsp;
  */
 
 import org.apache.archiva.redback.authorization.AuthorizationException;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.springframework.context.ApplicationContext;
 import org.springframework.web.context.support.WebApplicationContextUtils;
 
index a1a75eeeac9a3064e732e5cde22f7e50996bd890..670ffc84f15e7f9ee3cd91010ee40a7c2778bfed 100644 (file)
@@ -20,9 +20,9 @@ package org.codehaus.redback.integration.taglib.jsp;
  */
 
 import org.apache.archiva.redback.authorization.AuthorizationException;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.springframework.context.ApplicationContext;
 import org.springframework.web.context.support.WebApplicationContextUtils;
 
index 027222c2c536e8fd1e79b1de5ac340e3f448aa7f..5ba995b90c0a1358d5830c9aeb2950e9ab39ca41 100644 (file)
@@ -29,7 +29,7 @@ import org.apache.archiva.redback.keys.KeyManager;
 import org.apache.archiva.redback.keys.KeyManagerException;
 import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.apache.archiva.redback.policy.CookieSettings;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 956bfba1879613bba2ddffe2c8c9294ca9ca6877..d6fe1cf48aaed8b1060f753bc22e247ad06ae611 100644 (file)
@@ -28,8 +28,8 @@ import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.codehaus.plexus.redback.keys.jdo.JdoAuthenticationKey;
 import org.apache.archiva.redback.keys.memory.MemoryAuthenticationKey;
 import org.apache.archiva.redback.keys.memory.MemoryKeyManager;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.codehaus.redback.integration.filter.authentication.HttpAuthenticator;
 import org.codehaus.redback.rest.api.model.User;
 import org.codehaus.redback.rest.api.services.LoginService;
index 10b13efa98cad3e47f1f744985a277593fe70aec..71b3a3195114cebf7020b9639daf92c80c4a4958 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.archiva.redback.users.User;
 import org.apache.commons.lang.StringUtils;
 import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.keys.KeyManagerException;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.codehaus.redback.integration.filter.authentication.HttpAuthenticator;
 import org.codehaus.redback.rest.api.model.ErrorMessage;
index 19da990e91725c9d8fca00e2adb8294eb57441ca..ff0f8f84e697e3d3136272f55553873cff2e88e6 100644 (file)
@@ -41,7 +41,7 @@ import org.apache.archiva.redback.policy.PasswordEncoder;
 import org.apache.archiva.redback.policy.UserSecurityPolicy;
 import org.apache.archiva.redback.rbac.RBACManager;
 import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.codehaus.redback.integration.filter.authentication.HttpAuthenticator;
 import org.codehaus.redback.integration.mail.Mailer;
 import org.codehaus.redback.integration.security.role.RedbackRoleConstants;
index cd11c7897a07729a13c219819c359b0fa2c4ad69..0a915b201655e8e8aa1f241960b5eee1d1beb358 100644 (file)
@@ -30,7 +30,7 @@ import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
 import org.apache.archiva.redback.policy.AccountLockedException;
-import org.codehaus.plexus.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySession;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.codehaus.redback.integration.filter.authentication.HttpAuthenticationException;
 import org.codehaus.redback.integration.filter.authentication.basic.HttpBasicAuthentication;
index 99092f9a322c3500f3cc8b643a503bbd1af5d3da..20421504c746d6af44b9b8e9f53dc044cb54279c 100644 (file)
@@ -26,8 +26,8 @@ import org.apache.cxf.message.Message;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.authorization.AuthorizationException;
 import org.apache.archiva.redback.authorization.RedbackAuthorization;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.codehaus.redback.integration.filter.authentication.basic.HttpBasicAuthentication;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 3aeebd02f15a541d1d6f4984b814a3292a70549b..f3ad73462c287917fb12624a94f047a3de926c64 100644 (file)
@@ -18,7 +18,7 @@ package org.codehaus.redback.rest.services.utils;
  * under the License.
  */
 
-import org.codehaus.plexus.redback.system.check.EnvironmentCheck;
+import org.apache.archiva.redback.system.check.EnvironmentCheck;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.ApplicationContext;
index 2bb8bfa39f1b654a656979f3096415467116e416..eec71efdbfae71fb10bd626823d382bbf4c23e3a 100644 (file)
@@ -23,7 +23,7 @@ import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.policy.PasswordEncoder;
 import org.apache.archiva.redback.policy.PasswordRuleViolationException;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.codehaus.redback.rest.api.model.ErrorMessage;
 import org.codehaus.redback.rest.api.services.RedbackServiceException;
 import org.slf4j.Logger;
index e19361e9f904755460ac95584ea886eb3b15d77b..b57af4c96cf6b48cb1f08fc0c76b3f12236e5937 100644 (file)
@@ -25,8 +25,8 @@ import javax.servlet.http.HttpServletRequest;
 import org.apache.struts2.ServletActionContext;
 import org.apache.archiva.redback.policy.PasswordRuleViolationException;
 import org.apache.archiva.redback.policy.PasswordRuleViolations;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.codehaus.redback.integration.interceptor.SecureAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
index bc7476fa9afa1773fd433ba2f1852a76c991ccfa..1333aeff707f3cde9813aee8c21ae3ed78a1a3b2 100644 (file)
@@ -26,7 +26,7 @@ import org.apache.archiva.redback.rbac.Role;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.policy.PasswordRuleViolationException;
 import org.apache.archiva.redback.rbac.RbacManagerException;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.model.UserCredentials;
 import org.codehaus.redback.integration.security.role.RedbackRoleConstants;
index 73bd75a4ccabc33fe093263644ce3274e63639e5..8954eca706c0df96ffd141f6e052cce43a96b29e 100644 (file)
@@ -23,9 +23,9 @@ import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.policy.PasswordEncoder;
 import org.apache.archiva.redback.policy.PasswordRuleViolationException;
-import org.codehaus.plexus.redback.system.DefaultSecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.DefaultSecuritySession;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.apache.archiva.redback.users.UserManager;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
index 53014866d5daa4de47fa49dfb6bbc6c3f506c0fd..9bf8558cb5f585f0ea2419d0b8e5249d524bfa75 100644 (file)
@@ -33,8 +33,8 @@ import org.apache.archiva.redback.configuration.UserConfiguration;
 import org.apache.archiva.redback.keys.KeyManagerException;
 import org.apache.archiva.redback.keys.KeyNotFoundException;
 import org.apache.archiva.redback.policy.MustChangePasswordException;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
index 58cef9213bd7f4ddd67a9ed4072316c760687b57..3f7014cf85079bc345b26741a8bdd9fb4d36fac7 100644 (file)
@@ -23,8 +23,8 @@ import org.apache.archiva.redback.policy.PasswordEncoder;
 import org.apache.archiva.redback.policy.PasswordRuleViolations;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.policy.PasswordRuleViolationException;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
index 81515707b716496ae06afd6d1b14ef0f7859ac12..6cef8a840c95f7bd01f5baa9a9e20866ba1182ee 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.keys.AuthenticationKey;
 import org.apache.archiva.redback.keys.KeyManagerException;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.apache.archiva.redback.users.User;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
index a8c0d4d6c2c284745e0ffc33473b111e2925ed7e..534bf57c2d962d8d48f6a12002ccfde5a038c5ef 100644 (file)
@@ -32,7 +32,7 @@ import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationDataSource;
 import org.apache.archiva.redback.policy.AccountLockedException;
 import org.codehaus.plexus.redback.struts2.action.AuditEvent;
-import org.codehaus.plexus.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySession;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
index c5392e1e7d58043780f462684a38133a1c385770..a93208cc9433a51776798d47ffd71797bfd57404 100644 (file)
@@ -25,7 +25,7 @@ import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.commons.lang.StringUtils;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.codehaus.plexus.registry.Registry;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
index b848329b15085666561bee98c27eeeefb0cecf69..107e448e8393353e1dca3416ab0009d3ffe65ed2 100644 (file)
@@ -30,9 +30,9 @@ import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.apache.archiva.redback.rbac.Role;
 import org.codehaus.plexus.redback.struts2.action.AuditEvent;
 import org.codehaus.plexus.redback.struts2.action.CancellableAction;
-import org.codehaus.plexus.redback.system.DefaultSecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.DefaultSecuritySession;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.apache.archiva.redback.users.UserManager;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
index 388b57c3e02275656db5ebc6aaf7690e063d7241..873c070106b03b15723fce11ae4173eab59fa6fc 100644 (file)
@@ -29,7 +29,7 @@ import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.struts2.ServletActionContext;
 import org.apache.archiva.redback.rbac.RBACManager;
 import org.codehaus.plexus.redback.struts2.action.AbstractSecurityAction;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystem;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.archiva.redback.users.UserQuery;
 import org.codehaus.plexus.util.StringUtils;
index 61320fab3130fd19a495b5f0797bc093683fa0f2..ccb94e7f79f1d5887aa24602af68cabf61709a28 100644 (file)
@@ -22,7 +22,7 @@ package org.codehaus.plexus.redback.struts2.checks;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.codehaus.plexus.redback.system.check.EnvironmentCheck;
+import org.apache.archiva.redback.system.check.EnvironmentCheck;
 import org.codehaus.redback.integration.checks.xwork.XworkPackageConfig;
 
 import com.opensymphony.xwork2.config.Configuration;
index e8c98d2a3127ad2b472a537e2280f4bff2e644c3..400faab832dda16fb1439d9eaf42276b0413b1d5 100644 (file)
@@ -29,9 +29,9 @@ import org.apache.struts2.ServletActionContext;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.authentication.TokenBasedAuthenticationDataSource;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.codehaus.redback.integration.util.AutoLoginCookies;
 import org.slf4j.Logger;
index e2f6e742f8f749d670af9ad0a157ea19e6da804c..040a157dd1aaa358ac69956a095df308b3d5a473 100644 (file)
@@ -21,10 +21,9 @@ package org.codehaus.plexus.redback.struts2.interceptor;
 
 import com.opensymphony.xwork2.ActionInvocation;
 import com.opensymphony.xwork2.interceptor.Interceptor;
-import org.codehaus.plexus.redback.system.check.EnvironmentCheck;
+import org.apache.archiva.redback.system.check.EnvironmentCheck;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.springframework.context.ApplicationContext;
 import org.springframework.context.annotation.Scope;
 import org.springframework.stereotype.Controller;
 
index effacde8615cc87de82ab783629324ca56b8bacf..b26b7f37c947942f95c886da383c96f172687c7b 100644 (file)
@@ -29,9 +29,9 @@ import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationData
 import org.apache.archiva.redback.configuration.UserConfiguration;
 import org.apache.archiva.redback.role.RoleManager;
 import org.apache.archiva.redback.role.RoleManagerException;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.apache.archiva.redback.users.UserManager;
 import org.codehaus.redback.integration.checks.security.AdminAutoCreateCheck;
 import org.codehaus.redback.integration.util.AutoLoginCookies;
index 2f516b62c0ce1090a4c354dca3c53269088a8726..e3158d50ffbdb6e9f3fff2639e440c5961436f1f 100644 (file)
@@ -29,10 +29,10 @@ import org.apache.archiva.redback.configuration.UserConfiguration;
 import org.apache.archiva.redback.users.UserManager;
 import org.apache.struts2.ServletActionContext;
 import org.apache.archiva.redback.policy.UserSecurityPolicy;
-import org.codehaus.plexus.redback.system.DefaultSecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.DefaultSecuritySession;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.apache.archiva.redback.users.User;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 7fb6c6c828b14dcbc1035962baa6ea398e38c516..c72b88f360a173f2ffa4b43004e0757960960312 100644 (file)
@@ -27,9 +27,9 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.SystemUtils;
 import org.apache.struts2.ServletActionContext;
 import org.apache.archiva.redback.authorization.AuthorizationResult;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.codehaus.redback.integration.interceptor.SecureAction;
 import org.codehaus.redback.integration.interceptor.SecureActionBundle;
 import org.codehaus.redback.integration.interceptor.SecureActionException;
index 6aa2d54394195b74879304b346b759d60e993531..13b14056166c1c286c8bb70d6975b69cf9276cfc 100644 (file)
@@ -36,9 +36,9 @@ import org.apache.archiva.redback.authentication.AuthenticationDataSource;
 import org.apache.archiva.redback.authentication.AuthenticationException;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.policy.AccountLockedException;
-import org.codehaus.plexus.redback.system.DefaultSecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.DefaultSecuritySession;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
 
 import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.XWorkTestCase;
index 53dce55afc65e0b680641a3fab476a8f25750a16..4fd401d998a2f1091313409655df83bcb21e6c21 100644 (file)
@@ -32,9 +32,9 @@ import org.apache.archiva.redback.authentication.PasswordBasedAuthenticationData
 import org.apache.archiva.redback.rbac.RbacManagerException;
 import org.apache.archiva.redback.rbac.UserAssignment;
 import org.codehaus.plexus.redback.struts2.action.AbstractUserCredentialsAction;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystem;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystem;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.apache.archiva.redback.users.User;
 import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.users.memory.SimpleUser;
index ff8d8f930153b49d4c89e250f0c0ed327972a439..2c216446f0884b282ef7059e501e0d13a84109f1 100644 (file)
@@ -30,9 +30,9 @@ import org.apache.archiva.redback.users.UserNotFoundException;
 import org.apache.archiva.redback.authentication.AuthenticationResult;
 import org.apache.archiva.redback.policy.MustChangePasswordException;
 import org.apache.archiva.redback.rbac.RbacObjectNotFoundException;
-import org.codehaus.plexus.redback.system.DefaultSecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySession;
-import org.codehaus.plexus.redback.system.SecuritySystemConstants;
+import org.apache.archiva.redback.system.DefaultSecuritySession;
+import org.apache.archiva.redback.system.SecuritySession;
+import org.apache.archiva.redback.system.SecuritySystemConstants;
 import org.apache.archiva.redback.users.memory.SimpleUser;
 import org.codehaus.redback.integration.model.AdminEditUserCredentials;
 import org.junit.After;
diff --git a/redback-system/src/main/java/org/apache/archiva/redback/system/DefaultSecuritySession.java b/redback-system/src/main/java/org/apache/archiva/redback/system/DefaultSecuritySession.java
new file mode 100644 (file)
index 0000000..2fc40c2
--- /dev/null
@@ -0,0 +1,77 @@
+package org.apache.archiva.redback.system;
+
+/*
+ * 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.redback.users.User;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.springframework.stereotype.Service;
+
+import java.io.Serializable;
+
+/**
+ * @author Jason van Zyl
+ */
+@Service( "securitySession" )
+public class DefaultSecuritySession
+    implements SecuritySession, Serializable
+{
+    private AuthenticationResult authenticationResult;
+
+    private User user;
+
+    // TODO: ambiguity between this authenticated and authentication result's authenticated is dangerous
+    private boolean authenticated;
+
+    public DefaultSecuritySession()
+    {
+        this.authenticationResult = new AuthenticationResult();
+        this.user = null;
+        this.authenticated = false;
+    }
+
+    public DefaultSecuritySession( AuthenticationResult authResult )
+    {
+        this.authenticationResult = authResult;
+        this.user = null;
+        this.authenticated = false;
+    }
+
+    public DefaultSecuritySession( AuthenticationResult authenticationResult, User user )
+    {
+        this.authenticationResult = authenticationResult;
+        this.user = user;
+        this.authenticated = true;
+    }
+
+    public AuthenticationResult getAuthenticationResult()
+    {
+        return authenticationResult;
+    }
+
+    public User getUser()
+    {
+        return user;
+    }
+
+    public boolean isAuthenticated()
+    {
+        return ( ( user != null ) && authenticated );
+    }
+}
diff --git a/redback-system/src/main/java/org/apache/archiva/redback/system/DefaultSecuritySystem.java b/redback-system/src/main/java/org/apache/archiva/redback/system/DefaultSecuritySystem.java
new file mode 100644 (file)
index 0000000..269ce6d
--- /dev/null
@@ -0,0 +1,282 @@
+package org.apache.archiva.redback.system;
+
+/*
+ * 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.redback.keys.KeyManager;
+import org.apache.archiva.redback.policy.AccountLockedException;
+import org.apache.archiva.redback.policy.UserSecurityPolicy;
+import org.apache.archiva.redback.users.User;
+import org.apache.archiva.redback.users.UserManager;
+import org.apache.archiva.redback.users.UserNotFoundException;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationManager;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authorization.AuthorizationDataSource;
+import org.apache.archiva.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationResult;
+import org.apache.archiva.redback.authorization.Authorizer;
+import org.apache.archiva.redback.policy.MustChangePasswordException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+/**
+ * DefaultSecuritySystem:
+ *
+ * @author: Jesse McConnell <jesse@codehaus.org>
+ * @version: $Id$
+ */
+@Service( "securitySystem" )
+public class DefaultSecuritySystem
+    implements SecuritySystem
+{
+    private Logger log = LoggerFactory.getLogger( DefaultSecuritySystem.class );
+
+    @Inject
+    private AuthenticationManager authnManager;
+
+    @Inject
+    @Named( value = "authorizer#rbac" )
+    private Authorizer authorizer;
+
+    @Inject
+    @Named( value = "userManager#configurable" )
+    private UserManager userManager;
+
+    @Inject
+    @Named( value = "keyManager#cached" )
+    private KeyManager keyManager;
+
+    @Inject
+    private UserSecurityPolicy policy;
+
+    // ----------------------------------------------------------------------------
+    // Authentication: delegate to the authnManager
+    // ----------------------------------------------------------------------------
+
+    /**
+     * delegate to the authentication system for boolean authentication checks,
+     * if the result is authentic then pull the user object from the user
+     * manager and add it to the session.  If the result is false return the result in
+     * an authenticated session and a null user object.
+     * <p/>
+     * in the event of a successful authentication and a lack of corresponding user in the
+     * usermanager return a null user as well
+     * <p/>
+     * //todo should this last case create a user in the usermanager?
+     *
+     * @param source
+     * @return
+     * @throws AuthenticationException
+     * @throws UserNotFoundException
+     * @throws MustChangePasswordException
+     * @throws org.apache.archiva.redback.policy.AccountLockedException
+     * @throws MustChangePasswordException
+     */
+    public SecuritySession authenticate( AuthenticationDataSource source )
+        throws AuthenticationException, UserNotFoundException, AccountLockedException, MustChangePasswordException
+    {
+        // Perform Authentication.
+        AuthenticationResult result = authnManager.authenticate( source );
+
+        log.debug( "authnManager.authenticate() result: {}", result );
+
+        // Process Results.
+        if ( result.isAuthenticated() )
+        {
+            log.debug( "User '{}' authenticated.", result.getPrincipal());
+            User user = userManager.findUser( result.getPrincipal() );
+            if ( user != null )
+            {
+                log.debug( "User '{}' exists.", result.getPrincipal() );
+                log.debug( "User: {}", user );
+                return new DefaultSecuritySession( result, user );
+            }
+            else
+            {
+                log.debug( "User '{}' DOES NOT exist.", result.getPrincipal() );
+                return new DefaultSecuritySession( result );
+            }
+        }
+        else
+        {
+            log.debug( "User '{}' IS NOT authenticated.", result.getPrincipal() );
+            return new DefaultSecuritySession( result );
+        }
+    }
+
+    public boolean isAuthenticated( AuthenticationDataSource source )
+        throws AuthenticationException, UserNotFoundException, AccountLockedException, MustChangePasswordException
+    {
+        return authenticate( source ).getAuthenticationResult().isAuthenticated();
+    }
+
+    public String getAuthenticatorId()
+    {
+        if ( authnManager == null )
+        {
+            return "<null>";
+        }
+        return authnManager.getId();
+    }
+
+    // ----------------------------------------------------------------------------
+    // Authorization: delegate to the authorizer
+    // ----------------------------------------------------------------------------
+
+    public AuthorizationResult authorize( SecuritySession session, Object permission )
+        throws AuthorizationException
+    {
+        return authorize( session, permission, null );
+    }
+
+    public AuthorizationResult authorize( SecuritySession session, Object permission, Object resource )
+        throws AuthorizationException
+    {
+        AuthorizationDataSource source = null;
+
+        if ( session != null )
+        {
+            User user = session.getUser();
+            if ( user != null )
+            {
+                source = new AuthorizationDataSource( user.getPrincipal(), user, permission, resource );
+            }
+        }
+
+        if ( source == null )
+        {
+            source = new AuthorizationDataSource( null, null, permission, resource );
+        }
+
+        return authorizer.isAuthorized( source );
+    }
+
+    public boolean isAuthorized( SecuritySession session, Object permission )
+        throws AuthorizationException
+    {
+        return isAuthorized( session, permission, null );
+    }
+
+    public boolean isAuthorized( SecuritySession session, Object permission, Object resource )
+        throws AuthorizationException
+    {
+        return authorize( session, permission, resource ).isAuthorized();
+    }
+
+    public String getAuthorizerId()
+    {
+        if ( authorizer == null )
+        {
+            return "<null>";
+        }
+        return authorizer.getId();
+    }
+
+    // ----------------------------------------------------------------------------
+    // User Management: delegate to the user manager
+    // ----------------------------------------------------------------------------
+
+    public UserManager getUserManager()
+    {
+        return userManager;
+    }
+
+    public String getUserManagementId()
+    {
+        if ( userManager == null )
+        {
+            return "<null>";
+        }
+        return userManager.getId();
+    }
+
+    public KeyManager getKeyManager()
+    {
+        return keyManager;
+    }
+
+    public String getKeyManagementId()
+    {
+        if ( keyManager == null )
+        {
+            return "<null>";
+        }
+        return keyManager.getId();
+    }
+
+    public UserSecurityPolicy getPolicy()
+    {
+        return policy;
+    }
+
+    public String getPolicyId()
+    {
+        if ( policy == null )
+        {
+            return "<null>";
+        }
+        return policy.getId();
+    }
+
+    public AuthenticationManager getAuthenticationManager()
+    {
+        return authnManager;
+    }
+
+    public Authorizer getAuthorizer()
+    {
+        return authorizer;
+    }
+
+    public AuthenticationManager getAuthnManager()
+    {
+        return authnManager;
+    }
+
+    public void setAuthnManager( AuthenticationManager authnManager )
+    {
+        this.authnManager = authnManager;
+    }
+
+    public void setAuthorizer( Authorizer authorizer )
+    {
+        this.authorizer = authorizer;
+    }
+
+    public void setUserManager( UserManager userManager )
+    {
+        this.userManager = userManager;
+    }
+
+    public void setKeyManager( KeyManager keyManager )
+    {
+        this.keyManager = keyManager;
+    }
+
+    public void setPolicy( UserSecurityPolicy policy )
+    {
+        this.policy = policy;
+    }
+}
diff --git a/redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySession.java b/redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySession.java
new file mode 100644 (file)
index 0000000..24a58e9
--- /dev/null
@@ -0,0 +1,43 @@
+package org.apache.archiva.redback.system;
+
+/*
+ * 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.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.users.User;
+
+import java.io.Serializable;
+
+/**
+ * @author Jason van Zyl
+ */
+public interface SecuritySession
+    extends Serializable
+{
+
+    static final String SESSION_KEY = SecuritySession.class.getName();
+
+    static final String USERKEY = "SecuritySessionUser";
+
+    AuthenticationResult getAuthenticationResult();
+
+    User getUser();
+
+    boolean isAuthenticated();
+}
diff --git a/redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySystem.java b/redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySystem.java
new file mode 100644 (file)
index 0000000..9a2c269
--- /dev/null
@@ -0,0 +1,99 @@
+package org.apache.archiva.redback.system;
+
+/*
+ * 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.redback.policy.AccountLockedException;
+import org.apache.archiva.redback.policy.MustChangePasswordException;
+import org.apache.archiva.redback.policy.UserSecurityPolicy;
+import org.apache.archiva.redback.users.UserNotFoundException;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
+import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.AuthorizationResult;
+import org.apache.archiva.redback.keys.KeyManager;
+import org.apache.archiva.redback.users.UserManager;
+
+/**
+ * SecuritySystem:
+ *
+ * @author: Jesse McConnell <jesse@codehaus.org>
+ * @version: $ID:$
+ *
+ */
+public interface SecuritySystem
+{
+
+    // ----------------------------------------------------------------------------
+    // Authentication
+    // ----------------------------------------------------------------------------
+
+    SecuritySession authenticate( AuthenticationDataSource source )
+        throws AuthenticationException, UserNotFoundException, AccountLockedException, MustChangePasswordException;
+
+    boolean isAuthenticated( AuthenticationDataSource source )
+        throws AuthenticationException, UserNotFoundException, AccountLockedException, MustChangePasswordException;
+
+    // ----------------------------------------------------------------------------
+    // Authorization
+    // ----------------------------------------------------------------------------
+
+    AuthorizationResult authorize( SecuritySession session, Object permission )
+        throws AuthorizationException;
+
+    boolean isAuthorized( SecuritySession session, Object permission )
+        throws AuthorizationException;
+
+    /**
+     * return AuthorizationResult without changing authorization
+     * @param session
+     * @param permission
+     * @param resource
+     * @return
+     * @throws AuthorizationException
+     */
+    AuthorizationResult authorize( SecuritySession session, Object permission, Object resource )
+        throws AuthorizationException;
+
+    boolean isAuthorized( SecuritySession session, Object permission, Object resource )
+        throws AuthorizationException;
+
+    // ----------------------------------------------------------------------------
+    // User Management
+    // ----------------------------------------------------------------------------
+
+    UserManager getUserManager();
+    
+    // ----------------------------------------------------------------------------
+    // Key Management
+    // ----------------------------------------------------------------------------
+    
+    KeyManager getKeyManager();
+
+    // ----------------------------------------------------------------------------
+    // Policy Management
+    // ----------------------------------------------------------------------------
+    
+    UserSecurityPolicy getPolicy();
+
+    String getUserManagementId();
+    String getAuthenticatorId();
+    String getAuthorizerId();
+}
+
diff --git a/redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySystemConstants.java b/redback-system/src/main/java/org/apache/archiva/redback/system/SecuritySystemConstants.java
new file mode 100644 (file)
index 0000000..ca8bfd4
--- /dev/null
@@ -0,0 +1,39 @@
+package org.apache.archiva.redback.system;
+
+/*
+ * 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.
+ */
+
+/**
+ * SecuritySystemConstants - constants for use with contexts that use plexus-security. 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class SecuritySystemConstants
+{
+    /**
+     * Key in the sessionScope for the {@link SecuritySession} object. 
+     */
+    public static final String SECURITY_SESSION_KEY = "securitySession";
+
+    private SecuritySystemConstants()
+    {
+        // no op
+    }
+}
diff --git a/redback-system/src/main/java/org/apache/archiva/redback/system/check/EnvironmentCheck.java b/redback-system/src/main/java/org/apache/archiva/redback/system/check/EnvironmentCheck.java
new file mode 100644 (file)
index 0000000..b8872aa
--- /dev/null
@@ -0,0 +1,39 @@
+package org.apache.archiva.redback.system.check;
+
+/*
+ * 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;
+
+/**
+ * EnvironmentCheck - Perform an Environment Check.
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public interface EnvironmentCheck
+{
+
+    /**
+     * Validate the environment.
+     *
+     * @param violations list to populate with environment violations.
+     */
+    void validateEnvironment( List<String> violations );
+}
diff --git a/redback-system/src/main/java/org/codehaus/plexus/redback/system/DefaultSecuritySession.java b/redback-system/src/main/java/org/codehaus/plexus/redback/system/DefaultSecuritySession.java
deleted file mode 100644 (file)
index 1f6257d..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.codehaus.plexus.redback.system;
-
-/*
- * 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.redback.users.User;
-import org.apache.archiva.redback.authentication.AuthenticationResult;
-import org.springframework.stereotype.Service;
-
-import java.io.Serializable;
-
-/**
- * @author Jason van Zyl
- */
-@Service( "securitySession" )
-public class DefaultSecuritySession
-    implements SecuritySession, Serializable
-{
-    private AuthenticationResult authenticationResult;
-
-    private User user;
-
-    // TODO: ambiguity between this authenticated and authentication result's authenticated is dangerous
-    private boolean authenticated;
-
-    public DefaultSecuritySession()
-    {
-        this.authenticationResult = new AuthenticationResult();
-        this.user = null;
-        this.authenticated = false;
-    }
-
-    public DefaultSecuritySession( AuthenticationResult authResult )
-    {
-        this.authenticationResult = authResult;
-        this.user = null;
-        this.authenticated = false;
-    }
-
-    public DefaultSecuritySession( AuthenticationResult authenticationResult, User user )
-    {
-        this.authenticationResult = authenticationResult;
-        this.user = user;
-        this.authenticated = true;
-    }
-
-    public AuthenticationResult getAuthenticationResult()
-    {
-        return authenticationResult;
-    }
-
-    public User getUser()
-    {
-        return user;
-    }
-
-    public boolean isAuthenticated()
-    {
-        return ( ( user != null ) && authenticated );
-    }
-}
diff --git a/redback-system/src/main/java/org/codehaus/plexus/redback/system/DefaultSecuritySystem.java b/redback-system/src/main/java/org/codehaus/plexus/redback/system/DefaultSecuritySystem.java
deleted file mode 100644 (file)
index 1299f65..0000000
+++ /dev/null
@@ -1,282 +0,0 @@
-package org.codehaus.plexus.redback.system;
-
-/*
- * 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.redback.keys.KeyManager;
-import org.apache.archiva.redback.policy.AccountLockedException;
-import org.apache.archiva.redback.policy.UserSecurityPolicy;
-import org.apache.archiva.redback.users.User;
-import org.apache.archiva.redback.users.UserManager;
-import org.apache.archiva.redback.users.UserNotFoundException;
-import org.apache.archiva.redback.authentication.AuthenticationDataSource;
-import org.apache.archiva.redback.authentication.AuthenticationException;
-import org.apache.archiva.redback.authentication.AuthenticationManager;
-import org.apache.archiva.redback.authentication.AuthenticationResult;
-import org.apache.archiva.redback.authorization.AuthorizationDataSource;
-import org.apache.archiva.redback.authorization.AuthorizationException;
-import org.apache.archiva.redback.authorization.AuthorizationResult;
-import org.apache.archiva.redback.authorization.Authorizer;
-import org.apache.archiva.redback.policy.MustChangePasswordException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Service;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-
-/**
- * DefaultSecuritySystem:
- *
- * @author: Jesse McConnell <jesse@codehaus.org>
- * @version: $Id$
- */
-@Service( "securitySystem" )
-public class DefaultSecuritySystem
-    implements SecuritySystem
-{
-    private Logger log = LoggerFactory.getLogger( DefaultSecuritySystem.class );
-
-    @Inject
-    private AuthenticationManager authnManager;
-
-    @Inject
-    @Named( value = "authorizer#rbac" )
-    private Authorizer authorizer;
-
-    @Inject
-    @Named( value = "userManager#configurable" )
-    private UserManager userManager;
-
-    @Inject
-    @Named( value = "keyManager#cached" )
-    private KeyManager keyManager;
-
-    @Inject
-    private UserSecurityPolicy policy;
-
-    // ----------------------------------------------------------------------------
-    // Authentication: delegate to the authnManager
-    // ----------------------------------------------------------------------------
-
-    /**
-     * delegate to the authentication system for boolean authentication checks,
-     * if the result is authentic then pull the user object from the user
-     * manager and add it to the session.  If the result is false return the result in
-     * an authenticated session and a null user object.
-     * <p/>
-     * in the event of a successful authentication and a lack of corresponding user in the
-     * usermanager return a null user as well
-     * <p/>
-     * //todo should this last case create a user in the usermanager?
-     *
-     * @param source
-     * @return
-     * @throws AuthenticationException
-     * @throws UserNotFoundException
-     * @throws MustChangePasswordException
-     * @throws org.apache.archiva.redback.policy.AccountLockedException
-     * @throws MustChangePasswordException
-     */
-    public SecuritySession authenticate( AuthenticationDataSource source )
-        throws AuthenticationException, UserNotFoundException, AccountLockedException, MustChangePasswordException
-    {
-        // Perform Authentication.
-        AuthenticationResult result = authnManager.authenticate( source );
-
-        log.debug( "authnManager.authenticate() result: {}", result );
-
-        // Process Results.
-        if ( result.isAuthenticated() )
-        {
-            log.debug( "User '{}' authenticated.", result.getPrincipal());
-            User user = userManager.findUser( result.getPrincipal() );
-            if ( user != null )
-            {
-                log.debug( "User '{}' exists.", result.getPrincipal() );
-                log.debug( "User: {}", user );
-                return new DefaultSecuritySession( result, user );
-            }
-            else
-            {
-                log.debug( "User '{}' DOES NOT exist.", result.getPrincipal() );
-                return new DefaultSecuritySession( result );
-            }
-        }
-        else
-        {
-            log.debug( "User '{}' IS NOT authenticated.", result.getPrincipal() );
-            return new DefaultSecuritySession( result );
-        }
-    }
-
-    public boolean isAuthenticated( AuthenticationDataSource source )
-        throws AuthenticationException, UserNotFoundException, AccountLockedException, MustChangePasswordException
-    {
-        return authenticate( source ).getAuthenticationResult().isAuthenticated();
-    }
-
-    public String getAuthenticatorId()
-    {
-        if ( authnManager == null )
-        {
-            return "<null>";
-        }
-        return authnManager.getId();
-    }
-
-    // ----------------------------------------------------------------------------
-    // Authorization: delegate to the authorizer
-    // ----------------------------------------------------------------------------
-
-    public AuthorizationResult authorize( SecuritySession session, Object permission )
-        throws AuthorizationException
-    {
-        return authorize( session, permission, null );
-    }
-
-    public AuthorizationResult authorize( SecuritySession session, Object permission, Object resource )
-        throws AuthorizationException
-    {
-        AuthorizationDataSource source = null;
-
-        if ( session != null )
-        {
-            User user = session.getUser();
-            if ( user != null )
-            {
-                source = new AuthorizationDataSource( user.getPrincipal(), user, permission, resource );
-            }
-        }
-
-        if ( source == null )
-        {
-            source = new AuthorizationDataSource( null, null, permission, resource );
-        }
-
-        return authorizer.isAuthorized( source );
-    }
-
-    public boolean isAuthorized( SecuritySession session, Object permission )
-        throws AuthorizationException
-    {
-        return isAuthorized( session, permission, null );
-    }
-
-    public boolean isAuthorized( SecuritySession session, Object permission, Object resource )
-        throws AuthorizationException
-    {
-        return authorize( session, permission, resource ).isAuthorized();
-    }
-
-    public String getAuthorizerId()
-    {
-        if ( authorizer == null )
-        {
-            return "<null>";
-        }
-        return authorizer.getId();
-    }
-
-    // ----------------------------------------------------------------------------
-    // User Management: delegate to the user manager
-    // ----------------------------------------------------------------------------
-
-    public UserManager getUserManager()
-    {
-        return userManager;
-    }
-
-    public String getUserManagementId()
-    {
-        if ( userManager == null )
-        {
-            return "<null>";
-        }
-        return userManager.getId();
-    }
-
-    public KeyManager getKeyManager()
-    {
-        return keyManager;
-    }
-
-    public String getKeyManagementId()
-    {
-        if ( keyManager == null )
-        {
-            return "<null>";
-        }
-        return keyManager.getId();
-    }
-
-    public UserSecurityPolicy getPolicy()
-    {
-        return policy;
-    }
-
-    public String getPolicyId()
-    {
-        if ( policy == null )
-        {
-            return "<null>";
-        }
-        return policy.getId();
-    }
-
-    public AuthenticationManager getAuthenticationManager()
-    {
-        return authnManager;
-    }
-
-    public Authorizer getAuthorizer()
-    {
-        return authorizer;
-    }
-
-    public AuthenticationManager getAuthnManager()
-    {
-        return authnManager;
-    }
-
-    public void setAuthnManager( AuthenticationManager authnManager )
-    {
-        this.authnManager = authnManager;
-    }
-
-    public void setAuthorizer( Authorizer authorizer )
-    {
-        this.authorizer = authorizer;
-    }
-
-    public void setUserManager( UserManager userManager )
-    {
-        this.userManager = userManager;
-    }
-
-    public void setKeyManager( KeyManager keyManager )
-    {
-        this.keyManager = keyManager;
-    }
-
-    public void setPolicy( UserSecurityPolicy policy )
-    {
-        this.policy = policy;
-    }
-}
diff --git a/redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySession.java b/redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySession.java
deleted file mode 100644 (file)
index 8ac071a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.codehaus.plexus.redback.system;
-
-/*
- * 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.redback.authentication.AuthenticationResult;
-import org.apache.archiva.redback.users.User;
-
-import java.io.Serializable;
-
-/**
- * @author Jason van Zyl
- */
-public interface SecuritySession
-    extends Serializable
-{
-
-    static final String SESSION_KEY = SecuritySession.class.getName();
-
-    static final String USERKEY = "SecuritySessionUser";
-
-    AuthenticationResult getAuthenticationResult();
-
-    User getUser();
-
-    boolean isAuthenticated();
-}
diff --git a/redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySystem.java b/redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySystem.java
deleted file mode 100644 (file)
index 86ad563..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-package org.codehaus.plexus.redback.system;
-
-/*
- * 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.redback.policy.AccountLockedException;
-import org.apache.archiva.redback.policy.MustChangePasswordException;
-import org.apache.archiva.redback.policy.UserSecurityPolicy;
-import org.apache.archiva.redback.users.UserNotFoundException;
-import org.apache.archiva.redback.authentication.AuthenticationDataSource;
-import org.apache.archiva.redback.authentication.AuthenticationException;
-import org.apache.archiva.redback.authorization.AuthorizationException;
-import org.apache.archiva.redback.authorization.AuthorizationResult;
-import org.apache.archiva.redback.keys.KeyManager;
-import org.apache.archiva.redback.users.UserManager;
-
-/**
- * SecuritySystem:
- *
- * @author: Jesse McConnell <jesse@codehaus.org>
- * @version: $ID:$
- *
- */
-public interface SecuritySystem
-{
-
-    // ----------------------------------------------------------------------------
-    // Authentication
-    // ----------------------------------------------------------------------------
-
-    SecuritySession authenticate( AuthenticationDataSource source )
-        throws AuthenticationException, UserNotFoundException, AccountLockedException, MustChangePasswordException;
-
-    boolean isAuthenticated( AuthenticationDataSource source )
-        throws AuthenticationException, UserNotFoundException, AccountLockedException, MustChangePasswordException;
-
-    // ----------------------------------------------------------------------------
-    // Authorization
-    // ----------------------------------------------------------------------------
-
-    AuthorizationResult authorize( SecuritySession session, Object permission )
-        throws AuthorizationException;
-
-    boolean isAuthorized( SecuritySession session, Object permission )
-        throws AuthorizationException;
-
-    /**
-     * return AuthorizationResult without changing authorization
-     * @param session
-     * @param permission
-     * @param resource
-     * @return
-     * @throws AuthorizationException
-     */
-    AuthorizationResult authorize( SecuritySession session, Object permission, Object resource )
-        throws AuthorizationException;
-
-    boolean isAuthorized( SecuritySession session, Object permission, Object resource )
-        throws AuthorizationException;
-
-    // ----------------------------------------------------------------------------
-    // User Management
-    // ----------------------------------------------------------------------------
-
-    UserManager getUserManager();
-    
-    // ----------------------------------------------------------------------------
-    // Key Management
-    // ----------------------------------------------------------------------------
-    
-    KeyManager getKeyManager();
-
-    // ----------------------------------------------------------------------------
-    // Policy Management
-    // ----------------------------------------------------------------------------
-    
-    UserSecurityPolicy getPolicy();
-
-    String getUserManagementId();
-    String getAuthenticatorId();
-    String getAuthorizerId();
-}
-
diff --git a/redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySystemConstants.java b/redback-system/src/main/java/org/codehaus/plexus/redback/system/SecuritySystemConstants.java
deleted file mode 100644 (file)
index fc169df..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.codehaus.plexus.redback.system;
-
-/*
- * 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.
- */
-
-/**
- * SecuritySystemConstants - constants for use with contexts that use plexus-security. 
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public class SecuritySystemConstants
-{
-    /**
-     * Key in the sessionScope for the {@link SecuritySession} object. 
-     */
-    public static final String SECURITY_SESSION_KEY = "securitySession";
-
-    private SecuritySystemConstants()
-    {
-        // no op
-    }
-}
diff --git a/redback-system/src/main/java/org/codehaus/plexus/redback/system/check/EnvironmentCheck.java b/redback-system/src/main/java/org/codehaus/plexus/redback/system/check/EnvironmentCheck.java
deleted file mode 100644 (file)
index aca3c60..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.codehaus.plexus.redback.system.check;
-
-/*
- * 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;
-
-/**
- * EnvironmentCheck - Perform an Environment Check.
- *
- * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
- * @version $Id$
- */
-public interface EnvironmentCheck
-{
-
-    /**
-     * Validate the environment.
-     *
-     * @param violations list to populate with environment violations.
-     */
-    void validateEnvironment( List<String> violations );
-}
index 44f80402ad98343608bafa63ffd30f7276c4ee45..46746c37dcbd17055bfa390746ae58dabf48e6c9 100644 (file)
@@ -28,6 +28,6 @@
        default-lazy-init="true">
 
   <context:annotation-config />
-  <context:component-scan base-package="org.codehaus.plexus.redback.system"/>
+  <context:component-scan base-package="org.apache.archiva.redback.system"/>
  
 </beans>
\ No newline at end of file
diff --git a/redback-system/src/test/java/org/apache/archiva/redback/system/DefaultSecureApplication.java b/redback-system/src/test/java/org/apache/archiva/redback/system/DefaultSecureApplication.java
new file mode 100644 (file)
index 0000000..668d0b8
--- /dev/null
@@ -0,0 +1,28 @@
+package org.apache.archiva.redback.system;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author Jason van Zyl
+ */
+public class DefaultSecureApplication
+    implements SecureApplication
+{
+}
diff --git a/redback-system/src/test/java/org/apache/archiva/redback/system/SecureApplication.java b/redback-system/src/test/java/org/apache/archiva/redback/system/SecureApplication.java
new file mode 100644 (file)
index 0000000..fb796d6
--- /dev/null
@@ -0,0 +1,28 @@
+package org.apache.archiva.redback.system;
+
+/*
+ * 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.
+ */
+
+/**
+ * @author Jason van Zyl
+ */
+public interface SecureApplication
+{
+    String ROLE = SecureApplication.class.getName();
+}
diff --git a/redback-system/src/test/java/org/apache/archiva/redback/system/TestAuthenticationManager.java b/redback-system/src/test/java/org/apache/archiva/redback/system/TestAuthenticationManager.java
new file mode 100644 (file)
index 0000000..78d9b92
--- /dev/null
@@ -0,0 +1,54 @@
+package org.apache.archiva.redback.system;
+
+/*
+ * 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 junit.framework.TestCase;
+import org.apache.archiva.redback.authentication.AuthenticationManager;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.test.context.ContextConfiguration;
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+
+import javax.inject.Inject;
+
+
+/**
+ * TestAuthenticationManager:
+ *
+ * @author: Jesse McConnell <jesse@codehaus.org>
+ * @version: $ID:$
+ */
+@RunWith( SpringJUnit4ClassRunner.class )
+@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
+public class TestAuthenticationManager
+    extends TestCase
+{
+
+    @Inject
+    AuthenticationManager authManager;
+
+    @Test
+    public void testAuthenticatorPopulation()
+        throws Exception
+    {
+        assertEquals( 1, authManager.getAuthenticators().size() );
+    }
+
+}
diff --git a/redback-system/src/test/java/org/codehaus/plexus/redback/system/DefaultSecureApplication.java b/redback-system/src/test/java/org/codehaus/plexus/redback/system/DefaultSecureApplication.java
deleted file mode 100644 (file)
index 33f85d8..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.codehaus.plexus.redback.system;
-
-/*
- * 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.
- */
-
-/**
- * @author Jason van Zyl
- */
-public class DefaultSecureApplication
-    implements SecureApplication
-{
-}
diff --git a/redback-system/src/test/java/org/codehaus/plexus/redback/system/SecureApplication.java b/redback-system/src/test/java/org/codehaus/plexus/redback/system/SecureApplication.java
deleted file mode 100644 (file)
index 89f38ea..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.codehaus.plexus.redback.system;
-
-/*
- * 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.
- */
-
-/**
- * @author Jason van Zyl
- */
-public interface SecureApplication
-{
-    String ROLE = SecureApplication.class.getName();
-}
diff --git a/redback-system/src/test/java/org/codehaus/plexus/redback/system/TestAuthenticationManager.java b/redback-system/src/test/java/org/codehaus/plexus/redback/system/TestAuthenticationManager.java
deleted file mode 100644 (file)
index 73a3d8f..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.codehaus.plexus.redback.system;
-
-/*
- * 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 junit.framework.TestCase;
-import org.apache.archiva.redback.authentication.AuthenticationManager;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-import javax.inject.Inject;
-
-
-/**
- * TestAuthenticationManager:
- *
- * @author: Jesse McConnell <jesse@codehaus.org>
- * @version: $ID:$
- */
-@RunWith( SpringJUnit4ClassRunner.class )
-@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } )
-public class TestAuthenticationManager
-    extends TestCase
-{
-
-    @Inject
-    AuthenticationManager authManager;
-
-    @Test
-    public void testAuthenticatorPopulation()
-        throws Exception
-    {
-        assertEquals( 1, authManager.getAuthenticators().size() );
-    }
-
-}
index ba46dc01b47c3fac060ae0b1d3a08114fd71513c..9c6d7f55d997a35c6e756e859c3ec6f82c2ba4b5 100644 (file)
   -->
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
-           http://www.springframework.org/schema/context 
-           http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
 
   <bean name="jdoFactory#users" class="org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory">
     <property name="driverName" value="org.hsqldb.jdbcDriver"/>