Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 200634 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/tasks/ui/TasksUiPlugin.java (+22 lines)
Lines 34-39 Link Here
34
import org.eclipse.jface.preference.IPreferenceStore;
34
import org.eclipse.jface.preference.IPreferenceStore;
35
import org.eclipse.jface.resource.ImageDescriptor;
35
import org.eclipse.jface.resource.ImageDescriptor;
36
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
36
import org.eclipse.jface.text.hyperlink.IHyperlinkDetector;
37
import org.eclipse.jface.window.Window;
37
import org.eclipse.jface.wizard.WizardDialog;
38
import org.eclipse.jface.wizard.WizardDialog;
38
import org.eclipse.mylyn.context.core.ContextCorePlugin;
39
import org.eclipse.mylyn.context.core.ContextCorePlugin;
39
import org.eclipse.mylyn.internal.context.core.ContextPreferenceContstants;
40
import org.eclipse.mylyn.internal.context.core.ContextPreferenceContstants;
Lines 41-46 Link Here
41
import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
42
import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
42
import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager;
43
import org.eclipse.mylyn.internal.tasks.core.TaskActivityManager;
43
import org.eclipse.mylyn.internal.tasks.core.TaskDataManager;
44
import org.eclipse.mylyn.internal.tasks.core.TaskDataManager;
45
import org.eclipse.mylyn.internal.tasks.ui.EnterMemoryPassordDialog;
44
import org.eclipse.mylyn.internal.tasks.ui.IDynamicSubMenuContributor;
46
import org.eclipse.mylyn.internal.tasks.ui.IDynamicSubMenuContributor;
45
import org.eclipse.mylyn.internal.tasks.ui.ITaskHighlighter;
47
import org.eclipse.mylyn.internal.tasks.ui.ITaskHighlighter;
46
import org.eclipse.mylyn.internal.tasks.ui.ITaskListNotification;
48
import org.eclipse.mylyn.internal.tasks.ui.ITaskListNotification;
Lines 1076-1079 Link Here
1076
		}
1078
		}
1077
	}
1079
	}
1078
1080
1081
	public static void testAndSetMemoryOnlyPassword(TaskRepository repository) {
1082
		boolean memoryOnlyPassword = repository.isMemoryOnlyPassword();
1083
		boolean doIt = memoryOnlyPassword && repository.getCachedPassword() == null;
1084
		if (doIt) {
1085
			EnterMemoryPassordDialog dialog = new EnterMemoryPassordDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), repository.getRepositoryLabel(), repository.getUserName(), "Please set the memoryonly Password");
1086
			int result = dialog.open();
1087
			if (result == Window.OK) {
1088
				String password = dialog.getPassword();
1089
				String username = dialog.getUsername();
1090
				boolean allowCaching = dialog.getAllowCaching();
1091
				if (password != null && username != null)
1092
					repository.setAuthenticationCredentials(username, password, allowCaching);
1093
				if (memoryOnlyPassword != allowCaching)
1094
					repository.setMemoryOnlyPassword(!allowCaching);
1095
1096
			}
1097
		}
1098
	}
1099
1100
1079
}
1101
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java (-1 / +3 lines)
Lines 57-64 Link Here
57
			repository.setVersion(abstractRepositorySettingsPage.getVersion());
57
			repository.setVersion(abstractRepositorySettingsPage.getVersion());
58
			repository.setCharacterEncoding(abstractRepositorySettingsPage.getCharacterEncoding());
58
			repository.setCharacterEncoding(abstractRepositorySettingsPage.getCharacterEncoding());
59
			repository.setAuthenticationCredentials(abstractRepositorySettingsPage.getUserName(),
59
			repository.setAuthenticationCredentials(abstractRepositorySettingsPage.getUserName(),
60
					abstractRepositorySettingsPage.getPassword());
60
					abstractRepositorySettingsPage.getPassword(), true);
61
			repository.setRepositoryLabel(abstractRepositorySettingsPage.getRepositoryLabel());
61
			repository.setRepositoryLabel(abstractRepositorySettingsPage.getRepositoryLabel());
62
			repository.setMemoryOnlyPassword(abstractRepositorySettingsPage.getMemoryonlyPassword());
63
62
			repository.setAnonymous(abstractRepositorySettingsPage.isAnonymousAccess());
64
			repository.setAnonymous(abstractRepositorySettingsPage.isAnonymousAccess());
63
			repository.setHttpAuthenticationCredentials(abstractRepositorySettingsPage.getHttpAuthUserId(),
65
			repository.setHttpAuthenticationCredentials(abstractRepositorySettingsPage.getHttpAuthUserId(),
64
					abstractRepositorySettingsPage.getHttpAuthPassword());
66
					abstractRepositorySettingsPage.getHttpAuthPassword());
(-)src/org/eclipse/mylyn/internal/tasks/ui/ScheduledTaskListSynchJob.java (+18 lines)
Lines 55-60 Link Here
55
		this.taskListManager = taskListManager;
55
		this.taskListManager = taskListManager;
56
		this.setSystem(true);
56
		this.setSystem(true);
57
		this.setPriority(Job.BUILD);
57
		this.setPriority(Job.BUILD);
58
59
		if (repositories == null) {
60
			repositories = TasksUiPlugin.getRepositoryManager().getAllRepositories();
61
		}
62
63
		for (final TaskRepository repository : repositories) {
64
			TasksUiPlugin.testAndSetMemoryOnlyPassword(repository);
65
		}
58
	}
66
	}
