@Test public void getValidityShouldReturnFalseOnNonValidSignatures() throws Exception { zonedDateTimeProvider.setFixedDateTime(DATE); ContinuationToken pirateContinuationToken = new ContinuationToken("user", DATE.plusMinutes(15), "fake"); assertThat(tokenManager.getValidity(pirateContinuationToken)).isEqualTo(TokenStatus.INVALID); }
@Override public TokenStatus getValidity(SignedExpiringToken token) { Preconditions.checkNotNull(token); if (! isCorrectlySigned(token)) { return TokenStatus.INVALID; } if (isExpired(token)) { return TokenStatus.EXPIRED; } return TokenStatus.OK; }
SignedTokenManager implements SimpleTokenManager { @Override public TokenStatus getValidity(SignedExpiringToken token) { Preconditions.checkNotNull(token); if (! isCorrectlySigned(token)) { return TokenStatus.INVALID; } if (isExpired(token)) { return TokenStatus.EXPIRED; } return TokenStatus.OK; } }
SignedTokenManager implements SimpleTokenManager { @Override public TokenStatus getValidity(SignedExpiringToken token) { Preconditions.checkNotNull(token); if (! isCorrectlySigned(token)) { return TokenStatus.INVALID; } if (isExpired(token)) { return TokenStatus.EXPIRED; } return TokenStatus.OK; } @Inject  SignedTokenManager(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); }
SignedTokenManager implements SimpleTokenManager { @Override public TokenStatus getValidity(SignedExpiringToken token) { Preconditions.checkNotNull(token); if (! isCorrectlySigned(token)) { return TokenStatus.INVALID; } if (isExpired(token)) { return TokenStatus.EXPIRED; } return TokenStatus.OK; } @Inject  SignedTokenManager(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); @Override TokenStatus getValidity(SignedExpiringToken token); @Override boolean isValid(SignedExpiringToken token); }
SignedTokenManager implements SimpleTokenManager { @Override public TokenStatus getValidity(SignedExpiringToken token) { Preconditions.checkNotNull(token); if (! isCorrectlySigned(token)) { return TokenStatus.INVALID; } if (isExpired(token)) { return TokenStatus.EXPIRED; } return TokenStatus.OK; } @Inject  SignedTokenManager(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); @Override TokenStatus getValidity(SignedExpiringToken token); @Override boolean isValid(SignedExpiringToken token);  }