Skip to content

Commit

Permalink
Merge pull request #207 from Microsoft/users/arukhlin/us985181
Browse files Browse the repository at this point in the history
Version 14.119.1
  • Loading branch information
AlexRukhlin authored Jun 8, 2017
2 parents c3afb85 + 8cedad4 commit 9972c13
Show file tree
Hide file tree
Showing 72 changed files with 580 additions and 385 deletions.
4 changes: 2 additions & 2 deletions build/build-1-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
number.version.minor ("0")
number.version.service ("2")
number.version.build ("1234XYZ")
string.version.1-2-3 ("14.119.0")
string.version.1-2-3-4 ("14.119.0.1234XYZ")
string.version.1-2-3 ("14.119.1")
string.version.1-2-3-4 ("14.119.1.1234XYZ")
-->
<target name="read_version_config">

Expand Down
14 changes: 7 additions & 7 deletions build/category.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature url="features/com.microsoft.tfs.client.eclipse.feature_14.119.0.qualifier.jar" id="com.microsoft.tfs.client.eclipse.feature" version="14.119.0.qualifier">
<feature url="features/com.microsoft.tfs.client.eclipse.feature_14.119.1.qualifier.jar" id="com.microsoft.tfs.client.eclipse.feature" version="14.119.1.qualifier">
<category name="com.microsoft.tfs.client.eclipse.category"/>
</feature>
<feature url="features/com.microsoft.tfs.client.eclipse.nl1.feature_14.119.0.qualifier.jar" id="com.microsoft.tfs.client.eclipse.nl1.feature" version="14.119.0.qualifier">
<feature url="features/com.microsoft.tfs.client.eclipse.nl1.feature_14.119.1.qualifier.jar" id="com.microsoft.tfs.client.eclipse.nl1.feature" version="14.119.1.qualifier">
<category name="com.microsoft.tfs.client.eclipse.category"/>
</feature>
<feature url="features/com.microsoft.tfs.client.eclipse.nlz.feature_14.119.0.qualifier.jar" id="com.microsoft.tfs.client.eclipse.nlz.feature" version="14.119.0.qualifier">
<feature url="features/com.microsoft.tfs.client.eclipse.nlz.feature_14.119.1.qualifier.jar" id="com.microsoft.tfs.client.eclipse.nlz.feature" version="14.119.1.qualifier">
<category name="com.microsoft.tfs.client.eclipse.language-packs.category"/>
</feature>
<feature url="features/com.microsoft.tfs.pt.alertsubscription.feature_14.119.0.qualifier.jar" id="com.microsoft.tfs.pt.alertsubscription.feature" version="14.119.0.qualifier">
<feature url="features/com.microsoft.tfs.pt.alertsubscription.feature_14.119.1.qualifier.jar" id="com.microsoft.tfs.pt.alertsubscription.feature" version="14.119.1.qualifier">
<category name="com.microsoft.tfs.pt.category"/>
</feature>
<feature url="features/com.microsoft.tfs.pt.findinsce.feature_14.119.0.qualifier.jar" id="com.microsoft.tfs.pt.findinsce.feature" version="14.119.0.qualifier">
<feature url="features/com.microsoft.tfs.pt.findinsce.feature_14.119.1.qualifier.jar" id="com.microsoft.tfs.pt.findinsce.feature" version="14.119.1.qualifier">
<category name="com.microsoft.tfs.pt.category"/>
</feature>
<feature url="features/com.microsoft.tfs.pt.testrunner.feature_14.119.0.qualifier.jar" id="com.microsoft.tfs.pt.testrunner.feature" version="14.119.0.qualifier">
<feature url="features/com.microsoft.tfs.pt.testrunner.feature_14.119.1.qualifier.jar" id="com.microsoft.tfs.pt.testrunner.feature" version="14.119.1.qualifier">
<category name="com.microsoft.tfs.pt.category"/>
</feature>
<feature url="features/com.microsoft.tfs.pt.wit.templates.feature_14.119.0.qualifier.jar" id="com.microsoft.tfs.pt.wit.templates.feature" version="14.119.0.qualifier">
<feature url="features/com.microsoft.tfs.pt.wit.templates.feature_14.119.1.qualifier.jar" id="com.microsoft.tfs.pt.wit.templates.feature" version="14.119.1.qualifier">
<category name="com.microsoft.tfs.pt.category"/>
</feature>
<category-def name="com.microsoft.tfs.client.eclipse.category" label="Team Explorer Everywhere">
Expand Down
4 changes: 2 additions & 2 deletions build/product_version.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This comment contains the full version number (14.119.0) so this file gets
# This comment contains the full version number (14.119.1) so this file gets
# picked up when doing workspace searches for the version number string.