59
67
60
	public ScheduledTaskListSynchJob(TaskListManager taskListManager) {
68
	public ScheduledTaskListSynchJob(TaskListManager taskListManager) {
Lines 62-71 Link Here
62
		this.taskListManager = taskListManager;
70
		this.taskListManager = taskListManager;
63
		this.setPriority(Job.BUILD);
71
		this.setPriority(Job.BUILD);
64
		this.scheduleDelay = -1;
72
		this.scheduleDelay = -1;
73
74
		if (repositories == null) {
75
			repositories = TasksUiPlugin.getRepositoryManager().getAllRepositories();
76
		}
77
78
		for (final TaskRepository repository : repositories) {
79
			TasksUiPlugin.testAndSetMemoryOnlyPassword(repository);
80
		}
65
	}
81
	}
66
82
67
	@Override
83
	@Override
68
	public IStatus run(final IProgressMonitor monitor) {
84
	public IStatus run(final IProgressMonitor monitor) {
85
69
		try {
86
		try {
70
			taskList = taskListManager.getTaskList();
87
			taskList = taskListManager.getTaskList();
71
			if (repositories == null) {
88
			if (repositories == null) {
Lines 83-88 Link Here
83
					continue;
100
					continue;
84
				}
101
				}
85
102
103
				
86
				final AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager()
104
				final AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager()
87
						.getRepositoryConnector(repository.getConnectorKind());
105
						.getRepositoryConnector(repository.getConnectorKind());
88
				if (connector == null) {
106
				if (connector == null) {
(-)src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java (-3 / +47 lines)
Lines 188-193 Link Here
188
188
189
	private Hyperlink manageAccountHyperlink;
189
	private Hyperlink manageAccountHyperlink;
190
190
191
	protected Button memoryonlyPasswordButton;
192
	
193
	
191
	public AbstractRepositorySettingsPage(String title, String description, AbstractRepositoryConnectorUi repositoryUi) {
194
	public AbstractRepositorySettingsPage(String title, String description, AbstractRepositoryConnectorUi repositoryUi) {
192
		super(title);
195
		super(title);
193
		super.setTitle(title);
196
		super.setTitle(title);
Lines 318-323 Link Here
318
			});
321
			});
319
		}
322
		}
320
323
324
		memoryonlyPasswordButton = new Button(compositeContainer, SWT.CHECK);
325
		GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(memoryonlyPasswordButton);
326
327
		memoryonlyPasswordButton.setText("Memoryonly Password");
328
		memoryonlyPasswordButton.addSelectionListener(new SelectionAdapter() {
329
			@Override
330
			public void widgetSelected(SelectionEvent e) {
331
				setMemoryOnly(memoryonlyPasswordButton.getSelection());
332
				isPageComplete();
333
			}
334
		});
335
321
		repositoryUserNameEditor = new StringFieldEditor("", LABEL_USER, StringFieldEditor.UNLIMITED,
336
		repositoryUserNameEditor = new StringFieldEditor("", LABEL_USER, StringFieldEditor.UNLIMITED,
322
				compositeContainer) {
337
				compositeContainer) {
323
338
Lines 377-382 Link Here
377
				setAnonymous(true);
392
				setAnonymous(true);
378
			}
393
			}
379
		}
394
		}
395
		
396
		if (repository != null) {
397
			memoryonlyPasswordButton.setSelection(repository.isMemoryOnlyPassword());
398
		} else {
399
			memoryonlyPasswordButton.setSelection(false);
400
		}
401
		
380
402
381
		// TODO: put this back if we can't get the info from all connectors
403
		// TODO: put this back if we can't get the info from all connectors
382
		// if (needsTimeZone()) {
404
		// if (needsTimeZone()) {
Lines 832-837 Link Here
832
		}
854
		}
833
	}
855
	}
834
856
857
	public void setMemoryOnly(boolean selected) {
858
859
		memoryonlyPasswordButton.setSelection(selected);
860
861
		if (selected) {
862
			oldPassword = (repositoryPasswordEditor).getStringValue();
863
			repositoryPasswordEditor.setStringValue("");
864
		} else {
865
			repositoryPasswordEditor.setStringValue(oldPassword);
866
		}
867
868
		repositoryPasswordEditor.setEnabled(!selected, compositeContainer);
869
		if (getWizard() != null) {
870
			getWizard().getContainer().updateButtons();
871
		}
872
	}
