You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:48:28 UTC

[sling-org-apache-sling-jcr-davex] annotated tag org.apache.sling.jcr.davex-1.3.6 created (now 275a6cc)

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a change to annotated tag org.apache.sling.jcr.davex-1.3.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-davex.git.


      at 275a6cc  (tag)
 tagging b491cc18e5ed90197aea2f1107487c5d867c174b (commit)
      by Robert Munteanu
      on Wed Jan 25 16:38:17 2017 +0000

- Log -----------------------------------------------------------------
org.apache.sling.jcr.davex-1.3.6
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new dc39078  SLING-1393 - adding davex module and test content loading support
     new 09416ef  Ignore target dir
     new b947e56  Use released parent pom.
     new ba66dc4  SLING-1531 - upgrading to jackrabbit 2.1
     new 778af99  ignore eclipse project files
     new 2faa22f  SLING-1660 - upgrading to JR 2.1.1
     new e03b2f9  updating all modules to parent 10-SNAPSHOT in anticipation of emma additions to parent
     new c284921  updating pom files pre-release
     new 56b684f  [maven-release-plugin] prepare release org.apache.sling.jcr.davex-1.0.0
     new 1336d16  [maven-release-plugin] prepare for next development iteration
     new a5fc06d  using latest parent
     new c3ef594  SLING-1869 - upgrading to latest SCR plugin and putting scr.annotations in parent
     new 57cbb57  Update to recent snapshots
     new f15090f  Use latest releases.
     new 58c03f6  SLING-2044 Upgrade to jackrabbit 2.2.5
     new 411333c  SLING-2150 : Update plugins to use the latest available versions
     new 29083c0  SLING-2167 : Use Sling authenticator
     new 3a91cd7  Update to recent snapshot
     new 4587d79  Correct parent pom
     new c771c3b  SLING-2167 : Use session from default implementation to let the tests pass
     new 76c54d4  SLING-2167 : Use session from default implementation to let the tests pass
     new a3663f8  Clean up pom
     new eb84213  Clean up pom
     new 6366d86  SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
     new 168430e  temporarily using snapshots during release vote
     new 9b13faa  using latest releases
     new 3d342b5  SLING-2256 - making the missing-auth-mapping parameter configurable
     new f54de0c  Reverting r1189896  "SLING-2256 - making the missing-auth-mapping parameter configurable"
     new 1b5bbaf  SLING-2269 - fixing typo
     new 4d123f2  SLING-2167 Force HTTP Basic authentication
     new 8572fee  SLING-2272 - upgrade Jackrabbit version to 2.2.9 (except for WebDAV, which needs 2.3.x, so upgraded to 2.3.2) and Tika to 1.0
     new fa257ab  SLING-2167 Reverting my last change thus not forcing HTTP Basic. The real solution is to make sure authentication on the davex path is not enforced by Sling authentication.
     new 19eb0c8  SLING-2275 Consolidate configuration   - use OsgiUtil to convert the configuration property   - prevent indirect dependencies making Jackrabbit deps provided   - preset Jackrabbit DavEx config:       path prefix: same as servlet registration path       home/tmp directory: sling.home/jackrabbit/tmp       csrf protection: disabled       no other parameters are set   - use Sling settings to get sling.home location
     new 8846875  SLING-2274 Never require authentication from the DavEx servlet but support any credentials coming along
     new 1072adf  SLING-2275 Consolidate property name for the servlet registration with the respective property name of the SimpleWebDav servlet which uses dav.root
     new 1026607  SLING-2275 Reverting the property name consolidation. This breaks configuration compatibility with release 1.0 !
     new e6e97ce  SLING-2275 Oops, need the home path not the home URL....
     new 497ee0e  SLING-2300 Set the j_workspace request attribute to the workspace extracted from the request URL (this will later be handled by the AuthenticationInfoPostProcessor to set the required workspace property in the AuthenticationInfo)
     new fbcb7a3  SLING-2301 Update to Jackrabbit JCR Server 2.3.4 and import Jackrabbit WebDAV (instead of embedding)
     new 51e2fc3  SLING-2325 - using request attribute flag rather than impersonation to ensure that a session lives past the current request
     new 1d4deb3  SLING-2215 - removing init properties to set temp directory; letting JR do the right thing by default. Thanks to Jukka Zitting for the patch!
     new 638bd48  SLING-2325 Selectively reuse request session or impersonation:   - for LOCK and SUBSCRIBE requests, impersonation is used and releaseSession logs out   - for other requests, request session is used and releaseSession does nothing
     new 77ed4ca  SLING-2325 Improve code readability and make sure temporary admin session is logged out after impersonation
     new e88280f  Use most recent Jackrabbit JCR Server code to embed
     new bcc370c  SLING-2325 Always create a long-lived session
     new 2e56ee2  Revert "Use most recent Jackrabbit JCR Server code to embed"
     new 1c558e1  SLING-2480 : Add config for maven-sling-plugin to m2e configuration
     new abd85c0  SLING-2503 : Update to new Jackrabbit version to fix JCR-3329
     new 62ce285  Update to latest parent pom
     new a2b3334  Use released versions
     new 7480289  Prepare for release
     new 9002a98  [maven-release-plugin] prepare release org.apache.sling.jcr.davex-1.1.0
     new 9810fb9  [maven-release-plugin] prepare for next development iteration
     new 8cdce0c  Use latest releases and update to new parent pom
     new b308b26  Update to latest parent pom and use latest releases in launchpad
     new ccb88c3  Correct reactor pom and update to parent pom 16
     new 634c05b  SLING-2886 Apply Patch by Julian Reschke (thanks alot).
     new dab73a5  [maven-release-plugin] prepare release org.apache.sling.jcr.davex-1.2.0
     new 81814c1  [maven-release-plugin] prepare for next development iteration
     new ed3c6f1  Update to latest parent pom
     new 8b03073  Update to parent pom 18
     new 1d1d3a4  SLING-3262 Update Jackrabbit WebDAV and JCR Server dependencies to 2.6.4 (latest production version)
     new 9245686  SLING-3286 - Remove plugin version overrides from poms
     new 43ce57c  Update to parent pom v19
     new 6aac2e0  Updated to parent version 20
     new 0593867  [maven-release-plugin] prepare release org.apache.sling.jcr.davex-1.2.2
     new 4eae235  [maven-release-plugin] prepare for next development iteration
     new 3ea42cf  Update to Sling Parent POM 22 with baselining enabled
     new 4b186aa  SLING-4698 - Set parent.relativePath to empty for all modules
     new f4232ce  Update to Sling Parent 23
     new 2d384dd  set parent version to 24 and add empty relativePath where missing
     new c2bdf74  SLING-4919 : Require configuration for webdav related services
     new c0b954d  [maven-release-plugin] prepare release org.apache.sling.jcr.davex-1.3.0
     new 65ad3c9  [maven-release-plugin] prepare for next development iteration
     new 4731553  Update the main reactor to parent 25
     new 9aad0ce  Switch to parent pom 26
     new 2c8ab3a  SLING-5572 : Update Jackrabbit to 2.12.1
     new ab2e7f1  [maven-release-plugin] prepare release org.apache.sling.jcr.davex-1.3.2
     new 3420c13  [maven-release-plugin] prepare for next development iteration
     new e07dbcc  SLING-5596 : Patch provided by Davide Giannella which adds a dav.protectedHandlers config with a default of AclRemoveHandler to the SlingDavExServlet - avoids having no config for the JCR ProtectedRemoveManager
     new 3cf9678  [maven-release-plugin] prepare release org.apache.sling.jcr.davex-1.3.4
     new df55c7e  [maven-release-plugin] prepare for next development iteration
     new a23d36f  SLING-5832 Update Jackrabbit to 2.12.2
     new e0b0827  SLING-5958 Upgrade Jackrabbit to 2.13.1
     new c35d525  SLING-6378 Unclosed ResourceResolver in davex AuthHttpContext
     new e204b27  SLING-6404 : Remove loginAdministrative() usage from jcr.davex
     new 418250f  SLING-6459 Upgrade Jackrabbit to 2.14.0
     new 328bfdf  [maven-release-plugin] prepare release org.apache.sling.jcr.davex-1.3.6
     new b491cc1  [maven-release-plugin] copy for tag org.apache.sling.jcr.davex-1.3.6

