#1141 Split TOTP permissions for add/remove, refactor TOTP services

- Split TotpService further into GenerateTotpService and TotpAuthenticator, which wraps the GoogleAuthenticator impl
- Add missing tests for the services
- Change GenerateTotpService's interface to behave like a collection for more intuitive method behavior
This commit is contained in:
ljacqu
2018-03-10 16:21:53 +01:00
parent e72d5d5e81
commit eb9cd31a65
17 changed files with 478 additions and 228 deletions
@@ -71,9 +71,14 @@ public enum PlayerPermission implements PermissionNode {
VERIFICATION_CODE("authme.player.security.verificationcode"),
/**
* Permission to enable and disable TOTP.
* Permission to enable two-factor authentication.
*/
TOGGLE_TOTP_STATUS("authme.player.totp");
ENABLE_TWO_FACTOR_AUTH("authme.player.totpadd"),
/**
* Permission to disable two-factor authentication.
*/
DISABLE_TWO_FACTOR_AUTH("authme.player.totpremove");
/**
* The permission node.