@Test public void signedAttachmentAccessTokenShouldBeValidated() { String blobId = "blobId"; zonedDateTimeProvider.setFixedDateTime(DATE); String serializedToken = tokenFactory.generateAttachmentAccessToken("user", blobId).serialize(); assertThat(tokenManager.isValid(AttachmentAccessToken.from(serializedToken, blobId))).isTrue(); }
@Override public boolean isValid(SignedExpiringToken token) { Preconditions.checkNotNull(token); return TokenStatus.OK.equals(getValidity(token)); }
SignedTokenManager implements SimpleTokenManager { @Override public boolean isValid(SignedExpiringToken token) { Preconditions.checkNotNull(token); return TokenStatus.OK.equals(getValidity(token)); } }
SignedTokenManager implements SimpleTokenManager { @Override public boolean isValid(SignedExpiringToken token) { Preconditions.checkNotNull(token); return TokenStatus.OK.equals(getValidity(token)); } @Inject  SignedTokenManager(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); }
SignedTokenManager implements SimpleTokenManager { @Override public boolean isValid(SignedExpiringToken token) { Preconditions.checkNotNull(token); return TokenStatus.OK.equals(getValidity(token)); } @Inject  SignedTokenManager(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); @Override TokenStatus getValidity(SignedExpiringToken token); @Override boolean isValid(SignedExpiringToken token); }
SignedTokenManager implements SimpleTokenManager { @Override public boolean isValid(SignedExpiringToken token) { Preconditions.checkNotNull(token); return TokenStatus.OK.equals(getValidity(token)); } @Inject  SignedTokenManager(SignatureHandler signatureHandler, ZonedDateTimeProvider zonedDateTimeProvider); @Override TokenStatus getValidity(SignedExpiringToken token); @Override boolean isValid(SignedExpiringToken token);  }