873
835
	public void setHttpAuth(boolean selected) {
874
	public void setHttpAuth(boolean selected) {
836
		if (!needsHttpAuth) {
875
		if (!needsHttpAuth) {
837
			return;
876
			return;
Lines 1042-1050 Link Here
1042
1081
1043
	private String credentialsComplete() {
1082
	private String credentialsComplete() {
1044
		if ((needsAnonymousLogin() && !anonymousButton.getSelection())
1083
		if ((needsAnonymousLogin() && !anonymousButton.getSelection())
1045
				&& (repositoryUserNameEditor.getStringValue().trim().equals("") || repositoryPasswordEditor.getStringValue()
1084
				&& (repositoryUserNameEditor.getStringValue().trim().equals("") || (repositoryPasswordEditor.getStringValue()
1046
						.trim()
1085
						.trim()
1047
						.equals(""))) {
1086
						.equals("")) ) && !memoryonlyPasswordButton.getSelection()) {
1048
			return "Repository user name and password must not be blank";
1087
			return "Repository user name and password must not be blank";
1049
		}
1088
		}
1050
		return null;
1089
		return null;
Lines 1118-1127 Link Here
1118
		TaskRepository repository = new TaskRepository(connector.getConnectorKind(), getServerUrl(), getVersion(),
1157
		TaskRepository repository = new TaskRepository(connector.getConnectorKind(), getServerUrl(), getVersion(),
1119
				getCharacterEncoding(), "");
1158
				getCharacterEncoding(), "");
1120
		repository.setRepositoryLabel(getRepositoryLabel());
1159
		repository.setRepositoryLabel(getRepositoryLabel());
1121
		repository.setAuthenticationCredentials(getUserName(), getPassword());
1160
		repository.setAuthenticationCredentials(getUserName(), getPassword(), true);
1122
		if (needsAnonymousLogin()) {
1161
		if (needsAnonymousLogin()) {
1123
			repository.setAnonymous(anonymousButton.getSelection());
1162
			repository.setAnonymous(anonymousButton.getSelection());
1124
		}
1163
		}
1164
		repository.setMemoryOnlyPassword(memoryonlyPasswordButton.getSelection());
1125
		// repository.setProperty(TaskRepository.AUTH_HTTP_USERNAME,
1165
		// repository.setProperty(TaskRepository.AUTH_HTTP_USERNAME,
1126
		// getHttpAuthUserId());
1166
		// getHttpAuthUserId());
1127
		// repository.setProperty(TaskRepository.AUTH_HTTP_PASSWORD,
1167
		// repository.setProperty(TaskRepository.AUTH_HTTP_PASSWORD,
Lines 1314-1317 Link Here
1314
1354
1315
	}
1355
	}
1316
1356
1357
	public Boolean getMemoryonlyPassword() {
1358
			return memoryonlyPasswordButton.getSelection();
1359
	}
1360
1317
}
1361
}
(-)src/org/eclipse/mylyn/internal/tasks/ui/EnterMemoryPassordDialog.java (+272 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2007 Mylyn project committers and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *******************************************************************************/
8
9
package org.eclipse.mylyn.internal.tasks.ui;
10
11
import org.eclipse.jface.dialogs.Dialog;
12
import org.eclipse.jface.dialogs.IDialogConstants;
13
import org.eclipse.jface.window.Window;
14
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
15
import org.eclipse.swt.SWT;
16
import org.eclipse.swt.events.SelectionAdapter;
17
import org.eclipse.swt.events.SelectionEvent;
18
import org.eclipse.swt.graphics.Image;
19
import org.eclipse.swt.layout.GridData;
20
import org.eclipse.swt.layout.GridLayout;
21
import org.eclipse.swt.widgets.Button;
22
import org.eclipse.swt.widgets.Composite;
23
import org.eclipse.swt.widgets.Control;
24
import org.eclipse.swt.widgets.Label;
25
import org.eclipse.swt.widgets.Shell;
26
import org.eclipse.swt.widgets.Text;
27
28
/**
29
 * This Dialog is used to enter a memory only Password for TaskRepositories.
30
 * 
31
 * Based on org.eclipse.jsch.internal.ui.UserValidationDialog
32
 * 
33
 * @author Frank Becker
34
 * @since 2.2
35
 */
36
public class EnterMemoryPassordDialog extends Dialog {
37
	// widgets
38
	protected Text usernameField;
39
40
	protected Text passwordField;
41
42
	protected Button allowCachingButton;
43
44
	protected String domain;
45
46
	protected String defaultUsername;
47
48
	protected String password = null;
49
50
	protected boolean allowCaching = false;
51
52
	protected Image keyLockImage;
53
54
	protected String username = null;
55
56
	protected String message = null;
57
58
	/**
59
	 * Creates a new EnterMemoryPassordDialog.
60
	 * 
61
	 * @param parentShell  the parent shell
62
	 * @param repositoryName  the name of the repository
63
	 * @param defaultName  the default user name
64
	 * @param message  a message to display to the user
65
	 */
66
	public EnterMemoryPassordDialog(Shell parentShell, String repositoryName, String defaultName, String message) {
67
		super(parentShell);
68
		setShellStyle(getShellStyle() | SWT.RESIZE);
69
		this.defaultUsername = defaultName;
70
		this.domain = repositoryName;
71
		this.message = message;
72
	}
73
74
	/**
75
	 * @see Window#configureShell
76
	 */
77
	protected void configureShell(Shell newShell) {
78
		super.configureShell(newShell);
79
		newShell.setText("Password Required");
80
	}
81
82
	/**
83
	 * @see Window#create
84
	 */
85
	public void create() {
86
		super.create();
87
		// add some default values
88
		usernameField.setText(defaultUsername);
89
90
		// give focus to user name field
91
		usernameField.selectAll();
92
		usernameField.setFocus();
93
	}
94
95
	/**
96
	 * @see Dialog#createDialogArea
97
	 */
98
	protected Control createDialogArea(Composite parent) {
99
		Composite top = new Composite(parent, SWT.NONE);
100
		GridLayout layout = new GridLayout();
101
		layout.numColumns = 2;
102
103
		top.setLayout(layout);
104
		top.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
105
106
		Composite imageComposite = new Composite(top, SWT.NONE);
107
		layout = new GridLayout();
108
		imageComposite.setLayout(layout);
109
		imageComposite.setLayoutData(new GridData(GridData.FILL_VERTICAL));
110
111
		Composite main = new Composite(top, SWT.NONE);
112
		layout = new GridLayout();
113
		layout.numColumns = 3;
114
		main.setLayout(layout);
115
		main.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
116
117
		Label imageLabel = new Label(imageComposite, SWT.NONE);
118
		keyLockImage = TasksUiPlugin.imageDescriptorFromPlugin(TasksUiPlugin.ID_PLUGIN, "icons/wizban/keylock.gif")
119
				.createImage();
120
		imageLabel.setImage(keyLockImage);
121
		GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
122
		imageLabel.setLayoutData(data);
123
124
		if (message != null) {
125
			Label messageLabel = new Label(main, SWT.WRAP);
126
			messageLabel.setText(message);
127
			data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
128
			data.horizontalSpan = 3;
129
			data.widthHint = 300;
130
			messageLabel.setLayoutData(data);
131
		}
132
		if (domain != null) {
133
			Label d = new Label(main, SWT.WRAP);
134
			d.setText("Task Repository:");
135
			data = new GridData();
136
			d.setLayoutData(data);
137
			Label label = new Label(main, SWT.WRAP);
138
			label.setText(domain);
139
			data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
140
			data.horizontalSpan = 2;
141
			data.widthHint = 300;
142
			label.setLayoutData(data);
143
		}
144
		createUsernameFields(main);
145
		createPasswordFields(main);
146
147
		if (domain != null) {
148
			allowCachingButton = new Button(main, SWT.CHECK);
149
			allowCachingButton.setText("&Save password");
150
			data = new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL);
151
			data.horizontalSpan = 3;
152
			allowCachingButton.setLayoutData(data);
153
			allowCachingButton.addSelectionListener(new SelectionAdapter() {
154
				public void widgetSelected(SelectionEvent e) {
155
					allowCaching = allowCachingButton.getSelection();
156
				}
157
			});
158
			Composite warningComposite = new Composite(main, SWT.NONE);
159
			layout = new GridLayout();
160
			layout.numColumns = 2;
161
			layout.marginHeight = 0;
162
			layout.marginHeight = 0;
163
			warningComposite.setLayout(layout);
164
			data = new GridData(GridData.FILL_HORIZONTAL);
165
			data.horizontalSpan = 3;
166
			warningComposite.setLayoutData(data);
167
			Label warningLabel = new Label(warningComposite, SWT.NONE);
168
			warningLabel.setImage(getImage(DLG_IMG_MESSAGE_WARNING));
169
			warningLabel.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING
170
					| GridData.HORIZONTAL_ALIGN_BEGINNING));
171
			Label warningText = new Label(warningComposite, SWT.WRAP);
172
			warningText.setText("Saved passwords are stored on your computer in a file that is difficult, but not impossible, for an intruder to read.");
173
			data = new GridData(GridData.FILL_HORIZONTAL);
174
			data.widthHint = 300;
175
			warningText.setLayoutData(data);
176
		}
177
178
		Dialog.applyDialogFont(parent);
179
180
		return main;
181
	}
182
183
	/**
184
	 * Creates the three widgets that represent the password entry area.
185
	 * 
186
	 * @param parent  the parent of the widgets
187
	 */
188
	protected void createPasswordFields(Composite parent) {
189
		new Label(parent, SWT.NONE).setText("&Password:");
190
191
		passwordField = new Text(parent, SWT.BORDER | SWT.PASSWORD);
192
		GridData data = new GridData(GridData.FILL_HORIZONTAL);
193
		data.horizontalSpan = 2;
194
		data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH);
195
		passwordField.setLayoutData(data);
196
	}
