aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java11
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaAuthorizer.java10
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/pom.xml37
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml3
-rw-r--r--archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/log4j2-test.xml2
-rw-r--r--pom.xml11
6 files changed, 71 insertions, 3 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
index b81d65c83..1951f7ad7 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/AbstractRestService.java
@@ -30,6 +30,8 @@ import org.apache.archiva.maven2.model.Artifact;
import org.apache.archiva.metadata.model.ArtifactMetadata;
import org.apache.archiva.metadata.repository.RepositorySessionFactory;
import org.apache.archiva.redback.components.taskqueue.TaskQueueException;
+import org.apache.archiva.redback.configuration.UserConfiguration;
+import org.apache.archiva.redback.configuration.UserConfigurationKeys;
import org.apache.archiva.redback.rest.services.RedbackAuthenticationThreadLocal;
import org.apache.archiva.redback.rest.services.RedbackRequestInformation;
import org.apache.archiva.redback.users.User;
@@ -95,6 +97,11 @@ public abstract class AbstractRestService
@Named(value = "archivaTaskScheduler#repository")
protected DefaultRepositoryArchivaTaskScheduler repositoryTaskScheduler;
+
+ @Inject
+ @Named( value = "userConfiguration#default" )
+ protected UserConfiguration config;
+
@Context
protected HttpServletRequest httpServletRequest;
@@ -143,9 +150,9 @@ public abstract class AbstractRestService
RedbackRequestInformation redbackRequestInformation = RedbackAuthenticationThreadLocal.get();
return redbackRequestInformation == null
- ? UserManager.GUEST_USERNAME
+ ? config.getString( UserConfigurationKeys.DEFAULT_GUEST )
: ( redbackRequestInformation.getUser() == null
- ? UserManager.GUEST_USERNAME
+ ? config.getString( UserConfigurationKeys.DEFAULT_GUEST )
: redbackRequestInformation.getUser().getUsername() );
}
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaAuthorizer.java b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaAuthorizer.java
index 3ea5acd94..d5f6c9eed 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaAuthorizer.java
+++ b/archiva-modules/archiva-web/archiva-web-common/src/main/java/org/apache/archiva/web/security/ArchivaAuthorizer.java
@@ -43,6 +43,11 @@ public class ArchivaAuthorizer
@Named( value = "authorizer#rbac" )
private Authorizer rbacAuthorizer;
+
+ @Inject
+ @Named( value = "authorizer#ldap" )
+ private Authorizer ldapAuthorizer;
+
public String getId()
{
return "archiva";
@@ -52,6 +57,11 @@ public class ArchivaAuthorizer
throws AuthorizationException
{
log.debug( "isAuthorized source: {}", source );
+
+ AuthorizationResult result = ldapAuthorizer.isAuthorized( source );
+
+
+
return rbacAuthorizer.isAuthorized( source );
}
diff --git a/archiva-modules/archiva-web/archiva-webapp/pom.xml b/archiva-modules/archiva-web/archiva-webapp/pom.xml
index 6344b9c51..9cea0581e 100644
--- a/archiva-modules/archiva-web/archiva-webapp/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webapp/pom.xml
@@ -463,6 +463,33 @@
</dependency>
<dependency>
+ <groupId>org.apache.archiva.redback.components.registry</groupId>
+ <artifactId>spring-registry-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.redback.components.registry</groupId>
+ <artifactId>spring-registry-commons</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>ant</groupId>
+ <artifactId>ant-optional</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>jdom</groupId>
+ <artifactId>jdom</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.archiva</groupId>
<artifactId>archiva-rest-api</artifactId>
<exclusions>
@@ -644,6 +671,16 @@
<artifactId>redback-integrations-security</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.archiva.redback</groupId>
+ <artifactId>redback-authorization-ldap</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<scope>provided</scope>
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
index b55090452..23d2b58ac 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
@@ -56,7 +56,8 @@
</bean>
<!-- START SNIPPET: configuration-files-list -->
- <bean name="commons-configuration" class="org.apache.archiva.redback.components.registry.commons.CommonsConfigurationRegistry">
+ <bean name="commons-configuration" class="org.apache.archiva.redback.components.registry.commons.CommonsConfigurationRegistry"
+ init-method="initialize">
<property name="properties">
<value>
<![CDATA[
diff --git a/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/log4j2-test.xml b/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/log4j2-test.xml
index aa94a6cac..9986ad7d3 100644
--- a/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/log4j2-test.xml
+++ b/archiva-modules/archiva-web/archiva-webapp/src/test/tomcat/log4j2-test.xml
@@ -85,6 +85,8 @@
<logger name="org.apache.archiva.web.security.ArchivaAuthorizer" level="debug"/>
+ <logger name="org.apache.archiva.redback.components.registry.commons.CommonsConfigurationRegistry" level="debug"/>
+
<root level="info">
<appender-ref ref="console"/>
</root>
diff --git a/pom.xml b/pom.xml
index 9c6a9d264..b0da17108 100644
--- a/pom.xml
+++ b/pom.xml
@@ -929,6 +929,17 @@
</dependency>
<dependency>
<groupId>org.apache.archiva.redback</groupId>
+ <artifactId>redback-authorization-ldap</artifactId>
+ <version>${redback.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.archiva.redback</groupId>
<artifactId>redback-users-memory</artifactId>
<version>${redback.version}</version>
<scope>test</scope>