#1141 Fix review remarks by @games647

- Use SHA512 to generate keys instead of default SHA1
- Declare google authenticator dependency as optional and add relocation rule
This commit is contained in:
ljacqu
2018-04-03 00:12:25 +02:00
parent 2bf78dd186
commit 9326094d9c
4 changed files with 34 additions and 19 deletions
@@ -36,7 +36,7 @@ public class TotpAuthenticatorTest {
@Before
public void initializeTotpAuthenticator() {
totpAuthenticator = new TotpAuthenticator(googleAuthenticator, bukkitService);
totpAuthenticator = new TotpAuthenticatorTestImpl(bukkitService);
}
@Test
@@ -85,4 +85,16 @@ public class TotpAuthenticatorTest {
assertThat(result, equalTo(false));
verifyZeroInteractions(googleAuthenticator);
}
private final class TotpAuthenticatorTestImpl extends TotpAuthenticator {
TotpAuthenticatorTestImpl(BukkitService bukkitService) {
super(bukkitService);
}
@Override
protected IGoogleAuthenticator createGoogleAuthenticator() {
return googleAuthenticator;
}
}
}