number.version.major=14
number.version.minor=119
number.version.service=0
number.version.service=1
# number.version.build gets defined at build time.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.checkinpolicies.build; singleton:=true
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Activator: com.microsoft.tfs.checkinpolicies.build.TFSBuildCheckinPolicyPlugin
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.checkinpolicies.checkforcomments; singleton:=true
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Export-Package: com.microsoft.tfs.checkinpolicies.checkforcomments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.checkinpolicies.forbiddenpatterns; singleton:=true
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Export-Package: com.microsoft.tfs.checkinpolicies.forbiddenpatterns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.checkinpolicies.workitempolicy; singleton:=true
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.checkinpolicies.workitemquerypolicy; singleton:=true
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Export-Package: com.microsoft.tfs.checkinpolicies.workitemquerypolicy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.checkinpolicies; singleton:=true
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Activator: com.microsoft.tfs.checkinpolicies.TFSCheckinPoliciesPlugin
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Expand Down
2 changes: 1 addition & 1 deletion source/com.microsoft.tfs.client.clc.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="com.microsoft.tfs.client.clc.feature"
label="%Feature-Name"
version="14.119.0.qualifier"
version="14.119.1.qualifier"
provider-name="%Feature-Vendor">

<description>
Expand Down
2 changes: 1 addition & 1 deletion source/com.microsoft.tfs.client.clc/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.client.clc
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Require-Bundle: com.microsoft.tfs.console,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.client.common.pid
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.client.common.ui.teambuild.egit;singleton:=true
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.client.common.ui.teambuild; singleton:=true
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Activator: com.microsoft.tfs.client.common.ui.teambuild.TFSTeamBuildPlugin
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.client.common.ui.vcexplorer; singleton:=true
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Activator: com.microsoft.tfs.client.common.ui.vcexplorer.TFSVersionControlExplorerPlugin
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: com.microsoft.tfs.client.common.ui; singleton:=true
Bundle-Version: 14.119.0.qualifier
Bundle-Version: 14.119.1.qualifier
Bundle-Activator: com.microsoft.tfs.client.common.ui.TFSCommonUIClientPlugin
Bundle-Vendor: %Bundle-Vendor
Eclipse-LazyStart: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import com.microsoft.tfs.core.httpclient.URI;
import com.microsoft.tfs.core.httpclient.URIException;
import com.microsoft.tfs.core.httpclient.UsernamePasswordCredentials;
import com.microsoft.tfs.core.httpclient.UsernamePasswordCredentials.PatCredentials;
import com.microsoft.tfs.core.httpclient.cookie.CookiePolicy;
import com.microsoft.tfs.core.httpclient.cookie.CookieSpec;
import com.microsoft.tfs.core.ws.runtime.client.SOAPRequest;
Expand Down Expand Up @@ -278,18 +277,37 @@ public Status handleException(
else if (exception instanceof UnauthorizedException && service.isPromptForCredentials()) {
log.debug(" UnauthorizedException has been raised."); //$NON-NLS-1$

final Credentials usedCredentials = connectionInstanceData.getCredentials();
final java.net.URI serverUrl = connectionInstanceData.getServerURI();
final Header[] authHeaders = request.getPostMethod().getResponseHeaders("WWW-Authenticate"); //$NON-NLS-1$
boolean isHosted = true;
for (final Header header : authHeaders) {
if (header.getValue().equals("NTLM")) { //$NON-NLS-1$
isHosted = false;
break;
}
if (header.getValue().equals("Negotiate")) { //$NON-NLS-1$
isHosted = false;
break;
}
if (header.getValue().equals("Federated")) { //$NON-NLS-1$
break;
}
}

if (EnvironmentVariables.getBoolean(EnvironmentVariables.USE_OAUTH_LIBRARY, true)
&& isPatCredentials(connectionInstanceData.getCredentials())) {
&& usedCredentials != null
&& isHosted
&& new CachedCredentials(serverUrl, usedCredentials).isPatCredentials()) {
// PAT token is probably expired. Remove it from the Eclipse
// secure storage and retry.
final CredentialsManager credentialsManager =
EclipseCredentialsManagerFactory.getGitCredentialsManager();
credentialsManager.removeCredentials(connectionInstanceData.getServerURI());
dialogRunnable = new UITransportOAuthRunnable(connectionInstanceData.getServerURI());
final CredentialsManager credentialsManager = EclipseCredentialsManagerFactory.getCredentialsManager();
credentialsManager.removeCredentials(serverUrl);
dialogRunnable = new UITransportOAuthRunnable(serverUrl);
} else {
dialogRunnable = new UITransportUsernamePasswordAuthRunnable(
connectionInstanceData.getServerURI(),
connectionInstanceData.getCredentials(),
serverUrl,
usedCredentials,
(UnauthorizedException) exception);
}
}
Expand Down Expand Up @@ -331,17 +349,6 @@ else if (exception instanceof FederatedAuthFailedException) {
return Status.COMPLETE;
}

private boolean isPatCredentials(Credentials credentials) {
if (credentials == null) {
return false;
} else if (!(credentials instanceof UsernamePasswordCredentials)) {
return false;
} else {
final String userName = ((UsernamePasswordCredentials) credentials).getUsername();
return PatCredentials.USERNAME_FOR_CODE_ACCESS_PAT.equals(userName);
}
}

private void cleanupSavedCredentials(final HttpClient client) {
log.debug(" If any credentials were used they failed. Clean up saved credentials for the host"); //$NON-NLS-1$

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@
import com.microsoft.tfs.client.common.ui.Messages;
import com.microsoft.tfs.client.common.ui.controls.generic.BaseControl;
import com.microsoft.tfs.client.common.ui.dialogs.connect.AddServerDialog;
import com.microsoft.tfs.client.common.ui.dialogs.connect.CredentialsDialog;
import com.microsoft.tfs.client.common.ui.framework.helper.SWTUtil;
import com.microsoft.tfs.client.common.ui.framework.layout.GridDataBuilder;
import com.microsoft.tfs.client.common.ui.framework.validation.ButtonValidatorBinding;
import com.microsoft.tfs.client.common.ui.helpers.AutomationIDHelper;
import com.microsoft.tfs.client.common.ui.helpers.CredentialsHelper;
import com.microsoft.tfs.client.common.ui.helpers.UIConnectionPersistence;
import com.microsoft.tfs.core.TFSConnection;
import com.microsoft.tfs.core.config.persistence.DefaultPersistenceStoreProvider;
import com.microsoft.tfs.core.credentials.CachedCredentials;
import com.microsoft.tfs.core.credentials.CredentialsManager;
import com.microsoft.tfs.core.httpclient.Credentials;
import com.microsoft.tfs.core.util.ServerURIUtils;
import com.microsoft.tfs.core.util.serverlist.ServerList;
import com.microsoft.tfs.core.util.serverlist.ServerListConfigurationEntry;
Expand All @@ -40,6 +42,7 @@
public class ServerListControl extends BaseControl {
public static final String SERVERS_TABLE_ID = "ServerListControl.profilesTable"; //$NON-NLS-1$
public static final String ADD_BUTTON_ID = "ServerListControl.addButton"; //$NON-NLS-1$
public static final String AUTH_BUTTON_ID = "ServerListControl.authButton"; //$NON-NLS-1$
public static final String DELETE_BUTTON_ID = "ServerListControl.deleteButton"; //$NON-NLS-1$
public static final String CLEAR_BUTTON_ID = "ServerListControl.clearButton"; //$NON-NLS-1$

Expand Down Expand Up @@ -83,20 +86,19 @@ public void widgetSelected(final SelectionEvent e) {
}
});

final Button deleteButton =
SWTUtil.createButton(this, Messages.getString("ServerListControl.DeleteButtonText")); //$NON-NLS-1$
AutomationIDHelper.setWidgetID(deleteButton, DELETE_BUTTON_ID);
GridDataBuilder.newInstance().hFill().wButtonHint(deleteButton).applyTo(deleteButton);
deleteButton.addSelectionListener(new SelectionAdapter() {
final Button authButton = SWTUtil.createButton(this, Messages.getString("ServerListControl.AuthButtonText")); //$NON-NLS-1$
AutomationIDHelper.setWidgetID(authButton, AUTH_BUTTON_ID);
GridDataBuilder.newInstance().hFill().wButtonHint(authButton).applyTo(authButton);
authButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
ServerListControl.this.onDeleteButtonSelected(e);
ServerListControl.this.onAuthButtonSelected(e);
}
});
new ButtonValidatorBinding(deleteButton).bind(serverListTable.getSelectionValidator());
new ButtonValidatorBinding(authButton).bind(serverListTable.getSelectionValidator());

