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 80305 Details for
Bug 200634
make "Save Password" to keyring optional, similar to Team/CVS approach
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]
New Dialog and new JUnit Test
patch200634.txt (text/plain), 46.49 KB, created by
Frank Becker
on 2007-10-13 17:59:33 EDT
(
hide
)
Description:
New Dialog and new JUnit Test
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2007-10-13 17:59:33 EDT
Size:
46.49 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.bugzilla.tests >Index: src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java,v >retrieving revision 1.25 >diff -u -r1.25 RepositoryEditorWizardTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java 26 Jun 2007 01:16:22 -0000 1.25 >+++ src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java 13 Oct 2007 21:48:05 -0000 >@@ -44,7 +44,7 @@ > manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); > repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > Credentials credentials = TestUtil.readCredentials(); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > repository.setAnonymous(false); > TasksUiPlugin.getRepositoryManager().addRepository(repository, > TasksUiPlugin.getDefault().getRepositoriesFilePath()); >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java,v >retrieving revision 1.120 >diff -u -r1.120 BugzillaRepositoryConnectorTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java 11 Sep 2007 01:57:30 -0000 1.120 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java 13 Oct 2007 21:48:05 -0000 >@@ -44,11 +44,7 @@ > */ > public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { > >-// testReassign Bugs >-// Version BugNr assigned reporter >-// 2.22 92 user@mylar.eclipse.org tests@mylar.eclipse.org >-// 3.0 5 tests@mylar.eclipse.org tests2@mylar.eclipse.org >-// 3.1 1 rob.elves@eclipse.org tests@mylar.eclipse.org >+ > > public void testReassign222() throws CoreException { > init222(); >@@ -61,6 +57,12 @@ > String taskNumber = "5"; > doReassignOld(taskNumber, "tests@mylyn.eclipse.org"); > } >+ >+ public void testReassign30MemoryonlyPassword() throws CoreException { >+ init30MemoryonlyPassword(); >+ String taskNumber = "5"; >+ doReassignOld(taskNumber, "tests@mylyn.eclipse.org"); >+ } > > public void testReassign31() throws CoreException { > init31(); >@@ -235,7 +237,7 @@ > public void testAnonymousRepositoryAccess() throws Exception { > init218(); > assertNotNull(repository); >- repository.setAuthenticationCredentials("", ""); >+ repository.setAuthenticationCredentials("", "", true); > // test anonymous task retrieval > BugzillaTask task = this.generateLocalTaskAndDownload("2"); > assertNotNull(task); >@@ -307,7 +309,7 @@ > assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); > sourceContextFile.createNewFile(); > sourceContextFile.deleteOnExit(); >- repository.setAuthenticationCredentials("wrong", "wrong"); >+ repository.setAuthenticationCredentials("wrong", "wrong", true); > try { > connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor()); > } catch (CoreException e) { >Index: src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java,v >retrieving revision 1.32 >diff -u -r1.32 AbstractBugzillaTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java 4 Sep 2007 20:49:17 -0000 1.32 >+++ src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java 13 Oct 2007 21:47:58 -0000 >@@ -71,34 +71,38 @@ > } > > protected void init31() { >- init(IBugzillaConstants.TEST_BUGZILLA_31_URL); >+ init(IBugzillaConstants.TEST_BUGZILLA_31_URL, true); > } > > protected void init30() { >- init(IBugzillaConstants.TEST_BUGZILLA_30_URL); >+ init(IBugzillaConstants.TEST_BUGZILLA_30_URL, true); >+ } >+ >+ protected void init30MemoryonlyPassword() { >+ init(IBugzillaConstants.TEST_BUGZILLA_30_URL, false); > } > > protected void init222() { >- init(IBugzillaConstants.TEST_BUGZILLA_222_URL); >+ init(IBugzillaConstants.TEST_BUGZILLA_222_URL, true); > } > > protected void init2201() { >- init(IBugzillaConstants.TEST_BUGZILLA_2201_URL); >+ init(IBugzillaConstants.TEST_BUGZILLA_2201_URL, true); > } > > protected void init220() { >- init(IBugzillaConstants.TEST_BUGZILLA_220_URL); >+ init(IBugzillaConstants.TEST_BUGZILLA_220_URL, true); > } > > protected void init218() { >- init(IBugzillaConstants.TEST_BUGZILLA_218_URL); >+ init(IBugzillaConstants.TEST_BUGZILLA_218_URL, true); > } > > @SuppressWarnings("deprecation") >- protected void init(String url) { >+ protected void init(String url, boolean useKeyring) { > repository = new TaskRepository(DEFAULT_KIND, url); > Credentials credentials = TestUtil.readCredentials(); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, useKeyring); > > repository.setTimeZoneId("Canada/Eastern"); > assertNotNull(manager); >Index: src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java,v >retrieving revision 1.39 >diff -u -r1.39 RepositoryReportFactoryTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java 26 Jun 2007 01:16:22 -0000 1.39 >+++ src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java 13 Oct 2007 21:48:11 -0000 >@@ -49,7 +49,7 @@ > BugzillaCorePlugin.REPOSITORY_KIND); > repository = new TaskRepository(kind, url); > Credentials credentials = TestUtil.readCredentials(); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > return repository; > } > >@@ -58,7 +58,7 @@ > String errorMessage = ""; > try { > setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); >- repository.setAuthenticationCredentials("invalid", "invalid"); >+ repository.setAuthenticationCredentials("invalid", "invalid", true); > init(bugid); > } catch (CoreException e) { > errorMessage = e.getStatus().getMessage(); >Index: src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java,v >retrieving revision 1.33 >diff -u -r1.33 BugzillaProductParserTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java 10 Jul 2007 00:29:34 -0000 1.33 >+++ src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java 13 Oct 2007 21:48:00 -0000 >@@ -45,7 +45,7 @@ > private TaskRepository setRepository(String url) { > repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, url); > Credentials credentials = TestUtil.readCredentials(); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > return repository; > } > >Index: src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java,v >retrieving revision 1.9 >diff -u -r1.9 BugzillaTaskHistoryTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java 26 Jun 2007 01:16:21 -0000 1.9 >+++ src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java 13 Oct 2007 21:48:11 -0000 >@@ -47,7 +47,7 @@ > repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > > Credentials credentials = TestUtil.readCredentials(); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > } > > public void testGetBugHistory() throws Exception { >Index: src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java,v >retrieving revision 1.37 >diff -u -r1.37 BugzillaQueryTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java 26 Jun 2007 01:16:21 -0000 1.37 >+++ src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java 13 Oct 2007 21:48:11 -0000 >@@ -55,7 +55,7 @@ > handler = connector.getTaskDataHandler(); > repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL); > Credentials credentials = TestUtil.readCredentials(); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > } > > /** >@@ -64,7 +64,7 @@ > public void testAddCredentials() { > if (!repository.hasCredentials()) { > Credentials credentials = TestUtil.readCredentials(); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > > assertTrue(repository.hasCredentials()); > } >#P org.eclipse.mylyn.tests >Index: src/org/eclipse/mylyn/tests/integration/LiveWebConnectorTemplatesTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tests/src/org/eclipse/mylyn/tests/integration/LiveWebConnectorTemplatesTest.java,v >retrieving revision 1.14 >diff -u -r1.14 LiveWebConnectorTemplatesTest.java >--- src/org/eclipse/mylyn/tests/integration/LiveWebConnectorTemplatesTest.java 15 Jul 2007 14:56:54 -0000 1.14 >+++ src/org/eclipse/mylyn/tests/integration/LiveWebConnectorTemplatesTest.java 13 Oct 2007 21:48:15 -0000 >@@ -75,9 +75,9 @@ > String url = repository.getUrl(); > // HACK: repositories that require auth > if ("http://demo.otrs.org".equals(url)) { >- repository.setAuthenticationCredentials("skywalker", "skywalker"); >+ repository.setAuthenticationCredentials("skywalker", "skywalker", true); > } else if ("http://changelogic.araneaframework.org".equals(url)) { >- repository.setAuthenticationCredentials("mylar2", "mylar123"); >+ repository.setAuthenticationCredentials("mylar2", "mylar123", true); > } > > String queryUrlTemplate = template.taskQueryUrl; >#P org.eclipse.mylyn.jira.tests >Index: src/org/eclipse/mylyn/jira/tests/JiraTaskDataHandlerTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.jira.tests/src/org/eclipse/mylyn/jira/tests/JiraTaskDataHandlerTest.java,v >retrieving revision 1.13 >diff -u -r1.13 JiraTaskDataHandlerTest.java >--- src/org/eclipse/mylyn/jira/tests/JiraTaskDataHandlerTest.java 20 Sep 2007 22:20:46 -0000 1.13 >+++ src/org/eclipse/mylyn/jira/tests/JiraTaskDataHandlerTest.java 13 Oct 2007 21:48:22 -0000 >@@ -74,7 +74,7 @@ > Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); > > repository = new TaskRepository(kind, url); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); > > connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(kind); >Index: src/org/eclipse/mylyn/jira/tests/JiraClientFacadeTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.jira.tests/src/org/eclipse/mylyn/jira/tests/JiraClientFacadeTest.java,v >retrieving revision 1.9 >diff -u -r1.9 JiraClientFacadeTest.java >--- src/org/eclipse/mylyn/jira/tests/JiraClientFacadeTest.java 16 Sep 2007 07:16:39 -0000 1.9 >+++ src/org/eclipse/mylyn/jira/tests/JiraClientFacadeTest.java 13 Oct 2007 21:48:20 -0000 >@@ -52,11 +52,11 @@ > public void testChangeCredentials() throws Exception { > Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); > TaskRepository repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > TasksUiPlugin.getRepositoryManager().addRepository(repository, > TasksUiPlugin.getDefault().getRepositoriesFilePath()); > >- repository.setAuthenticationCredentials("Bogus User", "Bogus Password"); >+ repository.setAuthenticationCredentials("Bogus User", "Bogus Password", true); > jiraFacade.repositoryRemoved(repository); > > try { >@@ -67,7 +67,7 @@ > } > > // check that it works after putting the right password in >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > jiraFacade.repositoryRemoved(repository); > jiraFacade.getJiraClient(repository).getNamedFilters(); > } >@@ -104,7 +104,7 @@ > public void testCharacterEncoding() throws Exception { > Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); > TaskRepository repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > assertFalse(JiraUtils.getCharacterEncodingValidated(repository)); > > JiraClient client = jiraFacade.getJiraClient(repository); >Index: src/org/eclipse/mylyn/jira/tests/JiraStackTraceDuplicateDetectorTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.jira.tests/src/org/eclipse/mylyn/jira/tests/JiraStackTraceDuplicateDetectorTest.java,v >retrieving revision 1.1 >diff -u -r1.1 JiraStackTraceDuplicateDetectorTest.java >--- src/org/eclipse/mylyn/jira/tests/JiraStackTraceDuplicateDetectorTest.java 2 Aug 2007 05:06:39 -0000 1.1 >+++ src/org/eclipse/mylyn/jira/tests/JiraStackTraceDuplicateDetectorTest.java 13 Oct 2007 21:48:21 -0000 >@@ -69,7 +69,7 @@ > > Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); > repository = new TaskRepository(kind, url); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > > manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); > >Index: src/org/eclipse/mylyn/jira/tests/JiraTaskExternalizationTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.jira.tests/src/org/eclipse/mylyn/jira/tests/JiraTaskExternalizationTest.java,v >retrieving revision 1.61 >diff -u -r1.61 JiraTaskExternalizationTest.java >--- src/org/eclipse/mylyn/jira/tests/JiraTaskExternalizationTest.java 10 Jul 2007 00:29:38 -0000 1.61 >+++ src/org/eclipse/mylyn/jira/tests/JiraTaskExternalizationTest.java 13 Oct 2007 21:48:24 -0000 >@@ -61,7 +61,7 @@ > protected void setUp() throws Exception { > super.setUp(); > repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, SERVER_URL); >- repository.setAuthenticationCredentials(USER, PASSWORD); >+ repository.setAuthenticationCredentials(USER, PASSWORD, true); > TasksUiPlugin.getRepositoryManager().addRepository(repository, > TasksUiPlugin.getDefault().getRepositoriesFilePath()); > TasksUiPlugin.getTaskListManager().resetTaskList(); >Index: src/org/eclipse/mylyn/jira/tests/JiraRepositoryConnectorTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.jira.tests/src/org/eclipse/mylyn/jira/tests/JiraRepositoryConnectorTest.java,v >retrieving revision 1.39 >diff -u -r1.39 JiraRepositoryConnectorTest.java >--- src/org/eclipse/mylyn/jira/tests/JiraRepositoryConnectorTest.java 21 Sep 2007 00:35:41 -0000 1.39 >+++ src/org/eclipse/mylyn/jira/tests/JiraRepositoryConnectorTest.java 13 Oct 2007 21:48:21 -0000 >@@ -89,7 +89,7 @@ > > Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); > repository = new TaskRepository(kind, url); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > > manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); > >Index: src/org/eclipse/mylyn/jira/tests/JiraAttachmentHandlerTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.jira.tests/src/org/eclipse/mylyn/jira/tests/JiraAttachmentHandlerTest.java,v >retrieving revision 1.16 >diff -u -r1.16 JiraAttachmentHandlerTest.java >--- src/org/eclipse/mylyn/jira/tests/JiraAttachmentHandlerTest.java 16 Sep 2007 04:03:54 -0000 1.16 >+++ src/org/eclipse/mylyn/jira/tests/JiraAttachmentHandlerTest.java 13 Oct 2007 21:48:18 -0000 >@@ -72,7 +72,7 @@ > } > > repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > repository.setCharacterEncoding(JiraClient.DEFAULT_CHARSET); > > TasksUiPlugin.getRepositoryManager().addRepository(repository, >Index: src/org/eclipse/mylyn/jira/tests/JiraFilterTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.jira.tests/src/org/eclipse/mylyn/jira/tests/JiraFilterTest.java,v >retrieving revision 1.55 >diff -u -r1.55 JiraFilterTest.java >--- src/org/eclipse/mylyn/jira/tests/JiraFilterTest.java 16 Sep 2007 04:03:54 -0000 1.55 >+++ src/org/eclipse/mylyn/jira/tests/JiraFilterTest.java 13 Oct 2007 21:48:20 -0000 >@@ -77,7 +77,7 @@ > } > > repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > repository.setCharacterEncoding(JiraClient.DEFAULT_CHARSET); > > TasksUiPlugin.getRepositoryManager().addRepository(repository, >#P org.eclipse.mylyn.trac.tests >Index: src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java,v >retrieving revision 1.26 >diff -u -r1.26 RepositorySearchQueryTest.java >--- src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java 10 Jul 2007 00:31:00 -0000 1.26 >+++ src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java 13 Oct 2007 21:48:24 -0000 >@@ -60,7 +60,7 @@ > Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); > > repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > repository.setTimeZoneId(ITracClient.TIME_ZONE); > repository.setCharacterEncoding(ITracClient.CHARSET); > repository.setVersion(version.name()); >Index: src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java,v >retrieving revision 1.29 >diff -u -r1.29 TracAttachmentHandlerTest.java >--- src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java 10 Jul 2007 00:31:00 -0000 1.29 >+++ src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java 13 Oct 2007 21:48:27 -0000 >@@ -70,7 +70,7 @@ > Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); > > repository = new TaskRepository(kind, url); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > repository.setTimeZoneId(ITracClient.TIME_ZONE); > repository.setCharacterEncoding(ITracClient.CHARSET); > repository.setVersion(version.name()); >Index: src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java,v >retrieving revision 1.63 >diff -u -r1.63 TracRepositoryConnectorTest.java >--- src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java 10 Jul 2007 00:31:00 -0000 1.63 >+++ src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java 13 Oct 2007 21:48:28 -0000 >@@ -86,7 +86,7 @@ > Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); > > repository = new TaskRepository(kind, url); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > repository.setTimeZoneId(ITracClient.TIME_ZONE); > repository.setCharacterEncoding(ITracClient.CHARSET); > repository.setVersion(version.name()); >Index: src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.trac.tests/src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java,v >retrieving revision 1.20 >diff -u -r1.20 TracTaskDataHandlerTest.java >--- src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java 24 Aug 2007 15:56:10 -0000 1.20 >+++ src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java 13 Oct 2007 21:48:28 -0000 >@@ -76,7 +76,7 @@ > Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER); > > repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url); >- repository.setAuthenticationCredentials(credentials.username, credentials.password); >+ repository.setAuthenticationCredentials(credentials.username, credentials.password, true); > repository.setTimeZoneId(ITracClient.TIME_ZONE); > repository.setCharacterEncoding(ITracClient.CHARSET); > repository.setVersion(version.name()); >@@ -257,7 +257,7 @@ > task.getTaskId()); > > taskData.setNewComment("new comment"); >- repository.setAuthenticationCredentials("foo", "bar"); >+ repository.setAuthenticationCredentials("foo", "bar", true); > try { > taskDataHandler.postTaskData(repository, taskData, new NullProgressMonitor()); > } catch (CoreException expected) { >#P org.eclipse.mylyn.tasks.ui >Index: src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java,v >retrieving revision 1.147 >diff -u -r1.147 TasksUiPlugin.java >--- src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java 11 Oct 2007 23:07:08 -0000 1.147 >+++ src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java 13 Oct 2007 21:48:32 -0000 >@@ -34,6 +34,7 @@ > import org.eclipse.jface.preference.IPreferenceStore; > import org.eclipse.jface.resource.ImageDescriptor; > import org.eclipse.jface.text.hyperlink.IHyperlinkDetector; >+import org.eclipse.jface.window.Window; > import org.eclipse.jface.wizard.WizardDialog; > import org.eclipse.mylyn.context.core.ContextCorePlugin; > import org.eclipse.mylyn.internal.context.core.ContextPreferenceContstants; >@@ -41,6 +42,7 @@ > import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer; > import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager; > import org.eclipse.mylyn.internal.tasks.core.TaskDataManager; >+import org.eclipse.mylyn.internal.tasks.ui.EnterMemoryPassordDialog; > import org.eclipse.mylyn.internal.tasks.ui.IDynamicSubMenuContributor; > import org.eclipse.mylyn.internal.tasks.ui.ITaskHighlighter; > import org.eclipse.mylyn.internal.tasks.ui.ITaskListNotification; >@@ -1076,4 +1078,24 @@ > } > } > >+ public static void testAndSetMemoryOnlyPassword(TaskRepository repository) { >+ boolean memoryOnlyPassword = repository.isMemoryOnlyPassword(); >+ boolean doIt = memoryOnlyPassword && repository.getCachedPassword() == null; >+ if (doIt) { >+ EnterMemoryPassordDialog dialog = new EnterMemoryPassordDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), repository.getRepositoryLabel(), "Please set the memoryonly Password", repository.getUserName(), !memoryOnlyPassword); >+ int result = dialog.open(); >+ if (result == Window.OK) { >+ String password = dialog.getPassword(); >+ String username = dialog.getUsername(); >+ boolean allowCaching = dialog.getAllowCaching(); >+ if (password != null && username != null) >+ repository.setAuthenticationCredentials(username, password, allowCaching); >+ if (memoryOnlyPassword != allowCaching) >+ repository.setMemoryOnlyPassword(!allowCaching); >+ >+ } >+ } >+ } >+ >+ > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java,v >retrieving revision 1.20 >diff -u -r1.20 EditRepositoryWizard.java >--- src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java 26 Jun 2007 01:16:40 -0000 1.20 >+++ src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java 13 Oct 2007 21:48:30 -0000 >@@ -57,8 +57,10 @@ > repository.setVersion(abstractRepositorySettingsPage.getVersion()); > repository.setCharacterEncoding(abstractRepositorySettingsPage.getCharacterEncoding()); > repository.setAuthenticationCredentials(abstractRepositorySettingsPage.getUserName(), >- abstractRepositorySettingsPage.getPassword()); >+ abstractRepositorySettingsPage.getPassword(), true); > repository.setRepositoryLabel(abstractRepositorySettingsPage.getRepositoryLabel()); >+ repository.setMemoryOnlyPassword(abstractRepositorySettingsPage.getMemoryonlyPassword()); >+ > repository.setAnonymous(abstractRepositorySettingsPage.isAnonymousAccess()); > repository.setHttpAuthenticationCredentials(abstractRepositorySettingsPage.getHttpAuthUserId(), > abstractRepositorySettingsPage.getHttpAuthPassword()); >Index: src/org/eclipse/mylyn/internal/tasks/ui/ScheduledTaskListSynchJob.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduledTaskListSynchJob.java,v >retrieving revision 1.26 >diff -u -r1.26 ScheduledTaskListSynchJob.java >--- src/org/eclipse/mylyn/internal/tasks/ui/ScheduledTaskListSynchJob.java 6 Sep 2007 03:19:29 -0000 1.26 >+++ src/org/eclipse/mylyn/internal/tasks/ui/ScheduledTaskListSynchJob.java 13 Oct 2007 21:48:29 -0000 >@@ -55,6 +55,14 @@ > this.taskListManager = taskListManager; > this.setSystem(true); > this.setPriority(Job.BUILD); >+ >+ if (repositories == null) { >+ repositories = TasksUiPlugin.getRepositoryManager().getAllRepositories(); >+ } >+ >+ for (final TaskRepository repository : repositories) { >+ TasksUiPlugin.testAndSetMemoryOnlyPassword(repository); >+ } > } > > public ScheduledTaskListSynchJob(TaskListManager taskListManager) { >@@ -62,10 +70,19 @@ > this.taskListManager = taskListManager; > this.setPriority(Job.BUILD); > this.scheduleDelay = -1; >+ >+ if (repositories == null) { >+ repositories = TasksUiPlugin.getRepositoryManager().getAllRepositories(); >+ } >+ >+ for (final TaskRepository repository : repositories) { >+ TasksUiPlugin.testAndSetMemoryOnlyPassword(repository); >+ } > } > > @Override > public IStatus run(final IProgressMonitor monitor) { >+ > try { > taskList = taskListManager.getTaskList(); > if (repositories == null) { >@@ -83,6 +100,7 @@ > continue; > } > >+ > final AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() > .getRepositoryConnector(repository.getConnectorKind()); > if (connector == null) { >Index: src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java,v >retrieving revision 1.32 >diff -u -r1.32 AbstractRepositorySettingsPage.java >--- src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java 11 Sep 2007 22:26:52 -0000 1.32 >+++ src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java 13 Oct 2007 21:48:36 -0000 >@@ -188,6 +188,9 @@ > > private Hyperlink manageAccountHyperlink; > >+ protected Button memoryonlyPasswordButton; >+ >+ > public AbstractRepositorySettingsPage(String title, String description, AbstractRepositoryConnectorUi repositoryUi) { > super(title); > super.setTitle(title); >@@ -318,6 +321,18 @@ > }); > } > >+ memoryonlyPasswordButton = new Button(compositeContainer, SWT.CHECK); >+ GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(memoryonlyPasswordButton); >+ >+ memoryonlyPasswordButton.setText("Memoryonly Password"); >+ memoryonlyPasswordButton.addSelectionListener(new SelectionAdapter() { >+ @Override >+ public void widgetSelected(SelectionEvent e) { >+ setMemoryOnly(memoryonlyPasswordButton.getSelection()); >+ isPageComplete(); >+ } >+ }); >+ > repositoryUserNameEditor = new StringFieldEditor("", LABEL_USER, StringFieldEditor.UNLIMITED, > compositeContainer) { > >@@ -377,6 +392,13 @@ > setAnonymous(true); > } > } >+ >+ if (repository != null) { >+ memoryonlyPasswordButton.setSelection(repository.isMemoryOnlyPassword()); >+ } else { >+ memoryonlyPasswordButton.setSelection(false); >+ } >+ > > // TODO: put this back if we can't get the info from all connectors > // if (needsTimeZone()) { >@@ -832,6 +854,23 @@ > } > } > >+ public void setMemoryOnly(boolean selected) { >+ >+ memoryonlyPasswordButton.setSelection(selected); >+ >+ if (selected) { >+ oldPassword = (repositoryPasswordEditor).getStringValue(); >+ repositoryPasswordEditor.setStringValue(""); >+ } else { >+ repositoryPasswordEditor.setStringValue(oldPassword); >+ } >+ >+ repositoryPasswordEditor.setEnabled(!selected, compositeContainer); >+ if (getWizard() != null) { >+ getWizard().getContainer().updateButtons(); >+ } >+ } >+ > public void setHttpAuth(boolean selected) { > if (!needsHttpAuth) { > return; >@@ -1042,9 +1081,9 @@ > > private String credentialsComplete() { > if ((needsAnonymousLogin() && !anonymousButton.getSelection()) >- && (repositoryUserNameEditor.getStringValue().trim().equals("") || repositoryPasswordEditor.getStringValue() >+ && (repositoryUserNameEditor.getStringValue().trim().equals("") || (repositoryPasswordEditor.getStringValue() > .trim() >- .equals(""))) { >+ .equals("")) ) && !memoryonlyPasswordButton.getSelection()) { > return "Repository user name and password must not be blank"; > } > return null; >@@ -1118,10 +1157,11 @@ > TaskRepository repository = new TaskRepository(connector.getConnectorKind(), getServerUrl(), getVersion(), > getCharacterEncoding(), ""); > repository.setRepositoryLabel(getRepositoryLabel()); >- repository.setAuthenticationCredentials(getUserName(), getPassword()); >+ repository.setAuthenticationCredentials(getUserName(), getPassword(), true); > if (needsAnonymousLogin()) { > repository.setAnonymous(anonymousButton.getSelection()); > } >+ repository.setMemoryOnlyPassword(memoryonlyPasswordButton.getSelection()); > // repository.setProperty(TaskRepository.AUTH_HTTP_USERNAME, > // getHttpAuthUserId()); > // repository.setProperty(TaskRepository.AUTH_HTTP_PASSWORD, >@@ -1314,4 +1354,8 @@ > > } > >+ public Boolean getMemoryonlyPassword() { >+ return memoryonlyPasswordButton.getSelection(); >+ } >+ > } >Index: src/org/eclipse/mylyn/internal/tasks/ui/EnterMemoryPassordDialog.java >=================================================================== >RCS file: src/org/eclipse/mylyn/internal/tasks/ui/EnterMemoryPassordDialog.java >diff -N src/org/eclipse/mylyn/internal/tasks/ui/EnterMemoryPassordDialog.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/internal/tasks/ui/EnterMemoryPassordDialog.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,277 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2007 Mylyn project committers and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.internal.tasks.ui; >+ >+import org.eclipse.jface.dialogs.Dialog; >+import org.eclipse.jface.dialogs.IDialogConstants; >+import org.eclipse.jface.window.Window; >+import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.events.SelectionAdapter; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.graphics.Image; >+import org.eclipse.swt.layout.GridData; >+import org.eclipse.swt.layout.GridLayout; >+import org.eclipse.swt.widgets.Button; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; >+import org.eclipse.swt.widgets.Label; >+import org.eclipse.swt.widgets.Shell; >+import org.eclipse.swt.widgets.Text; >+ >+/** >+ * This Dialog is used to enter a memory only Password for TaskRepositories. >+ * >+ * Based on org.eclipse.jsch.internal.ui.UserValidationDialog >+ * >+ * @author Frank Becker >+ * @since 2.2 >+ */ >+public class EnterMemoryPassordDialog extends Dialog { >+ // widgets >+ protected Text usernameField; >+ >+ protected Text passwordField; >+ >+ protected Button allowCachingButton; >+ >+ protected String domain; >+ >+ protected String defaultUsername; >+ >+ protected String password = null; >+ >+ protected boolean allowCaching = false; >+ >+ protected boolean defaultAllowCaching; >+ >+ protected Image keyLockImage; >+ >+ protected String username = null; >+ >+ protected String message = null; >+ >+ /** >+ * Creates a new EnterMemoryPassordDialog. >+ * >+ * @param parentShell the parent shell >+ * @param repositoryName the name of the repository >+ * @param message a message to display to the user >+ * @param defaultName the default user name >+ * @param defaultAllowCaching TODO >+ */ >+ public EnterMemoryPassordDialog(Shell parentShell, String repositoryName, String message, String defaultName, boolean defaultAllowCaching) { >+ super(parentShell); >+ setShellStyle(getShellStyle() | SWT.RESIZE); >+ this.defaultUsername = defaultName; >+ this.domain = repositoryName; >+ this.message = message; >+ this.defaultAllowCaching = defaultAllowCaching; >+ } >+ >+ /** >+ * @see Window#configureShell >+ */ >+ protected void configureShell(Shell newShell) { >+ super.configureShell(newShell); >+ newShell.setText("Password Required"); >+ } >+ >+ /** >+ * @see Window#create >+ */ >+ public void create() { >+ super.create(); >+ // add some default values >+ usernameField.setText(defaultUsername); >+ allowCachingButton.setSelection(defaultAllowCaching); >+ >+ // give focus to user name field >+ usernameField.selectAll(); >+ usernameField.setFocus(); >+ } >+ >+ /** >+ * @see Dialog#createDialogArea >+ */ >+ protected Control createDialogArea(Composite parent) { >+ Composite top = new Composite(parent, SWT.NONE); >+ GridLayout layout = new GridLayout(); >+ layout.numColumns = 2; >+ >+ top.setLayout(layout); >+ top.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ Composite imageComposite = new Composite(top, SWT.NONE); >+ layout = new GridLayout(); >+ imageComposite.setLayout(layout); >+ imageComposite.setLayoutData(new GridData(GridData.FILL_VERTICAL)); >+ >+ Composite main = new Composite(top, SWT.NONE); >+ layout = new GridLayout(); >+ layout.numColumns = 3; >+ main.setLayout(layout); >+ main.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ Label imageLabel = new Label(imageComposite, SWT.NONE); >+ keyLockImage = TasksUiPlugin.imageDescriptorFromPlugin(TasksUiPlugin.ID_PLUGIN, "icons/wizban/keylock.gif") >+ .createImage(); >+ imageLabel.setImage(keyLockImage); >+ GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); >+ imageLabel.setLayoutData(data); >+ >+ if (message != null) { >+ Label messageLabel = new Label(main, SWT.WRAP); >+ messageLabel.setText(message); >+ data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); >+ data.horizontalSpan = 3; >+ data.widthHint = 300; >+ messageLabel.setLayoutData(data); >+ } >+ if (domain != null) { >+ Label d = new Label(main, SWT.WRAP); >+ d.setText("Task Repository:"); >+ data = new GridData(); >+ d.setLayoutData(data); >+ Label label = new Label(main, SWT.WRAP); >+ label.setText(domain); >+ data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); >+ data.horizontalSpan = 2; >+ data.widthHint = 300; >+ label.setLayoutData(data); >+ } >+ createUsernameFields(main); >+ createPasswordFields(main); >+ >+ if (domain != null) { >+ allowCachingButton = new Button(main, SWT.CHECK); >+ allowCachingButton.setText("&Save password"); >+ data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL); >+ data.horizontalSpan = 3; >+ allowCachingButton.setLayoutData(data); >+ allowCachingButton.addSelectionListener(new SelectionAdapter() { >+ public void widgetSelected(SelectionEvent e) { >+ allowCaching = allowCachingButton.getSelection(); >+ } >+ }); >+ Composite warningComposite = new Composite(main, SWT.NONE); >+ layout = new GridLayout(); >+ layout.numColumns = 2; >+ layout.marginHeight = 0; >+ layout.marginHeight = 0; >+ warningComposite.setLayout(layout); >+ data = new GridData(GridData.FILL_HORIZONTAL); >+ data.horizontalSpan = 3; >+ warningComposite.setLayoutData(data); >+ Label warningLabel = new Label(warningComposite, SWT.NONE); >+ warningLabel.setImage(getImage(DLG_IMG_MESSAGE_WARNING)); >+ warningLabel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING >+ | GridData.HORIZONTAL_ALIGN_BEGINNING)); >+ Label warningText = new Label(warningComposite, SWT.WRAP); >+ warningText.setText("Saved passwords are stored on your computer in a file that is difficult, but not impossible, for an intruder to read."); >+ data = new GridData(GridData.FILL_HORIZONTAL); >+ data.widthHint = 300; >+ warningText.setLayoutData(data); >+ } >+ >+ Dialog.applyDialogFont(parent); >+ >+ return main; >+ } >+ >+ /** >+ * Creates the three widgets that represent the password entry area. >+ * >+ * @param parent the parent of the widgets >+ */ >+ protected void createPasswordFields(Composite parent) { >+ new Label(parent, SWT.NONE).setText("&Password:"); >+ >+ passwordField = new Text(parent, SWT.BORDER | SWT.PASSWORD); >+ GridData data = new GridData(GridData.FILL_HORIZONTAL); >+ data.horizontalSpan = 2; >+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH); >+ passwordField.setLayoutData(data); >+ } >+ >+ /** >+ * Creates the three widgets that represent the user name entry area. >+ * >+ * @param parent the parent of the widgets >+ */ >+ protected void createUsernameFields(Composite parent) { >+ new Label(parent, SWT.NONE).setText("&User name:"); >+ >+ usernameField = new Text(parent, SWT.BORDER); >+ GridData data = new GridData(GridData.FILL_HORIZONTAL); >+ data.horizontalSpan = 2; >+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH); >+ usernameField.setLayoutData(data); >+ } >+ >+ /** >+ * Returns the password entered by the user, or null >+ * if the user canceled. >+ * >+ * @return the entered password >+ */ >+ public String getPassword() { >+ return password; >+ } >+ >+ /** >+ * Returns the user name entered by the user, or null >+ * if the user canceled. >+ * >+ * @return the entered user name >+ */ >+ public String getUsername() { >+ return username; >+ } >+ >+ /** >+ * Returns <code>true</code> if the save password checkbox was selected. >+ * @return <code>true</code> if the save password checkbox was selected and <code>false</code> >+ * otherwise. >+ */ >+ public boolean getAllowCaching() { >+ return allowCaching; >+ } >+ >+ /** >+ * Notifies that the ok button of this dialog has been pressed. >+ * <p> >+ * The default implementation of this framework method sets >+ * this dialog's return code to <code>Window.OK</code> >+ * and closes the dialog. Subclasses may override. >+ * </p> >+ */ >+ protected void okPressed() { >+ password = passwordField.getText(); >+ username = usernameField.getText(); >+ >+ super.okPressed(); >+ } >+ >+ protected void cancelPressed() { >+ password = null; >+ username = null; >+ super.cancelPressed(); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.dialogs.Dialog#close() >+ */ >+ public boolean close() { >+ if (keyLockImage != null) { >+ keyLockImage.dispose(); >+ } >+ return super.close(); >+ } >+} >#P org.eclipse.mylyn.tasks.core >Index: src/org/eclipse/mylyn/tasks/core/TaskRepository.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java,v >retrieving revision 1.40 >diff -u -r1.40 TaskRepository.java >--- src/org/eclipse/mylyn/tasks/core/TaskRepository.java 12 Sep 2007 17:16:53 -0000 1.40 >+++ src/org/eclipse/mylyn/tasks/core/TaskRepository.java 13 Oct 2007 21:48:40 -0000 >@@ -73,6 +73,8 @@ > > public static final String OFFLINE = "org.eclipse.mylyn.tasklist.repositories.offline"; > >+ public static final String MEMORYONLY_PASSWORD = "org.eclipse.mylyn.tasklist.repositories.memoryonly.password"; >+ > // HACK: Lock used to work around race condition in > // Platform.add/get/flushAuthorizationInfo() > private static final Object LOCK = new Object(); >@@ -83,6 +85,10 @@ > private boolean isCachedUserName; > > private String cachedUserName; >+ >+ private boolean isCachedUserPassword; >+ >+ private String cachedUserPassword; > > static { > URL url = null; >@@ -169,6 +175,19 @@ > } > > public String getPassword() { >+ if (!isCachedUserPassword) { >+ if (isMemoryOnlyPassword()) { >+ StatusHandler.log("Memoryonly Password not set for repository "+ this.getRepositoryLabel(), this); >+ cachedUserPassword = ""; >+ } else { >+ cachedUserPassword = getUserPasswordFromKeyRing(); >+ isCachedUserPassword = true; >+ } >+ } >+ return cachedUserPassword; >+ } >+ >+ private String getUserPasswordFromKeyRing() { > return getAuthInfo(AUTH_PASSWORD); > } > >@@ -188,10 +207,16 @@ > return getAuthInfo(AUTH_HTTP_PASSWORD); > } > >- public void setAuthenticationCredentials(String username, String password) { >- setCredentials(username, password, AUTH_USERNAME, AUTH_PASSWORD); >+ public void setAuthenticationCredentials(String username, String password, boolean storeInKeyring) { >+ if (storeInKeyring) { >+ setCredentials(username, password, AUTH_USERNAME, AUTH_PASSWORD); >+ } else { >+ setCredentials(username, "", AUTH_USERNAME, AUTH_PASSWORD); >+ } > cachedUserName = username; > isCachedUserName = true; >+ cachedUserPassword = password; >+ isCachedUserPassword = true; > } > > public void setProxyAuthenticationCredentials(String username, String password) { >@@ -231,6 +256,7 @@ > headlessCreds.clear(); > } > isCachedUserName = false; >+ isCachedUserPassword = false; > } catch (CoreException e) { > StatusHandler.fail(e, "could not flush authorization credentials", true); > } >@@ -467,4 +493,20 @@ > return getProperty(OFFLINE) != null && "true".equals(getProperty(OFFLINE)); > } > >+ public String getCachedPassword() { >+ if (isCachedUserPassword) >+ return cachedUserPassword; >+ else >+ return null; >+ } >+ >+ public void setMemoryOnlyPassword(boolean b) { >+ properties.put(MEMORYONLY_PASSWORD, String.valueOf(b)); >+ } >+ >+ public boolean isMemoryOnlyPassword() { >+ return getProperty(MEMORYONLY_PASSWORD) != null && "true".equals(getProperty(MEMORYONLY_PASSWORD)); >+ } >+ >+ > } >#P org.eclipse.mylyn.tasks.tests >Index: src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java,v >retrieving revision 1.78 >diff -u -r1.78 TaskListManagerTest.java >--- src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java 6 Sep 2007 03:19:32 -0000 1.78 >+++ src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java 13 Oct 2007 21:48:49 -0000 >@@ -346,7 +346,7 @@ > manager.getTaskList().addTask(mockTask); > mockTask.setCompleted(true); > mockTask.setCompletionDate(new Date()); >- repository.setAuthenticationCredentials("testUser", "testPassword"); >+ repository.setAuthenticationCredentials("testUser", "testPassword", true); > mockTask.setOwner("testUser"); > assertTrue(manager.isCompletedToday(mockTask)); > >Index: src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java,v >retrieving revision 1.18 >diff -u -r1.18 TaskRepositoryManagerTest.java >--- src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java 10 Jul 2007 00:29:58 -0000 1.18 >+++ src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java 13 Oct 2007 21:48:51 -0000 >@@ -175,7 +175,7 @@ > TaskRepository repository = new TaskRepository("eclipse.technology.mylar", > "nntp://news.eclipse.org/eclipse.technology.mylar"); > >- repository.setAuthenticationCredentials("testUser", "testPassword"); >+ repository.setAuthenticationCredentials("testUser", "testPassword", true); > > assertEquals("testUser", repository.getUserName()); > assertEquals("testPassword", repository.getPassword());
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 200634
:
78041
|
78503
|
78504
|
78816
|
78817
|
80187
|
80288
|
80289
|
80290
| 80305 |
80306
|
80829
|
80830
|
80840
|
80841
|
81025
|
81212