197
198
	/**
199
	 * Creates the three widgets that represent the user name entry area.
200
	 * 
201
	 * @param parent  the parent of the widgets
202
	 */
203
	protected void createUsernameFields(Composite parent) {
204
		new Label(parent, SWT.NONE).setText("&User name:");
205
206
		usernameField = new Text(parent, SWT.BORDER);
207
		GridData data = new GridData(GridData.FILL_HORIZONTAL);
208
		data.horizontalSpan = 2;
209
		data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.ENTRY_FIELD_WIDTH);
210
		usernameField.setLayoutData(data);
211
	}
212
213
	/**
214
	 * Returns the password entered by the user, or null
215
	 * if the user canceled.
216
	 * 
217
	 * @return the entered password
218
	 */
219
	public String getPassword() {
220
		return password;
221
	}
222
223
	/**
224
	 * Returns the user name entered by the user, or null
225
	 * if the user canceled.
226
	 * 
227
	 * @return the entered user name
228
	 */
229
	public String getUsername() {
230
		return username;
231
	}
232
233
	/**
234
	 * Returns <code>true</code> if the save password checkbox was selected.
235
	 * @return <code>true</code> if the save password checkbox was selected and <code>false</code>
236
	 * otherwise.
237
	 */
238
	public boolean getAllowCaching() {
239
		return allowCaching;
240
	}
241
242
	/**
243
	 * Notifies that the ok button of this dialog has been pressed.
244
	 * <p>
245
	 * The default implementation of this framework method sets
246
	 * this dialog's return code to <code>Window.OK</code>
247
	 * and closes the dialog. Subclasses may override.
248
	 * </p>
249
	 */
250
	protected void okPressed() {
251
		password = passwordField.getText();
252
		username = usernameField.getText();
253
254
		super.okPressed();
255
	}
256
257
	protected void cancelPressed() {
258
		password = null;
259
		username = null;
260
		super.cancelPressed();
261
	}
262
263
	/* (non-Javadoc)
264
	 * @see org.eclipse.jface.dialogs.Dialog#close()
265
	 */
266
	public boolean close() {
267
		if (keyLockImage != null) {
268
			keyLockImage.dispose();
269
		}
270
		return super.close();
271
	}
272
}
(-)src/org/eclipse/mylyn/trac/tests/RepositorySearchQueryTest.java (-1 / +1 lines)
Lines 60-66 Link Here
60
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
60
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
61
61
62
		repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url);
62
		repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url);
63
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
63
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
64
		repository.setTimeZoneId(ITracClient.TIME_ZONE);
64
		repository.setTimeZoneId(ITracClient.TIME_ZONE);
65
		repository.setCharacterEncoding(ITracClient.CHARSET);
