Skip to content

Commit

Permalink
IdentityClientOptions clone method mistakenly enables probing for bro…
Browse files Browse the repository at this point in the history
…ker support (#39002)
  • Loading branch information
billwert committed Mar 1, 2024
1 parent a55b723 commit 5688333
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -818,9 +818,12 @@ public IdentityClientOptions clone() {
.setPerCallPolicies(this.perCallPolicies)
.setPerRetryPolicies(this.perRetryPolicies)
.setBrowserCustomizationOptions(this.browserCustomizationOptions)
.setChained(this.isChained)
.setBrokerWindowHandle(this.brokerWindowHandle)
.setEnableLegacyMsaPassthrough(this.enableMsaPassthrough);
.setChained(this.isChained);

if (isBrokerEnabled()) {
clone.setBrokerWindowHandle(this.brokerWindowHandle);
clone.setEnableLegacyMsaPassthrough(this.enableMsaPassthrough);
}
if (!isInstanceDiscoveryEnabled()) {
clone.disableInstanceDiscovery();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,13 @@ public void testDisableAuthorityValidationAndInstanceDiscovery() {
identityClientOptions.disableInstanceDiscovery();
Assertions.assertFalse(identityClientOptions.isInstanceDiscoveryEnabled());
}

@Test
public void testCloneDoesNotEnableThingsItShouldNot() {
IdentityClientOptions identityClientOptions = new IdentityClientOptions();

IdentityClientOptions clonedOptions = identityClientOptions.clone();
Assertions.assertFalse(clonedOptions.isBrokerEnabled());
Assertions.assertFalse(clonedOptions.isUnsafeSupportLoggingEnabled());
}
}

0 comments on commit 5688333

Please sign in to comment.