jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r368754 - in /incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src: java/org/apache/jackrabbit/j2ee/JCRWebdavServerServlet.java webapp/WEB-INF/web.xml
Date Fri, 13 Jan 2006 15:13:32 GMT
Author: angela
Date: Fri Jan 13 07:13:26 2006
New Revision: 368754

URL: http://svn.apache.org/viewcvs?rev=368754&view=rev
Log:
JCR-289 - jcr-server: make auth-header configurable for JCR-Server

Modified:
    incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/JCRWebdavServerServlet.java
    incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/WEB-INF/web.xml

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/JCRWebdavServerServlet.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/JCRWebdavServerServlet.java?rev=368754&r1=368753&r2=368754&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/JCRWebdavServerServlet.java
(original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/java/org/apache/jackrabbit/j2ee/JCRWebdavServerServlet.java
Fri Jan 13 07:13:26 2006
@@ -51,6 +51,17 @@
      */
     public static final String INIT_PARAM_RESOURCE_PATH_PREFIX = "resource-path-prefix";
 
+    /**
+     * Name of the optional init parameter that defines the value of the
+     * 'WWW-Authenticate' header.<p/>
+     * If the parameter is omitted the default value
+     * {@link #DEFAULT_AUTHENTICATE_HEADER "Basic Realm=Jackrabbit Webdav Server"}
+     * is used.
+     *
+     * @see #getAuthenticateHeaderValue()
+     */
+    public static final String INIT_PARAM_AUTHENTICATE_HEADER = "authenticate-header";
+
     /** the 'missing-auth-mapping' init parameter */
     public final static String INIT_PARAM_MISSING_AUTH_MAPPING = "missing-auth-mapping";
 
@@ -62,6 +73,8 @@
     public static final String CTX_ATTR_RESOURCE_PATH_PREFIX = "jackrabbit.webdav.jcr.resourcepath";
 
     private String pathPrefix;
+    private String authenticate_header;
+
     private JCRWebdavServer server;
     private DavResourceFactory resourceFactory;
     private DavLocatorFactory locatorFactory;
@@ -85,6 +98,12 @@
         getServletContext().setAttribute(CTX_ATTR_RESOURCE_PATH_PREFIX, pathPrefix);
         log.debug(INIT_PARAM_RESOURCE_PATH_PREFIX + " = " + pathPrefix);
 
+        authenticate_header = getInitParameter(INIT_PARAM_AUTHENTICATE_HEADER);
+        if (authenticate_header == null) {
+            authenticate_header = DEFAULT_AUTHENTICATE_HEADER;
+        }
+        log.debug(INIT_PARAM_AUTHENTICATE_HEADER + " = " + authenticate_header);
+
         txMgr = new TxLockManagerImpl();
         subscriptionMgr = new SubscriptionManagerImpl();
 
@@ -190,12 +209,14 @@
     }
 
     /**
-     * Returns {@link #DEFAULT_AUTHENTICATE_HEADER}.
+     * Returns the init param of the servlet configuration or
+     * {@link #DEFAULT_AUTHENTICATE_HEADER} as default value.
      *
-     * @return {@link #DEFAULT_AUTHENTICATE_HEADER}.
+     * @return corresponding init parameter or {@link #DEFAULT_AUTHENTICATE_HEADER}.
+     * @see #INIT_PARAM_AUTHENTICATE_HEADER
      */
     public String getAuthenticateHeaderValue() {
-        return DEFAULT_AUTHENTICATE_HEADER;
+        return authenticate_header;
     }
 
     /**

Modified: incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/WEB-INF/web.xml?rev=368754&r1=368753&r2=368754&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/WEB-INF/web.xml (original)
+++ incubator/jackrabbit/trunk/contrib/jcr-server/webapp/src/webapp/WEB-INF/web.xml Fri Jan
13 07:13:26 2006
@@ -216,7 +216,18 @@
             The webdav servlet that connects HTTP request to the repository.
         </description>
         <servlet-class>org.apache.jackrabbit.j2ee.JCRWebdavServerServlet</servlet-class>
-
+        <!--
+            Optional parameter to define the value of the 'WWW-Authenticate' header
+        -->
+        <!--
+        <init-param>
+            <param-name>authenticate-header</param-name>
+            <param-value>Basic realm="Jackrabbit Webdav Server"</param-value>
+            <description>
+                Defines the value of the 'WWW-Authenticate' header.
+            </description>
+        </init-param>
+        -->
         <init-param>
             <param-name>resource-path-prefix</param-name>
             <param-value>/server</param-value>



Mime
View raw message