65
		repository.setCharacterEncoding(ITracClient.CHARSET);
66
		repository.setVersion(version.name());
66
		repository.setVersion(version.name());
(-)src/org/eclipse/mylyn/trac/tests/TracAttachmentHandlerTest.java (-1 / +1 lines)
Lines 70-76 Link Here
70
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
70
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
71
71
72
		repository = new TaskRepository(kind, url);
72
		repository = new TaskRepository(kind, url);
73
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
73
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
74
		repository.setTimeZoneId(ITracClient.TIME_ZONE);
74
		repository.setTimeZoneId(ITracClient.TIME_ZONE);
75
		repository.setCharacterEncoding(ITracClient.CHARSET);
75
		repository.setCharacterEncoding(ITracClient.CHARSET);
76
		repository.setVersion(version.name());
76
		repository.setVersion(version.name());
(-)src/org/eclipse/mylyn/trac/tests/TracRepositoryConnectorTest.java (-1 / +1 lines)
Lines 86-92 Link Here
86
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
86
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
87
87
88
		repository = new TaskRepository(kind, url);
88
		repository = new TaskRepository(kind, url);
89
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
89
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
90
		repository.setTimeZoneId(ITracClient.TIME_ZONE);
90
		repository.setTimeZoneId(ITracClient.TIME_ZONE);
91
		repository.setCharacterEncoding(ITracClient.CHARSET);
91
		repository.setCharacterEncoding(ITracClient.CHARSET);
92
		repository.setVersion(version.name());
92
		repository.setVersion(version.name());
(-)src/org/eclipse/mylyn/trac/tests/TracTaskDataHandlerTest.java (-2 / +2 lines)
Lines 76-82 Link Here
76
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
76
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
77
77
78
		repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url);
78
		repository = new TaskRepository(TracCorePlugin.REPOSITORY_KIND, url);
79
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
79
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
80
		repository.setTimeZoneId(ITracClient.TIME_ZONE);
80
		repository.setTimeZoneId(ITracClient.TIME_ZONE);
81
		repository.setCharacterEncoding(ITracClient.CHARSET);
81
		repository.setCharacterEncoding(ITracClient.CHARSET);
82
		repository.setVersion(version.name());
82
		repository.setVersion(version.name());
Lines 257-263 Link Here
257
				task.getTaskId());
257
				task.getTaskId());
258
		
258
		
259
		taskData.setNewComment("new comment");
259
		taskData.setNewComment("new comment");
260
		repository.setAuthenticationCredentials("foo", "bar");
260
		repository.setAuthenticationCredentials("foo", "bar", true);
261
		try {
261
		try {
262
			taskDataHandler.postTaskData(repository, taskData, new NullProgressMonitor());
262
			taskDataHandler.postTaskData(repository, taskData, new NullProgressMonitor());
263
		} catch (CoreException expected) {
263
		} catch (CoreException expected) {
(-)src/org/eclipse/mylyn/tasks/core/TaskRepository.java (-2 / +44 lines)
Lines 73-78 Link Here
73
73
74
	public static final String OFFLINE = "org.eclipse.mylyn.tasklist.repositories.offline";
74
	public static final String OFFLINE = "org.eclipse.mylyn.tasklist.repositories.offline";
75
75
76
	public static final String MEMORYONLY_PASSWORD = "org.eclipse.mylyn.tasklist.repositories.memoryonly.password";
77
76
	// HACK: Lock used to work around race condition in
78
	// HACK: Lock used to work around race condition in
77
	// Platform.add/get/flushAuthorizationInfo()
79
	// Platform.add/get/flushAuthorizationInfo()
78
	private static final Object LOCK = new Object();
80
	private static final Object LOCK = new Object();
Lines 83-88 Link Here
83
	private boolean isCachedUserName;
85
	private boolean isCachedUserName;
84
86
85
	private String cachedUserName;
87
	private String cachedUserName;
88
	
89
	private boolean isCachedUserPassword;
90
91
	private String cachedUserPassword;
86
92
87
	static {
93
	static {
88
		URL url = null;
94
		URL url = null;
Lines 169-174 Link Here
169
	}
175
	}
170
176
171
	public String getPassword() {
177
	public String getPassword() {
178
		if (!isCachedUserPassword) {
179
			if (isMemoryOnlyPassword()) {
180
				StatusHandler.log("Memoryonly Password not set for repository "+ this.getRepositoryLabel(), this);
181
				cachedUserPassword = "";
182
			} else {
183
				cachedUserPassword = getUserPasswordFromKeyRing();
184
				isCachedUserPassword = true;
185
			}
186
		}
187
		return cachedUserPassword;
188
	}
189
190
	private String getUserPasswordFromKeyRing() {
172
		return getAuthInfo(AUTH_PASSWORD);
191
		return getAuthInfo(AUTH_PASSWORD);
173
	}
192
	}
174
193
Lines 188-197 Link Here
188
		return getAuthInfo(AUTH_HTTP_PASSWORD);
207
		return getAuthInfo(AUTH_HTTP_PASSWORD);
189
	}
208
	}
190
209
191
	public void setAuthenticationCredentials(String username, String password) {
210
	public void setAuthenticationCredentials(String username, String password, boolean storeInKeyring) {
192
		setCredentials(username, password, AUTH_USERNAME, AUTH_PASSWORD);
211
		if (storeInKeyring) {
212
			setCredentials(username, password, AUTH_USERNAME, AUTH_PASSWORD);
213
		} else {
214
			setCredentials(username, "", AUTH_USERNAME, AUTH_PASSWORD);
215
		}
193
		cachedUserName = username;
216
		cachedUserName = username;
194
		isCachedUserName = true;
217
		isCachedUserName = true;
218
		cachedUserPassword = password;
219
		isCachedUserPassword = true;
195
	}
220
	}
