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;
@Named(value = "archivaTaskScheduler#repository")
protected DefaultRepositoryArchivaTaskScheduler repositoryTaskScheduler;
+
+ @Inject
+ @Named( value = "userConfiguration#default" )
+ protected UserConfiguration config;
+
@Context
protected HttpServletRequest httpServletRequest;
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() );
}
@Named( value = "authorizer#rbac" )
private Authorizer rbacAuthorizer;
+
+ @Inject
+ @Named( value = "authorizer#ldap" )
+ private Authorizer ldapAuthorizer;
+
public String getId()
{
return "archiva";
throws AuthorizationException
{
log.debug( "isAuthorized source: {}", source );
+
+ AuthorizationResult result = ldapAuthorizer.isAuthorized( source );
+
+
+
return rbacAuthorizer.isAuthorized( source );
}
</exclusions>
</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>
<groupId>org.apache.archiva.redback</groupId>
<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>
</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[
<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>
</exclusion>
</exclusions>
</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>