The 89 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-org-apache-sling-jcr-davex] 08/08: [maven-release-plugin] copy for tag org.apache.sling.jcr.davex-1.3.6

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.davex-1.3.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-davex.git

commit b491cc18e5ed90197aea2f1107487c5d867c174b
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Jan 25 16:38:17 2017 +0000

    [maven-release-plugin] copy for tag org.apache.sling.jcr.davex-1.3.6
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.davex-1.3.6@1780230 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-davex] 04/08: SLING-6378 Unclosed ResourceResolver in davex AuthHttpContext

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.davex-1.3.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-davex.git

commit c35d525ffe1238f9bcd7c3fd1227fbbbc320202d
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Mon Dec 12 14:05:20 2016 +0000

    SLING-6378 Unclosed ResourceResolver in davex AuthHttpContext
    
    * Refactored Servlet to be a whiteboard registered servlet
    * Refactored AuthHttpContext to be a whiteboard registered
      ServletContextHelper used by the SlingDavExServlet
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex@1773793 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |   3 +-
 .../jcr/davex/impl/servlets/AuthHttpContext.java   | 104 ++++++++-----------
 .../jcr/davex/impl/servlets/SlingDavExServlet.java | 111 ++++++++-------------
 .../davex/impl/servlets/AuthHttpContextTest.java   |  38 +++----
 4 files changed, 104 insertions(+), 152 deletions(-)