196
221
197
	public void setProxyAuthenticationCredentials(String username, String password) {
222
	public void setProxyAuthenticationCredentials(String username, String password) {
Lines 231-236 Link Here
231
					headlessCreds.clear();
256
					headlessCreds.clear();
232
				}
257
				}
233
				isCachedUserName = false;
258
				isCachedUserName = false;
259
				isCachedUserPassword = false;
234
			} catch (CoreException e) {
260
			} catch (CoreException e) {
235
				StatusHandler.fail(e, "could not flush authorization credentials", true);
261
				StatusHandler.fail(e, "could not flush authorization credentials", true);
236
			}
262
			}
Lines 467-470 Link Here
467
		return getProperty(OFFLINE) != null && "true".equals(getProperty(OFFLINE));
493
		return getProperty(OFFLINE) != null && "true".equals(getProperty(OFFLINE));
468
	}
494
	}
469
495
496
	public String getCachedPassword() {
497
		if (isCachedUserPassword)
498
			return cachedUserPassword;
499
		else
500
			return null;
501
	}
502
503
	public void setMemoryOnlyPassword(boolean b) {
504
		properties.put(MEMORYONLY_PASSWORD, String.valueOf(b));
505
	}
506
507
	public boolean isMemoryOnlyPassword() {
508
		return getProperty(MEMORYONLY_PASSWORD) != null || "true".equals(getProperty(MEMORYONLY_PASSWORD));
509
	}
510
511
470
}
512
}
(-).refactorings/2007/10/41/refactorings.index (+1 lines)
Added Link Here
1
1192215160392	Change method 'setAuthenticationCredentials'
(-).refactorings/2007/10/41/refactorings.history (+4 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<session version="1.0">
3
<refactoring comment="Change method &apos;public void org.eclipse.mylyn.tasks.core.TaskRepository.setAuthenticationCredentials(String username, String password)&apos; to &apos;public void setAuthenticationCredentials(String username, String password, boolean storeInKeyring)&apos;&#x0A;- Original project: &apos;org.eclipse.mylyn.tasks.core&apos;&#x0A;- Added parameters:&#x0A;     boolean storeInKeyring" default3="true" delegate="false" deprecate="true" description="Change method &apos;setAuthenticationCredentials&apos;" flags="589830" id="org.eclipse.jdt.ui.change.method.signature" input="/src&lt;org.eclipse.mylyn.tasks.core{TaskRepository.java[TaskRepository~setAuthenticationCredentials~QString;~QString;" name="setAuthenticationCredentials" parameter1="String username 0 String username false" parameter2="String password 1 String password false" parameter3="{added} {added} -1 boolean storeInKeyring false" stamp="1192215160392" version="1.0"/>
4
</session>
(-)src/org/eclipse/mylyn/jira/tests/JiraTaskDataHandlerTest.java (-1 / +1 lines)
Lines 74-80 Link Here
74
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
74
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
75
75
76
		repository = new TaskRepository(kind, url);
76
		repository = new TaskRepository(kind, url);
77
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
77
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
78
		manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
78
		manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
79
		
79
		
80
		connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(kind);
80
		connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(kind);
(-)src/org/eclipse/mylyn/jira/tests/JiraClientFacadeTest.java (-4 / +4 lines)
Lines 52-62 Link Here
52
	public void testChangeCredentials() throws Exception {
52
	public void testChangeCredentials() throws Exception {
53
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
53
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
54
		TaskRepository repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL);
54
		TaskRepository repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL);
55
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
55
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
56
		TasksUiPlugin.getRepositoryManager().addRepository(repository,
56
		TasksUiPlugin.getRepositoryManager().addRepository(repository,
57
				TasksUiPlugin.getDefault().getRepositoriesFilePath());
57
				TasksUiPlugin.getDefault().getRepositoriesFilePath());
58
58
59
		repository.setAuthenticationCredentials("Bogus User", "Bogus Password");
59
		repository.setAuthenticationCredentials("Bogus User", "Bogus Password", true);
60
		jiraFacade.repositoryRemoved(repository);
60
		jiraFacade.repositoryRemoved(repository);
61
61
62
		try {
62
		try {
Lines 67-73 Link Here
67
		}
67
		}
68
68
69
		// check that it works after putting the right password in
69
		// check that it works after putting the right password in
70
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
70
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
71
		jiraFacade.repositoryRemoved(repository);
71
		jiraFacade.repositoryRemoved(repository);
72
		jiraFacade.getJiraClient(repository).getNamedFilters();
72
		jiraFacade.getJiraClient(repository).getNamedFilters();
73
	}
73
	}
Lines 104-110 Link Here
104
	public void testCharacterEncoding() throws Exception {
104
	public void testCharacterEncoding() throws Exception {
105
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
105
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
106
		TaskRepository repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL);
106
		TaskRepository repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL);
107
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
107
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
108
		assertFalse(JiraUtils.getCharacterEncodingValidated(repository));		
108
		assertFalse(JiraUtils.getCharacterEncodingValidated(repository));		
109
109
110
		JiraClient client = jiraFacade.getJiraClient(repository);
110
		JiraClient client = jiraFacade.getJiraClient(repository);
(-)src/org/eclipse/mylyn/jira/tests/JiraStackTraceDuplicateDetectorTest.java (-1 / +1 lines)
Lines 69-75 Link Here
69
69
70
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
70
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
71
		repository = new TaskRepository(kind, url);
71
		repository = new TaskRepository(kind, url);
72
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
72
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
73
73
74
		manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