final Button clearButton = SWTUtil.createButton(this, Messages.getString("ServerListControl.ClearButtonText")); //$NON-NLS-1$
AutomationIDHelper.setWidgetID(deleteButton, CLEAR_BUTTON_ID);
AutomationIDHelper.setWidgetID(clearButton, CLEAR_BUTTON_ID);
GridDataBuilder.newInstance().hFill().wButtonHint(clearButton).applyTo(clearButton);
clearButton.addSelectionListener(new SelectionAdapter() {
@Override
Expand All @@ -106,6 +108,18 @@ public void widgetSelected(final SelectionEvent e) {
});
new ButtonValidatorBinding(clearButton).bind(serverListTable.getSelectionValidator());

final Button deleteButton =
SWTUtil.createButton(this, Messages.getString("ServerListControl.DeleteButtonText")); //$NON-NLS-1$
AutomationIDHelper.setWidgetID(deleteButton, DELETE_BUTTON_ID);
GridDataBuilder.newInstance().hFill().wButtonHint(deleteButton).applyTo(deleteButton);
deleteButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
ServerListControl.this.onDeleteButtonSelected(e);
}
});
new ButtonValidatorBinding(deleteButton).bind(serverListTable.getSelectionValidator());

serverListTable.addSelectionChangedListener(new ISelectionChangedListener() {

@Override
Expand All @@ -123,6 +137,9 @@ public void selectionChanged(final SelectionChangedEvent event) {
// is selected
deleteButton.setEnabled(!currentServerSelected);

// Enable authentication button if one and only one server is
// selected
authButton.setEnabled(selectedEntries.length == 1);
}
});
}
Expand Down Expand Up @@ -164,6 +181,28 @@ private void onAddButtonSelected(final SelectionEvent e) {
}
}