diff --git a/pom.xml b/pom.xml
index ad6775b..1b3d925 100644
--- a/pom.xml
+++ b/pom.xml
@@ -152,7 +152,8 @@
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
+            <artifactId>org.osgi.service.http.whiteboard</artifactId>
+            <version>1.0.0</version>
         </dependency>
 
         <!-- JUnit -->
diff --git a/src/main/java/org/apache/sling/jcr/davex/impl/servlets/AuthHttpContext.java b/src/main/java/org/apache/sling/jcr/davex/impl/servlets/AuthHttpContext.java
index b40c98a..e508b83 100644
--- a/src/main/java/org/apache/sling/jcr/davex/impl/servlets/AuthHttpContext.java
+++ b/src/main/java/org/apache/sling/jcr/davex/impl/servlets/AuthHttpContext.java
@@ -17,53 +17,54 @@
 package org.apache.sling.jcr.davex.impl.servlets;
 
 import java.io.IOException;
-import java.net.URL;
+import java.util.Set;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.ConfigurationPolicy;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.sling.auth.core.AuthenticationSupport;
-import org.osgi.service.http.HttpContext;
-
-class AuthHttpContext implements HttpContext {
+import org.osgi.framework.Constants;
+import org.osgi.service.http.context.ServletContextHelper;
+import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
+
+@Component(metatype = false, policy = ConfigurationPolicy.IGNORE)
+@Service(ServletContextHelper.class)
+@Properties({
+    @Property(name = Constants.SERVICE_DESCRIPTION, value = "Sling JcrRemoting Servlet"),
+    @Property(name = Constants.SERVICE_VENDOR, value = "The Apache Software Foundation"),
+    @Property(name = HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME, value = AuthHttpContext.HTTP_CONTEXT_NAME),
+    @Property(name = HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH, value = "/"),
+    @Property(name = Constants.SERVICE_RANKING, intValue = 5)
+})
+public class AuthHttpContext extends ServletContextHelper {
 
     /**
-     * The root path at which the DavEx servlet is registered. This is used to
-     * extract the workspace name from the request URL where the workspace name
-     * is the first segment in the path after the this path.
+     * The name of this ServletContext for use by they SlingDavExServlet
      */
-    private final String davRoot;
+    static final String HTTP_CONTEXT_NAME = "DavExAuthHttpContext";
 
     /**
      * Handles security
      *
      * @see #handleSecurity(HttpServletRequest, HttpServletResponse)
      */
+    @Reference
     private AuthenticationSupport authenticator;
 
-    AuthHttpContext(final String davRoot) {
-        this.davRoot = davRoot;
-    }
-
-    public void setAuthenticationSupport(final AuthenticationSupport auth) {
-        this.authenticator = auth;
-    }
-
-    // ---------- HttpContext
-
-    /**
-     * Returns the MIME type as resolved by the <code>MimeTypeService</code> or
-     * <code>null</code> if the service is not available.
-     */
-    public String getMimeType(String name) {
-        return null;
-    }
+    // ---------- ServletContextHelper
 
     /**
-     * Always returns <code>null</code> because resources are all provided
-     * through the {@link MainServlet}.
+     * Always returns <code>null</code> as resources are only accessible through
+     * the {@link SlingDavExServlet}.
      */
-    public URL getResource(String name) {
+    @Override
+    public Set<String> getResourcePaths(String path) {
         return null;
     }
 
@@ -94,40 +95,21 @@ class AuthHttpContext implements HttpContext {
 
     private final String getWorkspace(final String uriPath) {
 
-        // Paths to consider
-        // /davRoot
-        // /davRoot/
-        // /davRoot/wsp
-        // /davRoot/wsp/
-        // /davRoot/wsp/...
-
-        if (uriPath != null && uriPath.startsWith(this.davRoot)) {
-
-            // cut off root
-            int start = this.davRoot.length();
-
-            // just the root
-            if (start >= uriPath.length()) {
-                return null;
-            }
-
-            if (uriPath.charAt(start) == '/') {
-                start++;
-            } else {
-                // expected slash, actually (don't care)
-                return null;
-            }
-
-            // just the root with trailing slash
-            if (start >= uriPath.length()) {
-                return null;
-            }
-
-            int end = uriPath.indexOf('/', start);
-            if (end > start) {
-                return uriPath.substring(start, end);
+        // Paths to consider  | Result
+        // -------------------+---------
+        // null               | null
+        // "" (empty)         | null
+        // /                  | null
+        // /wsp               | wsp
+        // /wsp/              | wsp
+        // /wsp/...           | wsp
+
+        if (uriPath != null && uriPath.length() > 1 && uriPath.charAt(0) == '/') {
+            int end = uriPath.indexOf('/', 1);
+            if (end > 1) {
+                return uriPath.substring(1, end);
             } else if (end < 0) {
-                return uriPath.substring(start);
+                return uriPath.substring(1);
             }
         }
 
diff --git a/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java b/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
index 0aba2d1..8b7cde0 100644
--- a/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
+++ b/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
@@ -25,6 +25,7 @@ import javax.jcr.Repository;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
+import javax.servlet.Servlet;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 
@@ -45,7 +46,7 @@ import org.apache.sling.jcr.api.SlingRepository;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.http.HttpService;
+import org.osgi.service.http.whiteboard.HttpWhiteboardConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -85,6 +86,17 @@ public class SlingDavExServlet extends JcrRemotingServlet {
     private static final String PROP_CREATE_ABSOLUTE_URI = "dav.create-absolute-uri";
 
     /**
+     * Default value for the configuration {@link #PROP_PROTECTED_HANDLERS}
+     */
+    private static final String DEFAULT_PROTECTED_HANDLERS = "org.apache.jackrabbit.server.remoting.davex.AclRemoveHandler";
+
+    /**
+     * defines the Protected handlers for the Jcr Remoting Servlet
+     */
+    @Property(value=DEFAULT_PROTECTED_HANDLERS)
+    private static final String PROP_PROTECTED_HANDLERS = "dav.protectedhandlers";
+
+    /**
      * The name of the service property of the registered dummy service to cause
      * the path to the DavEx servlet to not be subject to forced authentication.
      */
@@ -98,88 +110,37 @@ public class SlingDavExServlet extends JcrRemotingServlet {
     @Reference
     private SlingRepository repository;
 
-    @Reference
-    private HttpService httpService;
-
-    @Reference
-    private AuthenticationSupport authSupport;
-
-    /**
-     * The path at which the DavEx servlet has successfully been
-     * registered in the {@link #activate(Map)} method. If this is
-     * <code>null</code> the DavEx servlet is not registered with the
-     * Http Service.
-     */
-    private String servletAlias;
-
-    /**
-     * The dummy service registration to convey to the Sling Authenticator
-     * that everything under the alias must not be forcibly authenticated.
-     * This will be <code>null</code> if the DavEx servlet registration
-     * fails.
-     */
-    private ServiceRegistration dummyService;
-
     /**
-     * Default value for the configuration {@link #PROP_PROTECTED_HANDLERS}
+     * The DavExServlet service registration with the OSGi Whiteboard.
      */
-    public static final String DEFAULT_PROTECTED_HANDLERS = "org.apache.jackrabbit.server.remoting.davex.AclRemoveHandler";
+    private ServiceRegistration davServlet;
 
-    /**
-     * defines the Protected handlers for the Jcr Remoting Servlet
-     */
-    @Property(value=DEFAULT_PROTECTED_HANDLERS)
-    public static final String PROP_PROTECTED_HANDLERS = "dav.protectedhandlers";
-    
     @Activate
     protected void activate(final BundleContext bundleContext, final Map<String, ?> config) {
         final String davRoot = OsgiUtil.toString(config.get(PROP_DAV_ROOT), DEFAULT_DAV_ROOT);
         final boolean createAbsoluteUri = OsgiUtil.toBoolean(config.get(PROP_CREATE_ABSOLUTE_URI), DEFAULT_CREATE_ABSOLUTE_URI);
         final String protectedHandlers = OsgiUtil.toString(config.get(PROP_PROTECTED_HANDLERS), DEFAULT_PROTECTED_HANDLERS);
 
-        final AuthHttpContext context = new AuthHttpContext(davRoot);
-        context.setAuthenticationSupport(authSupport);
-
         // prepare DavEx servlet config
-        final Dictionary<String, String> initProps = new Hashtable<String, String>();
-
-        // prefix to the servlet
-        initProps.put(INIT_PARAM_RESOURCE_PATH_PREFIX, davRoot);
-
-        // create absolute URIs (or absolute paths)
-        initProps.put(INIT_PARAM_CREATE_ABSOLUTE_URI, Boolean.toString(createAbsoluteUri));
-
-        // disable CSRF checks for now (should be handled by Sling)
-        initProps.put(INIT_PARAM_CSRF_PROTECTION, CSRFUtil.DISABLED);
-        
+        final Dictionary<String, Object> initProps = new Hashtable<String, Object>();
+        initProps.put(toInitParamProperty(INIT_PARAM_RESOURCE_PATH_PREFIX), davRoot);
+        initProps.put(toInitParamProperty(INIT_PARAM_CREATE_ABSOLUTE_URI), Boolean.toString(createAbsoluteUri));
+        initProps.put(toInitParamProperty(INIT_PARAM_CSRF_PROTECTION), CSRFUtil.DISABLED);
         initProps.put(INIT_PARAM_PROTECTED_HANDLERS_CONFIG, protectedHandlers);
-
-        // register and handle registration failure
-        try {
-            this.httpService.registerServlet(davRoot, this, initProps, context);
-            this.servletAlias = davRoot;
-
-            java.util.Properties dummyServiceProperties = new java.util.Properties();
-            dummyServiceProperties.put(Constants.SERVICE_VENDOR, config.get(Constants.SERVICE_VENDOR));
-            dummyServiceProperties.put(Constants.SERVICE_DESCRIPTION,
-                "Helper for " + config.get(Constants.SERVICE_DESCRIPTION));
-            dummyServiceProperties.put(PAR_AUTH_REQ, "-" + davRoot);
-            this.dummyService = bundleContext.registerService("java.lang.Object", new Object(), dummyServiceProperties);
-        } catch (Exception e) {
-            log.error("activate: Failed registering DavEx Servlet at " + davRoot, e);
-        }
+        initProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN, davRoot.concat("/*"));
+        initProps.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT,
+            "(" + HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME + "=" + AuthHttpContext.HTTP_CONTEXT_NAME + ")");
+        initProps.put(Constants.SERVICE_VENDOR, config.get(Constants.SERVICE_VENDOR));
+        initProps.put(Constants.SERVICE_DESCRIPTION, config.get(Constants.SERVICE_DESCRIPTION));
+        initProps.put(PAR_AUTH_REQ, "-" + davRoot); // make sure this is not forcible authenticated !
+        this.davServlet = bundleContext.registerService(Servlet.class.getName(), this, initProps);
     }
 
     @Deactivate
     protected void deactivate() {
-        if (this.dummyService != null) {
-            this.dummyService.unregister();
-            this.dummyService = null;
-        }
-
-        if (this.servletAlias != null) {
-            this.httpService.unregister(servletAlias);
-            this.servletAlias = null;
+        if (this.davServlet!= null) {
+            this.davServlet.unregister();
+            this.davServlet = null;
         }
     }
 
@@ -251,4 +212,18 @@ public class SlingDavExServlet extends JcrRemotingServlet {
             }
         };
     }
+
+    /**
+     * Returns the name as a String suitable for use as a property registered with
+     * and OSGi Http Whiteboard Service init parameter.
+     *
+     * @param name The parameter to convert. Must not be {@code null} and should not be empty.
+     *
+     * @return The converted name properly prefixed.
+     *
+     * @throws NullPointerException if {@code name} is {@code null}.
+     */
+    private static String toInitParamProperty(final String name) {
+        return HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_INIT_PARAM_PREFIX.concat(name);
+    }
 }
diff --git a/src/test/java/org/apache/sling/jcr/davex/impl/servlets/AuthHttpContextTest.java b/src/test/java/org/apache/sling/jcr/davex/impl/servlets/AuthHttpContextTest.java
index 50f4b9d..47477be 100644
--- a/src/test/java/org/apache/sling/jcr/davex/impl/servlets/AuthHttpContextTest.java
+++ b/src/test/java/org/apache/sling/jcr/davex/impl/servlets/AuthHttpContextTest.java
@@ -37,50 +37,44 @@ public class AuthHttpContextTest {
 
     @Test
     public void test_getWorkspace_null() throws Throwable {
-        final AuthHttpContext ahc = new AuthHttpContext("/server");
+        final AuthHttpContext ahc = new AuthHttpContext();
         TestCase.assertNull(getWorkspace.invoke(ahc, (String) null));
     }
 
     @Test
     public void test_getWorkspace_root() throws Throwable {
-        final AuthHttpContext ahc = new AuthHttpContext("/server");
-        TestCase.assertNull(getWorkspace.invoke(ahc, "/server"));
+        final AuthHttpContext ahc = new AuthHttpContext();
+        TestCase.assertNull(getWorkspace.invoke(ahc, ""));
     }
 
     @Test
     public void test_getWorkspace_root_slash() throws Throwable {
-        final AuthHttpContext ahc = new AuthHttpContext("/server");
-        TestCase.assertNull(getWorkspace.invoke(ahc, "/server/"));
-    }
-
-    @Test
-    public void test_getWorkspace_root_char() throws Throwable {
-        final AuthHttpContext ahc = new AuthHttpContext("/server");
-        TestCase.assertNull(getWorkspace.invoke(ahc, "/serverxyz"));
+        final AuthHttpContext ahc = new AuthHttpContext();
+        TestCase.assertNull(getWorkspace.invoke(ahc, "/"));
     }
 
     @Test
     public void test_getWorkspace_wsp() throws Throwable {
-        final AuthHttpContext ahc = new AuthHttpContext("/server");
-        TestCase.assertEquals("w", getWorkspace.invoke(ahc, "/server/w"));
-        TestCase.assertEquals("wsp", getWorkspace.invoke(ahc, "/server/wsp"));
+        final AuthHttpContext ahc = new AuthHttpContext();
+        TestCase.assertEquals("w", getWorkspace.invoke(ahc, "/w"));
+        TestCase.assertEquals("wsp", getWorkspace.invoke(ahc, "/wsp"));
     }
 
     @Test
     public void test_getWorkspace_wsp_slash() throws Throwable {
-        final AuthHttpContext ahc = new AuthHttpContext("/server");
-        TestCase.assertEquals("w", getWorkspace.invoke(ahc, "/server/w/"));
-        TestCase.assertEquals("wsp", getWorkspace.invoke(ahc, "/server/wsp/"));
+        final AuthHttpContext ahc = new AuthHttpContext();
+        TestCase.assertEquals("w", getWorkspace.invoke(ahc, "/w/"));
+        TestCase.assertEquals("wsp", getWorkspace.invoke(ahc, "/wsp/"));
     }
 
     @Test
     public void test_getWorkspace_wsp_path() throws Throwable {
-        final AuthHttpContext ahc = new AuthHttpContext("/server");
-        TestCase.assertEquals("w", getWorkspace.invoke(ahc, "/server/w/abc"));
-        TestCase.assertEquals("wsp", getWorkspace.invoke(ahc, "/server/wsp/abc"));
+        final AuthHttpContext ahc = new AuthHttpContext();
+        TestCase.assertEquals("w", getWorkspace.invoke(ahc, "/w/abc"));
+        TestCase.assertEquals("wsp", getWorkspace.invoke(ahc, "/wsp/abc"));
 
-        TestCase.assertEquals("w", getWorkspace.invoke(ahc, "/server/w/abc/xyz"));
-        TestCase.assertEquals("wsp", getWorkspace.invoke(ahc, "/server/wsp/abc/xyz"));
+        TestCase.assertEquals("w", getWorkspace.invoke(ahc, "/w/abc/xyz"));
+        TestCase.assertEquals("wsp", getWorkspace.invoke(ahc, "/wsp/abc/xyz"));
     }
 
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-davex] 06/08: SLING-6459 Upgrade Jackrabbit to 2.14.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.davex-1.3.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-davex.git

commit 418250f08a1136ca2f53acc0ca1745357244f434
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Fri Jan 13 11:49:49 2017 +0000

    SLING-6459 Upgrade Jackrabbit to 2.14.0
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex@1778557 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 857e720..8ad9c6f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
     </scm>
 
     <properties>
-        <jackrabbit.version>2.13.6</jackrabbit.version>
+        <jackrabbit.version>2.14.0</jackrabbit.version>
     </properties>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-davex] 05/08: SLING-6404 : Remove loginAdministrative() usage from jcr.davex

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.davex-1.3.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-davex.git

commit e204b273f7988a8c61d7bed2a253db62855cb972
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Dec 19 11:02:49 2016 +0000

    SLING-6404 : Remove loginAdministrative() usage from jcr.davex
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex@1775055 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                               |  4 ++--
 .../jcr/davex/impl/servlets/SlingDavExServlet.java    | 19 +++++++------------
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/pom.xml b/pom.xml
index 1b3d925..857e720 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
     </scm>
 
     <properties>
-        <jackrabbit.version>2.13.1</jackrabbit.version>
+        <jackrabbit.version>2.13.6</jackrabbit.version>
     </properties>
 
     <build>
@@ -114,7 +114,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.api</artifactId>
-            <version>2.0.6</version>
+            <version>2.4.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
diff --git a/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java b/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
index 8b7cde0..67f7f30 100644
--- a/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
+++ b/src/main/java/org/apache/sling/jcr/davex/impl/servlets/SlingDavExServlet.java
@@ -153,6 +153,7 @@ public class SlingDavExServlet extends JcrRemotingServlet {
     protected SessionProvider getSessionProvider() {
         return new SessionProvider() {
 
+            @Override
             public Session getSession(final HttpServletRequest req, final Repository repository, final String workspace)
                     throws LoginException, RepositoryException, ServletException {
                 final ResourceResolver resolver = (ResourceResolver) req.getAttribute(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
@@ -168,6 +169,7 @@ public class SlingDavExServlet extends JcrRemotingServlet {
                 throw new ServletException("ResourceResolver missing or not providing on JCR Session");
             }
 
+            @Override
             public void releaseSession(final Session session) {
                 log.debug("releaseSession: Logging out long lived Session ({})", session);
                 session.logout();
@@ -177,25 +179,23 @@ public class SlingDavExServlet extends JcrRemotingServlet {
              * Creates a new session for the user of the slingSession in the
              * same workspace as the slingSession.
              * <p>
-             * Assumption: The admin session has permission to impersonate
+             * Assumption: The service session has permission to impersonate
              * as any user without restriction. If this is not the case
              * the Session.impersonate method throws a LoginException
              * which is folded into a RepositoryException.
              *
              * @param slingSession The session provided by the Sling
-             *            authentication mechanis,
+             *            authentication mechanism,
              * @return a new session which may (and will) outlast the request
-             * @throws RepositoryException If an error occurrs creating the
+             * @throws RepositoryException If an error occurs creating the
              *             session.
              */
             private Session getLongLivedSession(final Session slingSession) throws RepositoryException {
-                Session adminSession = null;
                 final String user = slingSession.getUserID();
+                final SimpleCredentials credentials = new SimpleCredentials(user, EMPTY_PW);
                 try {
-                    final SimpleCredentials credentials = new SimpleCredentials(user, EMPTY_PW);
                     final String wsp = slingSession.getWorkspace().getName();
-                    adminSession = SlingDavExServlet.this.repository.loginAdministrative(wsp);
-                    return adminSession.impersonate(credentials);
+                    return SlingDavExServlet.this.repository.impersonateFromService(null, credentials, wsp);
                 } catch (RepositoryException re) {
 
                     // LoginException from impersonate (missing permission)
@@ -203,11 +203,6 @@ public class SlingDavExServlet extends JcrRemotingServlet {
                     // impersonate folded into RepositoryException to
                     // cause a 403/FORBIDDEN response
                     throw new RepositoryException("Cannot get session for " + user, re);
-
-                } finally {
-                    if (adminSession != null) {
-                        adminSession.logout();
-                    }
                 }
             }
         };

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-davex] 02/08: SLING-5832 Update Jackrabbit to 2.12.2

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.davex-1.3.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-davex.git

commit a23d36f9405f1d3ba4737dec6bc8a5b37f37ed49
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Fri Jul 8 20:18:44 2016 +0000

    SLING-5832 Update Jackrabbit to 2.12.2
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex@1751958 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d416cdc..80aff47 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
     </scm>
 
     <properties>
-        <jackrabbit.version>2.12.1</jackrabbit.version>
+        <jackrabbit.version>2.12.2</jackrabbit.version>
     </properties>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-davex] 07/08: [maven-release-plugin] prepare release org.apache.sling.jcr.davex-1.3.6

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.davex-1.3.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-davex.git

commit 328bfdf9efaefae080558bdcd99051f3fd27fb1d
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Jan 25 16:38:03 2017 +0000

    [maven-release-plugin] prepare release org.apache.sling.jcr.davex-1.3.6
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex@1780229 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 8ad9c6f..3fb4817 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
 
     <artifactId>org.apache.sling.jcr.davex</artifactId>
     <packaging>bundle</packaging>
-    <version>1.3.5-SNAPSHOT</version>
+    <version>1.3.6</version>
 
     <name>Apache Sling DavEx Access to repositories</name>
     <description>
@@ -27,9 +27,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/davex</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.davex-1.3.6</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.davex-1.3.6</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.jcr.davex-1.3.6</url>
     </scm>
 
     <properties>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-davex] 03/08: SLING-5958 Upgrade Jackrabbit to 2.13.1

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.davex-1.3.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-davex.git

commit e0b082722356f52ff4f3c3ef0fd0a1eeeb27b257
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Fri Aug 12 18:57:18 2016 +0000

    SLING-5958 Upgrade Jackrabbit to 2.13.1
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex@1756205 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 80aff47..ad6775b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
     </scm>
 
     <properties>
-        <jackrabbit.version>2.12.2</jackrabbit.version>
+        <jackrabbit.version>2.13.1</jackrabbit.version>
     </properties>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-org-apache-sling-jcr-davex] 01/08: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.jcr.davex-1.3.6
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-davex.git

commit df55c7ecaf810561006fafc499e5820a5d9f9d2e
Author: Stefan Egli <st...@apache.org>
AuthorDate: Fri Mar 11 11:21:30 2016 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex@1734537 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 991e3cd..d416cdc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -19,7 +19,7 @@
 
     <artifactId>org.apache.sling.jcr.davex</artifactId>
     <packaging>bundle</packaging>
-    <version>1.3.4</version>
+    <version>1.3.5-SNAPSHOT</version>
 
     <name>Apache Sling DavEx Access to repositories</name>
     <description>
@@ -27,9 +27,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.davex-1.3.4</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/org.apache.sling.jcr.davex-1.3.4</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/org.apache.sling.jcr.davex-1.3.4</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/davex</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/davex</url>
     </scm>
 
     <properties>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.