74
		manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
75
75
(-)src/org/eclipse/mylyn/jira/tests/JiraTaskExternalizationTest.java (-1 / +1 lines)
Lines 61-67 Link Here
61
	protected void setUp() throws Exception {
61
	protected void setUp() throws Exception {
62
		super.setUp();
62
		super.setUp();
63
		repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, SERVER_URL);
63
		repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, SERVER_URL);
64
		repository.setAuthenticationCredentials(USER, PASSWORD);
64
		repository.setAuthenticationCredentials(USER, PASSWORD, true);
65
		TasksUiPlugin.getRepositoryManager().addRepository(repository,
65
		TasksUiPlugin.getRepositoryManager().addRepository(repository,
66
				TasksUiPlugin.getDefault().getRepositoriesFilePath());
66
				TasksUiPlugin.getDefault().getRepositoriesFilePath());
67
		TasksUiPlugin.getTaskListManager().resetTaskList();
67
		TasksUiPlugin.getTaskListManager().resetTaskList();
(-)src/org/eclipse/mylyn/jira/tests/JiraRepositoryConnectorTest.java (-1 / +1 lines)
Lines 89-95 Link Here
89
89
90
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
90
		Credentials credentials = TestUtil.readCredentials(PrivilegeLevel.USER);
91
		repository = new TaskRepository(kind, url);
91
		repository = new TaskRepository(kind, url);
92
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
92
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
93
93
94
		manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
94
		manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath());
95
95
(-)src/org/eclipse/mylyn/jira/tests/JiraAttachmentHandlerTest.java (-1 / +1 lines)
Lines 72-78 Link Here
72
		}
72
		}
73
73
74
		repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL);
74
		repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL);
75
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
75
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
76
		repository.setCharacterEncoding(JiraClient.DEFAULT_CHARSET);
76
		repository.setCharacterEncoding(JiraClient.DEFAULT_CHARSET);
77
77
78
		TasksUiPlugin.getRepositoryManager().addRepository(repository,
78
		TasksUiPlugin.getRepositoryManager().addRepository(repository,
(-)src/org/eclipse/mylyn/jira/tests/JiraFilterTest.java (-1 / +1 lines)
Lines 77-83 Link Here
77
		}
77
		}
78
78
79
		repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL);
79
		repository = new TaskRepository(JiraUiPlugin.REPOSITORY_KIND, JiraTestConstants.JIRA_39_URL);
80
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
80
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
81
		repository.setCharacterEncoding(JiraClient.DEFAULT_CHARSET);
81
		repository.setCharacterEncoding(JiraClient.DEFAULT_CHARSET);
82
82
83
		TasksUiPlugin.getRepositoryManager().addRepository(repository,
83
		TasksUiPlugin.getRepositoryManager().addRepository(repository,
(-)src/org/eclipse/mylyn/tests/integration/LiveWebConnectorTemplatesTest.java (-2 / +2 lines)
Lines 75-83 Link Here
75
		String url = repository.getUrl();
75
		String url = repository.getUrl();
76
		// HACK: repositories that require auth
76
		// HACK: repositories that require auth
77
		if ("http://demo.otrs.org".equals(url)) {
77
		if ("http://demo.otrs.org".equals(url)) {
78
			repository.setAuthenticationCredentials("skywalker", "skywalker");
78
			repository.setAuthenticationCredentials("skywalker", "skywalker", true);
79
		} else if ("http://changelogic.araneaframework.org".equals(url)) {
79
		} else if ("http://changelogic.araneaframework.org".equals(url)) {
80
			repository.setAuthenticationCredentials("mylar2", "mylar123");
80
			repository.setAuthenticationCredentials("mylar2", "mylar123", true);
81
		}
81
		}
82
82
83
		String queryUrlTemplate = template.taskQueryUrl;
83
		String queryUrlTemplate = template.taskQueryUrl;
(-)src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java (-1 / +1 lines)
Lines 346-352 Link Here
346
		manager.getTaskList().addTask(mockTask);
346
		manager.getTaskList().addTask(mockTask);
347
		mockTask.setCompleted(true);
347
		mockTask.setCompleted(true);
348
		mockTask.setCompletionDate(new Date());
348
		mockTask.setCompletionDate(new Date());
349
		repository.setAuthenticationCredentials("testUser", "testPassword");
349
		repository.setAuthenticationCredentials("testUser", "testPassword", true);
350
		mockTask.setOwner("testUser");
350
		mockTask.setOwner("testUser");
351
		assertTrue(manager.isCompletedToday(mockTask));
351
		assertTrue(manager.isCompletedToday(mockTask));
352
352
(-)src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java (-1 / +1 lines)
Lines 175-181 Link Here
175
		TaskRepository repository = new TaskRepository("eclipse.technology.mylar",
175
		TaskRepository repository = new TaskRepository("eclipse.technology.mylar",
176
				"nntp://news.eclipse.org/eclipse.technology.mylar");
176
				"nntp://news.eclipse.org/eclipse.technology.mylar");
177
177
178
		repository.setAuthenticationCredentials("testUser", "testPassword");
178
		repository.setAuthenticationCredentials("testUser", "testPassword", true);
179
179
180
		assertEquals("testUser", repository.getUserName());
180
		assertEquals("testUser", repository.getUserName());
181
		assertEquals("testPassword", repository.getPassword());
181
		assertEquals("testPassword", repository.getPassword());
(-)src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java (-1 / +1 lines)
Lines 44-50 Link Here
44
		manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
44
		manager.clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath());
45
		repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL);
45
		repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL);
46
		Credentials credentials = TestUtil.readCredentials();