private void onAuthButtonSelected(SelectionEvent e) {
final CredentialsManager credentialsManager = EclipseCredentialsManagerFactory.getCredentialsManager();

final ServerListConfigurationEntry[] serverListEntries = serverListTable.getSelectedServerListEntries();
final ServerListConfigurationEntry selectedEntry = serverListEntries[0];
final URI serverUrl = selectedEntry.getURI();

final CredentialsDialog credentialsDialog = new CredentialsDialog(getShell(), serverUrl);

final CachedCredentials oldCachedCredentials = credentialsManager.getCredentials(serverUrl);
if (oldCachedCredentials != null && !oldCachedCredentials.isCookieCredentials()) {
credentialsDialog.setCredentials(oldCachedCredentials.toCredentials());
}

if (credentialsDialog.open() == IDialogConstants.OK_ID) {
final Credentials credentials = credentialsDialog.getCredentials();

final CachedCredentials newCachedCredentials = new CachedCredentials(serverUrl, credentials);
credentialsManager.setCredentials(newCachedCredentials);
}
}

private void onDeleteButtonSelected(final SelectionEvent e) {
final ServerListConfigurationEntry[] serverListEntries = serverListTable.getSelectedServerListEntries();

Expand Down Expand Up @@ -229,17 +268,14 @@ private void onClearButtonSelected(final SelectionEvent e) {

private void removeCredentials(final ServerListConfigurationEntry[] serverListEntries) {

final CredentialsManager teeCredentialsProvider =
EclipseCredentialsManagerFactory.getCredentialsManager(DefaultPersistenceStoreProvider.INSTANCE);
final CredentialsManager gitCredentialsProvider = EclipseCredentialsManagerFactory.getGitCredentialsManager();
final CredentialsManager credentialsManager = EclipseCredentialsManagerFactory.getCredentialsManager();

boolean removeOAuth2Token = false;
for (int i = 0; i < serverListEntries.length; i++) {
final ServerListConfigurationEntry serverListEntry = serverListEntries[i];
final URI url = serverListEntry.getURI();

teeCredentialsProvider.removeCredentials(url);
gitCredentialsProvider.removeCredentials(url);
credentialsManager.removeCredentials(url);

// Remove from OAuth2 access token from the internal store
removeOAuth2Token = removeOAuth2Token || ServerURIUtils.isHosted(url);
Expand Down
Loading

0 comments on commit 9972c13

Please sign in to comment.