Skip to content

Commit

Permalink
Allow partyinfo to update url (#952)
Browse files Browse the repository at this point in the history
* Allow partyinfo to update existing key with new url. This was the behaviour before 0.10. Log message to recommend users to switch on remote key validation for better security

* Update unit test for partyinfo service
  • Loading branch information
namtruong authored and melowe committed Dec 31, 2019
1 parent f7fd8b8 commit f6f5b60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public PartyInfo updatePartyInfo(final PartyInfo partyInfo) {

if (!this.validateKeysToUrls(existingPartyInfo, partyInfo)) {
LOGGER.warn(
"Attempt is being made to update existing key with new url. Terminating party info update.");
return this.getPartyInfo();
"Attempt is being made to update existing key with new url. " +
"Please switch on remote key validation to avoid a security breach.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public void createWithFactoryConstructor() throws Exception {
}

@Test
public void attemptToUpdateRecipientWithExistingKeyWithNewUrlIsIgnoredIfToggleDisabled() {
public void attemptToUpdateRecipientWithExistingKeyWithNewUrlIfToggleDisabled() {
// setup services
final FeatureToggles featureToggles = new FeatureToggles();
featureToggles.setEnableRemoteKeyValidation(false);
Expand Down Expand Up @@ -305,6 +305,7 @@ public void attemptToUpdateRecipientWithExistingKeyWithNewUrlIsIgnoredIfToggleDi
assertThat(updatedInfo.getRecipients()).hasSize(1).containsExactly(new Recipient(testKey, uri));
verify(partyInfoStore, times(2)).getPartyInfo();
verify(configService).featureToggles();
verify(configService).isDisablePeerDiscovery();
}

@Test
Expand Down

0 comments on commit f6f5b60

Please sign in to comment.