@Test void testAclQueryStringComp() { URI host = URI.create("http: HttpRequest request = HttpRequest.builder().method(HttpMethod.GET).endpoint(host).build(); StringBuilder builder = new StringBuilder(); filter.appendUriPath(request, builder); assertEquals(builder.toString(), "/mycontainer?comp=list"); }
@VisibleForTesting void appendUriPath(HttpRequest request, StringBuilder toSign) { toSign.append(request.getEndpoint().getRawPath()); if (request.getEndpoint().getQuery() != null) { StringBuilder paramsToSign = new StringBuilder("?"); String[] params = request.getEndpoint().getQuery().split("&"); for (String param : params) { String[] paramNameAndValue = param.split("="); if ("comp".equals(paramNameAndValue[0])) { paramsToSign.append(param); } } if (paramsToSign.length() > 1) { toSign.append(paramsToSign); } } }
SharedKeyLiteAuthentication implements HttpRequestFilter { @VisibleForTesting void appendUriPath(HttpRequest request, StringBuilder toSign) { toSign.append(request.getEndpoint().getRawPath()); if (request.getEndpoint().getQuery() != null) { StringBuilder paramsToSign = new StringBuilder("?"); String[] params = request.getEndpoint().getQuery().split("&"); for (String param : params) { String[] paramNameAndValue = param.split("="); if ("comp".equals(paramNameAndValue[0])) { paramsToSign.append(param); } } if (paramsToSign.length() > 1) { toSign.append(paramsToSign); } } } }
SharedKeyLiteAuthentication implements HttpRequestFilter { @VisibleForTesting void appendUriPath(HttpRequest request, StringBuilder toSign) { toSign.append(request.getEndpoint().getRawPath()); if (request.getEndpoint().getQuery() != null) { StringBuilder paramsToSign = new StringBuilder("?"); String[] params = request.getEndpoint().getQuery().split("&"); for (String param : params) { String[] paramNameAndValue = param.split("="); if ("comp".equals(paramNameAndValue[0])) { paramsToSign.append(param); } } if (paramsToSign.length() > 1) { toSign.append(paramsToSign); } } } @Inject  SharedKeyLiteAuthentication(SignatureWire signatureWire,
         @org.jclouds.location.Provider Supplier<Credentials> creds, @TimeStamp Provider<String> timeStampProvider,
         Crypto crypto, HttpUtils utils, @Named("sasAuth") boolean sasAuthentication); }
SharedKeyLiteAuthentication implements HttpRequestFilter { @VisibleForTesting void appendUriPath(HttpRequest request, StringBuilder toSign) { toSign.append(request.getEndpoint().getRawPath()); if (request.getEndpoint().getQuery() != null) { StringBuilder paramsToSign = new StringBuilder("?"); String[] params = request.getEndpoint().getQuery().split("&"); for (String param : params) { String[] paramNameAndValue = param.split("="); if ("comp".equals(paramNameAndValue[0])) { paramsToSign.append(param); } } if (paramsToSign.length() > 1) { toSign.append(paramsToSign); } } } @Inject  SharedKeyLiteAuthentication(SignatureWire signatureWire,
         @org.jclouds.location.Provider Supplier<Credentials> creds, @TimeStamp Provider<String> timeStampProvider,
         Crypto crypto, HttpUtils utils, @Named("sasAuth") boolean sasAuthentication); HttpRequest filter(HttpRequest request); HttpRequest filterSAS(HttpRequest request, String credential); HttpRequest filterKey(HttpRequest request); String[] cutUri(URI uri); String createStringToSign(HttpRequest request); String calculateSignature(String toSign); String signString(String toSign); }
SharedKeyLiteAuthentication implements HttpRequestFilter { @VisibleForTesting void appendUriPath(HttpRequest request, StringBuilder toSign) { toSign.append(request.getEndpoint().getRawPath()); if (request.getEndpoint().getQuery() != null) { StringBuilder paramsToSign = new StringBuilder("?"); String[] params = request.getEndpoint().getQuery().split("&"); for (String param : params) { String[] paramNameAndValue = param.split("="); if ("comp".equals(paramNameAndValue[0])) { paramsToSign.append(param); } } if (paramsToSign.length() > 1) { toSign.append(paramsToSign); } } } @Inject  SharedKeyLiteAuthentication(SignatureWire signatureWire,
         @org.jclouds.location.Provider Supplier<Credentials> creds, @TimeStamp Provider<String> timeStampProvider,
         Crypto crypto, HttpUtils utils, @Named("sasAuth") boolean sasAuthentication); HttpRequest filter(HttpRequest request); HttpRequest filterSAS(HttpRequest request, String credential); HttpRequest filterKey(HttpRequest request); String[] cutUri(URI uri); String createStringToSign(HttpRequest request); String calculateSignature(String toSign); String signString(String toSign);  }