From b034cff6b53b129ef9ac1cd474e0f8698315de59 Mon Sep 17 00:00:00 2001 From: Martin Stockhammer Date: Fri, 24 Jan 2020 21:52:07 +0100 Subject: [PATCH] Adapting configuration to redback changes --- .../resources/META-INF/spring-context.xml | 24 +++++-------------- .../services/RepositoriesServiceTest.java | 7 +++++- .../src/test/resources/log4j2-test.xml | 14 +++++++---- .../resources/META-INF/spring-context.xml | 13 ++++------ .../apache/archiva/i18n/default.properties | 1 + 5 files changed, 27 insertions(+), 32 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml index a92327309..3373b12dc 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/resources/META-INF/spring-context.xml @@ -37,26 +37,22 @@ + base-package="org.apache.archiva.rest.services,org.apache.archiva.redback.rest.services"/> - - - - - - - + - + + + @@ -67,7 +63,6 @@ - @@ -77,13 +72,6 @@ - - - - - - - - \ No newline at end of file + diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java index 482e26d6d..99a868822 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoriesServiceTest.java @@ -21,6 +21,8 @@ package org.apache.archiva.rest.services; import org.apache.archiva.admin.model.beans.ManagedRepository; import org.apache.archiva.maven2.model.Artifact; +import org.apache.archiva.redback.rest.api.services.RedbackServiceException; +import org.apache.archiva.redback.rest.api.services.UserService; import org.apache.archiva.rest.api.model.BrowseResult; import org.apache.archiva.rest.api.model.BrowseResultEntry; import org.apache.archiva.rest.api.model.VersionsList; @@ -402,11 +404,14 @@ public class RepositoriesServiceTest public void notAuthorizedToDeleteArtifacts() throws Exception { + UserService userService = getUserService( getAdminAuthzHeader() ); + userService.createGuestUser( ); + ManagedRepository managedRepository = getTestManagedRepository( "SOURCE_REPO_ID", "SOURCE_REPO_ID" ); try { getManagedRepositoriesService( authorizationHeader ).addManagedRepository( managedRepository ); - RepositoriesService repositoriesService = getRepositoriesService( guestAuthzHeader ); + RepositoriesService repositoriesService = getRepositoriesService( ); assertFalse( repositoriesService.isAuthorizedToDeleteArtifacts( managedRepository.getId() ) ); } finally diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml index 9e1508240..11a7b9022 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml @@ -22,7 +22,7 @@ - + - + + + + + + + - + - + diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml index 1a981c78c..168363607 100755 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/META-INF/spring-context.xml @@ -34,10 +34,11 @@ default-lazy-init="true"> - + + @@ -45,6 +46,7 @@ + @@ -54,13 +56,6 @@ - - - - - - - - \ No newline at end of file + diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties index a2c8e0c38..d22872b31 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties +++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties @@ -682,6 +682,7 @@ redback.runtime.users.cache.title=Users Cache ldap.config.dn.help.content=The name of the attribute containing the DN ldap.config.user.attribute.help.content=The name of the RDN attribute in the DN of the user object containing the User-ID (e.g. for cn=usr1,ou=users,ou=tst,ou=org, the value would be cn) +ldap.config.groups.name.attribute.help.content=The name of the attribute of a group object that contains the name of the group. redback.default.role.guest.id.help.content=The User-ID of the guest user rest.baseUrl.help.content=URL that is used as base url for validating REST requests. If empty, the URL ist determined automatically. rest.csrffilter.absentorigin.deny.help.content=If true and no Origin/Referer header can be found on REST requests, the requests will be denied. Default: true. -- 2.39.5