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 77242 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]
updated platform.common.ui patch
pci.txt (text/plain), 7.11 KB, created by
Igor Alelekov
on 2007-08-29 08:26:16 EDT
(
hide
)
Description:
updated platform.common.ui patch
Filename:
MIME Type:
Creator:
Igor Alelekov
Created:
2007-08-29 08:26:16 EDT
Size:
7.11 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.common.ui >Index: src-common-internal/org/eclipse/tptp/platform/common/ui/internal/CommonUIPlugin.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.common.ui/src-common-internal/org/eclipse/tptp/platform/common/ui/internal/CommonUIPlugin.java,v >retrieving revision 1.7 >diff -u -r1.7 CommonUIPlugin.java >--- src-common-internal/org/eclipse/tptp/platform/common/ui/internal/CommonUIPlugin.java 29 May 2007 22:32:54 -0000 1.7 >+++ src-common-internal/org/eclipse/tptp/platform/common/ui/internal/CommonUIPlugin.java 29 Aug 2007 09:32:21 -0000 >@@ -27,6 +27,8 @@ > import org.eclipse.jface.preference.IPreferenceStore; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.tptp.platform.common.internal.CommonPlugin; >+import org.eclipse.tptp.platform.common.ui.internal.util.UIAgentControllerFactory; >+import org.eclipse.tptp.platform.execution.util.internal.AgentControllerPool; > import org.eclipse.ui.IPerspectiveDescriptor; > import org.eclipse.ui.IPerspectiveRegistry; > import org.eclipse.ui.IPluginContribution; >@@ -101,6 +103,8 @@ > { > SDImages.initializeImages(SDImages.INSTANCE, this); > } >+ >+ AgentControllerPool.setAgentControllerFactory(new UIAgentControllerFactory()); > } > > /* >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.common.ui/META-INF/MANIFEST.MF,v >retrieving revision 1.13 >diff -u -r1.13 MANIFEST.MF >--- META-INF/MANIFEST.MF 8 Aug 2007 22:25:01 -0000 1.13 >+++ META-INF/MANIFEST.MF 29 Aug 2007 09:32:21 -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/UIAgentControllerFactory.java >=================================================================== >RCS file: src-common-internal/org/eclipse/tptp/platform/common/ui/internal/util/UIAgentControllerFactory.java >diff -N src-common-internal/org/eclipse/tptp/platform/common/ui/internal/util/UIAgentControllerFactory.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src-common-internal/org/eclipse/tptp/platform/common/ui/internal/util/UIAgentControllerFactory.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,107 @@ >+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.security.User; >+import org.eclipse.tptp.platform.execution.util.internal.AgentControllerFactory; >+ >+public class UIAgentControllerFactory extends AgentControllerFactory { >+ 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