@Test public void notSignedRequestFailuresTest() throws Exception { AmbryUrlSigningService signer = getUrlSignerWithDefaults(new MockTime()); RestRequest request = getRequestFromUrl(RestMethod.GET, "/"); assertFalse("Request should not be declared signed", signer.isRequestSigned(request)); ensureVerificationFailure(signer, request, RestServiceErrorCode.InternalServerError); request.setArg(RestUtils.Headers.URL_TYPE, RestMethod.POST.name()); assertFalse("Request should not be declared signed", signer.isRequestSigned(request)); ensureVerificationFailure(signer, request, RestServiceErrorCode.InternalServerError); }
@Override public boolean isRequestSigned(RestRequest restRequest) { Map<String, Object> args = restRequest.getArgs(); return args.containsKey(RestUtils.Headers.URL_TYPE) && args.containsKey(LINK_EXPIRY_TIME); }
AmbryUrlSigningService implements UrlSigningService { @Override public boolean isRequestSigned(RestRequest restRequest) { Map<String, Object> args = restRequest.getArgs(); return args.containsKey(RestUtils.Headers.URL_TYPE) && args.containsKey(LINK_EXPIRY_TIME); } }
AmbryUrlSigningService implements UrlSigningService { @Override public boolean isRequestSigned(RestRequest restRequest) { Map<String, Object> args = restRequest.getArgs(); return args.containsKey(RestUtils.Headers.URL_TYPE) && args.containsKey(LINK_EXPIRY_TIME); } AmbryUrlSigningService(String uploadEndpoint, String downloadEndpoint, long defaultUrlTtlSecs,
      long defaultMaxUploadSize, long maxUrlTtlSecs, long chunkUploadInitialChunkTtlSecs, long chunkUploadMaxChunkSize,
      Time time); }
AmbryUrlSigningService implements UrlSigningService { @Override public boolean isRequestSigned(RestRequest restRequest) { Map<String, Object> args = restRequest.getArgs(); return args.containsKey(RestUtils.Headers.URL_TYPE) && args.containsKey(LINK_EXPIRY_TIME); } AmbryUrlSigningService(String uploadEndpoint, String downloadEndpoint, long defaultUrlTtlSecs,
      long defaultMaxUploadSize, long maxUrlTtlSecs, long chunkUploadInitialChunkTtlSecs, long chunkUploadMaxChunkSize,
      Time time); @Override String getSignedUrl(RestRequest restRequest); @Override boolean isRequestSigned(RestRequest restRequest); @Override void verifySignedRequest(RestRequest restRequest); String getUploadEndpoint(); String getDownloadEndpoint(); }
AmbryUrlSigningService implements UrlSigningService { @Override public boolean isRequestSigned(RestRequest restRequest) { Map<String, Object> args = restRequest.getArgs(); return args.containsKey(RestUtils.Headers.URL_TYPE) && args.containsKey(LINK_EXPIRY_TIME); } AmbryUrlSigningService(String uploadEndpoint, String downloadEndpoint, long defaultUrlTtlSecs,
      long defaultMaxUploadSize, long maxUrlTtlSecs, long chunkUploadInitialChunkTtlSecs, long chunkUploadMaxChunkSize,
      Time time); @Override String getSignedUrl(RestRequest restRequest); @Override boolean isRequestSigned(RestRequest restRequest); @Override void verifySignedRequest(RestRequest restRequest); String getUploadEndpoint(); String getDownloadEndpoint();  }