You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2008/09/21 13:03:10 UTC
svn commit: r697473 - in /geronimo/gshell/trunk/gshell-remote:
gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/
gshell-remote-client/src/main/resources/META-INF/spring/
gshell-remote-common/src/main/java/org/apache/geronimo/...
Author: jdillon
Date: Sun Sep 21 04:03:09 2008
New Revision: 697473
URL: http://svn.apache.org/viewvc?rev=697473&view=rev
Log:
Turn JaasConfigurationLoader into spring-loaded component
Added:
geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationLoader.java (contents, props changed)
- copied, changed from r697337, geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationHelper.java
Removed:
geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationHelper.java
Modified:
geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java
geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/resources/META-INF/spring/components.xml
geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/resources/META-INF/spring/components.xml
Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java?rev=697473&r1=697472&r2=697473&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java (original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/java/org/apache/geronimo/gshell/remote/client/RshClient.java Sun Sep 21 04:03:09 2008
@@ -19,20 +19,10 @@
package org.apache.geronimo.gshell.remote.client;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URI;
-import java.util.List;
-
-import javax.security.auth.callback.CallbackHandler;
-import javax.security.auth.login.LoginContext;
-import javax.annotation.PostConstruct;
-
import org.apache.geronimo.gshell.remote.client.auth.RemoteLoginModule;
import org.apache.geronimo.gshell.remote.client.handler.ClientMessageHandler;
import org.apache.geronimo.gshell.remote.client.handler.ClientSessionContext;
import org.apache.geronimo.gshell.remote.crypto.CryptoContext;
-import org.apache.geronimo.gshell.remote.jaas.JaasConfigurationHelper;
import org.apache.geronimo.gshell.remote.jaas.UsernamePasswordCallbackHandler;
import org.apache.geronimo.gshell.remote.message.CloseShellMessage;
import org.apache.geronimo.gshell.remote.message.ConnectMessage;
@@ -51,6 +41,13 @@
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.login.LoginContext;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URI;
+import java.util.List;
+
/**
* Provides support for the client-side of the remote shell protocol.
*
@@ -78,11 +75,6 @@
this.handlers = handlers;
}
- @PostConstruct
- public void init() {
- new JaasConfigurationHelper("client.login.conf").init();
- }
-
public void connect(final URI remote, final URI local) throws Exception {
TransportFactory factory = locator.locate(remote);
Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/resources/META-INF/spring/components.xml?rev=697473&r1=697472&r2=697473&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/resources/META-INF/spring/components.xml (original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-client/src/main/resources/META-INF/spring/components.xml Sun Sep 21 04:03:09 2008
@@ -57,6 +57,10 @@
</property>
</bean>
+ <bean id="jaasConfigurationLoader" class="org.apache.geronimo.gshell.remote.jaas.JaasConfigurationLoader">
+ <property name="resourceName" value="client.login.conf"/>
+ </bean>
+
<bean class="org.apache.geronimo.gshell.remote.client.RshClient" scope="prototype">
<constructor-arg>
<list>
Copied: geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationLoader.java (from r697337, geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationHelper.java)
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationLoader.java?p2=geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationLoader.java&p1=geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationHelper.java&r1=697337&r2=697473&rev=697473&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationHelper.java (original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationLoader.java Sun Sep 21 04:03:09 2008
@@ -27,11 +27,11 @@
import javax.annotation.PostConstruct;
/**
- * ???
+ * Component to configure JAAS.
*
* @version $Rev$ $Date$
*/
-public class JaasConfigurationHelper
+public class JaasConfigurationLoader
{
private static final String KEY = "java.security.auth.login.config";
@@ -39,14 +39,20 @@
private String resourceName;
- public JaasConfigurationHelper(final String resourceName) {
- this.resourceName = resourceName;
+ public String getResourceName() {
+ return resourceName;
}
- public JaasConfigurationHelper() {}
+ public void setResourceName(final String resourceName) {
+ this.resourceName = resourceName;
+ }
@PostConstruct
public void init() {
+ if (resourceName == null) {
+ throw new IllegalStateException("Missing required property: resourceName");
+ }
+
// Initialize the JAAS configuration
String path = System.getProperty(KEY);
Propchange: geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationLoader.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationLoader.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange: geronimo/gshell/trunk/gshell-remote/gshell-remote-common/src/main/java/org/apache/geronimo/gshell/remote/jaas/JaasConfigurationLoader.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java?rev=697473&r1=697472&r2=697473&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java (original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/java/org/apache/geronimo/gshell/remote/server/handler/LoginHandler.java Sun Sep 21 04:03:09 2008
@@ -19,19 +19,17 @@
package org.apache.geronimo.gshell.remote.server.handler;
-import javax.security.auth.Subject;
-import javax.security.auth.login.LoginContext;
-import javax.security.auth.login.LoginException;
-import javax.annotation.PostConstruct;
-
import org.apache.geronimo.gshell.remote.jaas.Identity;
-import org.apache.geronimo.gshell.remote.jaas.JaasConfigurationHelper;
import org.apache.geronimo.gshell.remote.jaas.UsernamePasswordCallbackHandler;
import org.apache.geronimo.gshell.remote.message.LoginMessage;
import org.apache.geronimo.gshell.remote.server.timeout.TimeoutManager;
import org.apache.geronimo.gshell.whisper.transport.Session;
import org.springframework.beans.factory.annotation.Autowired;
+import javax.security.auth.Subject;
+import javax.security.auth.login.LoginContext;
+import javax.security.auth.login.LoginException;
+
/**
* Server handler for {@link LoginMessage} messages.
*
@@ -59,11 +57,6 @@
this.defaultRealm = defaultRealm;
}
- @PostConstruct
- public void init() {
- new JaasConfigurationHelper("server.login.conf").init();
- }
-
public void handle(final Session session, final ServerSessionContext context, final LoginMessage message) throws Exception {
assert session != null;
assert context != null;
Modified: geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/resources/META-INF/spring/components.xml
URL: http://svn.apache.org/viewvc/geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/resources/META-INF/spring/components.xml?rev=697473&r1=697472&r2=697473&view=diff
==============================================================================
--- geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/resources/META-INF/spring/components.xml (original)
+++ geronimo/gshell/trunk/gshell-remote/gshell-remote-server/src/main/resources/META-INF/spring/components.xml Sun Sep 21 04:03:09 2008
@@ -59,6 +59,10 @@
<bean id="timeoutManager" class="org.apache.geronimo.gshell.remote.server.timeout.TimeoutManagerImpl"/>
+ <bean id="jaasConfigurationLoader" class="org.apache.geronimo.gshell.remote.jaas.JaasConfigurationLoader">
+ <property name="resourceName" value="server.login.conf"/>
+ </bean>
+
<bean id="rshServer" class="org.apache.geronimo.gshell.remote.server.RshServer" scope="prototype">
<constructor-arg>
<list>