Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 73421 Details for
Bug 195644
Add security support to New Agent Controller
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Platform.Common.UI patch
platform_common.ui.txt (text/plain), 6.58 KB, created by
Igor Alelekov
on 2007-07-10 10:32:07 EDT
(
hide
)
Description:
Platform.Common.UI patch
Filename:
MIME Type:
Creator:
Igor Alelekov
Created:
2007-07-10 10:32:07 EDT
Size:
6.58 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.common.ui >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.common.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.12 >diff -u -r1.12 MANIFEST.MF >--- META-INF/MANIFEST.MF 23 Mar 2007 03:31:53 -0000 1.12 >+++ META-INF/MANIFEST.MF 9 Jul 2007 12:34:56 -0000 >@@ -11,7 +11,8 @@ > org.eclipse.tptp.platform.common;bundle-version="[4.3.0,5.0.0)", > org.eclipse.tptp.platform.models;bundle-version="[4.1.0,5.0.0)", > org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)", >- org.eclipse.hyades.execution;bundle-version="[4.1.0,5.0.0)" >+ org.eclipse.hyades.execution;bundle-version="[4.1.0,5.0.0)", >+ org.eclipse.tptp.platform.execution > Eclipse-LazyStart: true > Export-Package: org.eclipse.hyades.execution.security, > org.eclipse.hyades.security.internal.util, >Index: src-common-internal/org/eclipse/tptp/platform/common/ui/internal/util/ACConnectionPool.java >=================================================================== >RCS file: src-common-internal/org/eclipse/tptp/platform/common/ui/internal/util/ACConnectionPool.java >diff -N src-common-internal/org/eclipse/tptp/platform/common/ui/internal/util/ACConnectionPool.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-common-internal/org/eclipse/tptp/platform/common/ui/internal/util/ACConnectionPool.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,123 @@ >+package org.eclipse.tptp.platform.common.ui.internal.util; >+ >+import java.io.IOException; >+import java.net.InetAddress; >+ >+import org.eclipse.hyades.internal.execution.local.common.ControlMessage; >+import org.eclipse.hyades.internal.execution.local.control.CommandHandler; >+import org.eclipse.hyades.internal.execution.local.control.ConnectionListener; >+import org.eclipse.hyades.internal.execution.local.control.Node; >+import org.eclipse.hyades.internal.execution.security.AuthenticationListener; >+import org.eclipse.hyades.internal.execution.security.LoginFailedException; >+import org.eclipse.hyades.internal.execution.security.SecureConnectionRequiredException; >+import org.eclipse.hyades.internal.execution.security.UntrustedAgentControllerException; >+import org.eclipse.hyades.security.internal.util.ConnectUtilUI; >+import org.eclipse.hyades.security.internal.util.IConnectUtilUser; >+import org.eclipse.tptp.platform.execution.client.core.IAgentController; >+import org.eclipse.tptp.platform.execution.security.User; >+import org.eclipse.tptp.platform.execution.util.internal.AgentControllerPool; >+ >+public class ACConnectionPool extends AgentControllerPool { >+ public static AgentControllerPool getInstance() { >+ if (instance == null) instance = new ACConnectionPool(); >+ return instance; >+ } >+ >+ public static IAgentController getACConnection(String hostName, int portNumber) throws Exception { >+ return getInstance().getConnection(hostName, portNumber); >+ } >+ >+ public static IAgentController getACConnection(String hostName, int portNumber, >+ boolean reuseExistingConnection) throws Exception { >+ >+ return getInstance().getConnection(hostName, portNumber, reuseExistingConnection); >+ } >+ >+ public User promptAuthentication(String hostName, String userName) { >+ ConnectUtilUI cui = new ConnectUtilUI(); >+ IConnectUtilUser cuUser = cui.promptAuthentication(hostName, userName); >+ if(cuUser == null) return null; >+ >+ return new User(null, cuUser.getName(), cuUser.getPassword()); >+ } >+ >+ public User findUser(String hostName) { >+ User user = findUserForHost (hostName); >+ if (user != null) return user; >+ >+ if ("localhost".equals(hostName)) >+ return findUserForHost (null); >+ >+ return null; >+ } >+ >+ private User findUserForHost (String hostName) { >+ org.eclipse.hyades.internal.execution.local.control.Node node; >+ >+ try { >+ if (hostName != null) >+ node = org.eclipse.hyades.internal.execution.local.control.NodeFactory.getNode(hostName, null); >+ else >+ node = org.eclipse.hyades.internal.execution.local.control.NodeFactory.getNode(InetAddress.getLocalHost(), null); >+ } catch (Exception e) { >+ node = null; >+ } >+ >+ if (node == null || !node.isConnected()) { >+ return null; >+ } >+ >+ org.eclipse.hyades.internal.execution.security.User hyadesUser = node.getUser(); >+ if (hyadesUser == null) { >+ return null; >+ } >+ // just to extract the password saving current hyades.User API >+ HyadesConnection con = new HyadesConnection(); >+ try { hyadesUser.login(con); } catch (Exception e) {} >+ >+ return con.getUser(); >+ } >+ >+ class HyadesConnection implements org.eclipse.hyades.internal.execution.local.control.Connection { >+ public User user = null; >+ >+ public void sendMessage(ControlMessage msg, CommandHandler handler) throws IOException { >+ int count = msg.getSize(); >+ if (count <= 1) return; >+ >+ org.eclipse.hyades.internal.execution.local.common.CommandElement ce = msg.getCommand(0); >+ if (!(ce instanceof org.eclipse.hyades.internal.execution.local.common.AuthenticateCommand)) return; >+ >+ org.eclipse.hyades.internal.execution.local.common.AuthenticateCommand acmd = >+ (org.eclipse.hyades.internal.execution.local.common.AuthenticateCommand) ce; >+ >+ byte buf[] = new byte[acmd.getSize()]; >+ acmd.writeToBuffer(buf, 0); >+ >+ org.eclipse.hyades.internal.execution.local.common.RAString hyadesName = >+ new org.eclipse.hyades.internal.execution.local.common.RAString(); >+ >+ org.eclipse.hyades.internal.execution.local.common.RAString hyadesPsw = >+ new org.eclipse.hyades.internal.execution.local.common.RAString(); >+ >+ int offset = org.eclipse.hyades.internal.execution.local.common.Message.readRAStringFromBuffer(buf, 4, hyadesName); >+ org.eclipse.hyades.internal.execution.local.common.Message.readRAStringFromBuffer(buf, offset, hyadesPsw); >+ >+ user = new User(null, hyadesName.getData(), hyadesPsw.getData()); >+ } >+ >+ public void addAuthenticationListener(AuthenticationListener listener) {} >+ public void addConnectionListener(ConnectionListener listener) {} >+ public void connect(Node node, int port) throws IOException,SecureConnectionRequiredException, LoginFailedException, >+ UntrustedAgentControllerException { >+ } >+ public void disconnect() {} >+ public Node getNode() { return null; } >+ public int getPort() { return 0; } >+ public boolean isActive() { return false; } >+ public void removeAuthenticationListener(AuthenticationListener listener) {} >+ public void removeConnectionListener(ConnectionListener listener) {} >+ >+ public User getUser() { return user; } >+ } >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 195644
:
73419
|
73421
|
73422
|
73423
|
73425
|
73429
|
77241
|
77242
|
77243
|
80051
|
80132
|
80870
|
84612
|
84631