You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ni...@apache.org on 2004/07/28 13:39:30 UTC
svn commit: rev 30840 - in avalon/trunk/planet/facilities/http/impl/src: etc main/org/apache/avalon/http/impl
Author: niclas
Date: Wed Jul 28 04:39:30 2004
New Revision: 30840
Added:
avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/HashUserRealm.java (contents, props changed)
avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/JaasUserRealm.java (contents, props changed)
Modified:
avalon/trunk/planet/facilities/http/impl/src/etc/default-server.xml
avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/HttpContextImpl.java
Log:
Committing the UserRealm wrappers, and will start looking into getting that working.
Modified: avalon/trunk/planet/facilities/http/impl/src/etc/default-server.xml
==============================================================================
--- avalon/trunk/planet/facilities/http/impl/src/etc/default-server.xml (original)
+++ avalon/trunk/planet/facilities/http/impl/src/etc/default-server.xml Wed Jul 28 04:39:30 2004
@@ -35,8 +35,12 @@
<component name="server" class="org.apache.avalon.http.impl.HttpServerImpl" />
+<!-- For Linux systems.
<component name="mimetypes" class="org.apache.avalon.http.impl.SystemMimeTypes" />
-
+-->
+
+ <component name="mimetypes" class="org.apache.avalon.http.impl.ConfigurationMimeTypes" />
+
<component name="context" class="org.apache.avalon.http.impl.HttpContextImpl" >
<configuration>
<context-path>/niclas/testing</context-path>
Added: avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/HashUserRealm.java
==============================================================================
--- (empty file)
+++ avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/HashUserRealm.java Wed Jul 28 04:39:30 2004
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2004 Apache Software Foundation
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.avalon.http.impl;
+
+import java.io.IOException;
+
+import org.apache.avalon.framework.parameters.ParameterException;
+import org.apache.avalon.framework.parameters.Parameterizable;
+import org.apache.avalon.framework.parameters.Parameters;
+
+/** Wrapper for the Jetty HashUserRealm.
+ *
+ * @avalon.component name="http-userrealm-hash" lifestyle="singleton"
+ * @avalon.service type="org.mortbay.http.UserRealm"
+ */
+public class HashUserRealm extends org.mortbay.http.HashUserRealm
+ implements Parameterizable
+{
+ public HashUserRealm()
+ {
+ }
+
+ public void parameterize( Parameters params )
+ throws ParameterException
+ {
+ String realmName = params.getParameter( "name" );
+ setName( realmName );
+
+ String filename = params.getParameter( "filename" );
+ try
+ {
+ load( filename );
+ } catch( IOException e )
+ {
+ throw new ParameterException( "Unable to read file: " + filename, e );
+ }
+ }
+}
Modified: avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/HttpContextImpl.java
==============================================================================
--- avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/HttpContextImpl.java (original)
+++ avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/HttpContextImpl.java Wed Jul 28 04:39:30 2004
@@ -128,7 +128,7 @@
* @avalon.dependency type="org.apache.avalon.http.HttpService"
* key="server"
* @avalon.dependency type="org.apache.avalon.http.MimeTypes"
- * key="mimetypes"
+ * key="mimetypes" optional="true"
* @avalon.dependency type="org.mortbay.http.Authenticator"
* key="authenticator" optional="true"
* @avalon.dependency type="org.mortbay.http.UserRealm"
Added: avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/JaasUserRealm.java
==============================================================================
--- (empty file)
+++ avalon/trunk/planet/facilities/http/impl/src/main/org/apache/avalon/http/impl/JaasUserRealm.java Wed Jul 28 04:39:30 2004
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2004 Apache Software Foundation
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.avalon.http.impl;
+
+import java.io.IOException;
+
+import org.apache.avalon.framework.parameters.ParameterException;
+import org.apache.avalon.framework.parameters.Parameterizable;
+import org.apache.avalon.framework.parameters.Parameters;
+
+/** Wrapper for the Jetty JaasUserRealm.
+ *
+ * @avalon.component name="http-userrealm-jaas" lifestyle="singleton"
+ * @avalon.service type="org.mortbay.http.UserRealm"
+ */
+public class JaasUserRealm extends org.mortbay.jaas.JAASUserRealm
+ implements Parameterizable
+{
+ public JaasUserRealm()
+ {
+ }
+
+ public void parameterize( Parameters params )
+ throws ParameterException
+ {
+ String realmName = params.getParameter( "name" );
+ setName( realmName );
+
+ String filename = params.getParameter( "login-modulename" );
+ setLoginModuleName( filename );
+ }
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org