46
		Credentials credentials = TestUtil.readCredentials();
47
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
47
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
48
		repository.setAnonymous(false);
48
		repository.setAnonymous(false);
49
		TasksUiPlugin.getRepositoryManager().addRepository(repository,
49
		TasksUiPlugin.getRepositoryManager().addRepository(repository,
50
				TasksUiPlugin.getDefault().getRepositoriesFilePath());
50
				TasksUiPlugin.getDefault().getRepositoriesFilePath());
(-)src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java (-2 / +2 lines)
Lines 235-241 Link Here
235
	public void testAnonymousRepositoryAccess() throws Exception {
235
	public void testAnonymousRepositoryAccess() throws Exception {
236
		init218();
236
		init218();
237
		assertNotNull(repository);
237
		assertNotNull(repository);
238
		repository.setAuthenticationCredentials("", "");
238
		repository.setAuthenticationCredentials("", "", true);
239
		// test anonymous task retrieval
239
		// test anonymous task retrieval
240
		BugzillaTask task = this.generateLocalTaskAndDownload("2");
240
		BugzillaTask task = this.generateLocalTaskAndDownload("2");
241
		assertNotNull(task);
241
		assertNotNull(task);
Lines 307-313 Link Here
307
		assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
307
		assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState());
308
		sourceContextFile.createNewFile();
308
		sourceContextFile.createNewFile();
309
		sourceContextFile.deleteOnExit();
309
		sourceContextFile.deleteOnExit();
310
		repository.setAuthenticationCredentials("wrong", "wrong");
310
		repository.setAuthenticationCredentials("wrong", "wrong", true);
311
		try {
311
		try {
312
			connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor());
312
			connector.getAttachmentHandler().attachContext(repository, task, "", new NullProgressMonitor());
313
		} catch (CoreException e) {
313
		} catch (CoreException e) {
(-)src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java (-1 / +1 lines)
Lines 98-104 Link Here
98
	protected void init(String url) {
98
	protected void init(String url) {
99
		repository = new TaskRepository(DEFAULT_KIND, url);
99
		repository = new TaskRepository(DEFAULT_KIND, url);
100
		Credentials credentials = TestUtil.readCredentials();
100
		Credentials credentials = TestUtil.readCredentials();
101
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
101
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
102
102
103
		repository.setTimeZoneId("Canada/Eastern");
103
		repository.setTimeZoneId("Canada/Eastern");
104
		assertNotNull(manager);
104
		assertNotNull(manager);
(-)src/org/eclipse/mylyn/bugzilla/tests/RepositoryReportFactoryTest.java (-2 / +2 lines)
Lines 49-55 Link Here
49
				BugzillaCorePlugin.REPOSITORY_KIND);
49
				BugzillaCorePlugin.REPOSITORY_KIND);
50
		repository = new TaskRepository(kind, url);
50
		repository = new TaskRepository(kind, url);
51
		Credentials credentials = TestUtil.readCredentials();
51
		Credentials credentials = TestUtil.readCredentials();
52
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
52
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
53
		return repository;
53
		return repository;
54
	}
54
	}
55
55
Lines 58-64 Link Here
58
		String errorMessage = "";
58
		String errorMessage = "";
59
		try {
59
		try {
60
			setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL);
60
			setRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL);
61
			repository.setAuthenticationCredentials("invalid", "invalid");
61
			repository.setAuthenticationCredentials("invalid", "invalid", true);
62
			init(bugid);
62
			init(bugid);
63
		} catch (CoreException e) {
63
		} catch (CoreException e) {
64
			errorMessage = e.getStatus().getMessage();
64
			errorMessage = e.getStatus().getMessage();
(-)src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java (-1 / +1 lines)
Lines 45-51 Link Here
45
	private TaskRepository setRepository(String url) {
45
	private TaskRepository setRepository(String url) {
46
		repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, url);
46
		repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, url);
47
		Credentials credentials = TestUtil.readCredentials();
47
		Credentials credentials = TestUtil.readCredentials();
48
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
48
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
49
		return repository;
49
		return repository;
50
	}
50
	}
51
51
(-)src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaTaskHistoryTest.java (-1 / +1 lines)
Lines 47-53 Link Here
47
		repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL);
47
		repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL);
48
48
49
		Credentials credentials = TestUtil.readCredentials();
49
		Credentials credentials = TestUtil.readCredentials();
50
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
50
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
51
	}
51
	}
52
52
53
	public void testGetBugHistory() throws Exception {
53
	public void testGetBugHistory() throws Exception {
(-)src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java (-2 / +2 lines)
Lines 55-61 Link Here
55
		handler = connector.getTaskDataHandler();
55
		handler = connector.getTaskDataHandler();
56
		repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL);
56
		repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_222_URL);
57
		Credentials credentials = TestUtil.readCredentials();
57
		Credentials credentials = TestUtil.readCredentials();
58
		repository.setAuthenticationCredentials(credentials.username, credentials.password);
58
		repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
59
	}
59
	}
60
60
61
	/**
61
	/**
Lines 64-70 Link Here
64
	public void testAddCredentials() {
64
	public void testAddCredentials() {
65
		if (!repository.hasCredentials()) {
65
		if (!repository.hasCredentials()) {
66
			Credentials credentials = TestUtil.readCredentials();
66
			Credentials credentials = TestUtil.readCredentials();
67
			repository.setAuthenticationCredentials(credentials.username, credentials.password);
67
			repository.setAuthenticationCredentials(credentials.username, credentials.password, true);
68
68
69
			assertTrue(repository.hasCredentials());
69
			assertTrue(repository.hasCredentials());
70
		}
70
		}

Return to bug 200634