@Test void testAppendBucketNameHostHeader() throws SecurityException, NoSuchMethodException { GeneratedHttpRequest request = processor.createRequest( method(S3Client.class, "getBucketLocation", String.class), ImmutableList.<Object>of("bucket")); StringBuilder builder = new StringBuilder(); ((RequestAuthorizeSignatureV2) filter).appendBucketName(request, builder); assertEquals(builder.toString(), ""); }
@VisibleForTesting void appendBucketName(HttpRequest req, StringBuilder toSign) { String bucketName = S3Utils.getBucketName(req); if (isVhostStyle && bucketName != null && bucketName.equals(bucketName.toLowerCase())) { toSign.append(servicePath).append(bucketName); } }
RequestAuthorizeSignatureV2 implements RequestAuthorizeSignature, RequestSigner { @VisibleForTesting void appendBucketName(HttpRequest req, StringBuilder toSign) { String bucketName = S3Utils.getBucketName(req); if (isVhostStyle && bucketName != null && bucketName.equals(bucketName.toLowerCase())) { toSign.append(servicePath).append(bucketName); } } }
RequestAuthorizeSignatureV2 implements RequestAuthorizeSignature, RequestSigner { @VisibleForTesting void appendBucketName(HttpRequest req, StringBuilder toSign) { String bucketName = S3Utils.getBucketName(req); if (isVhostStyle && bucketName != null && bucketName.equals(bucketName.toLowerCase())) { toSign.append(servicePath).append(bucketName); } } @Inject  RequestAuthorizeSignatureV2(SignatureWire signatureWire, @Named(PROPERTY_AUTH_TAG) String authTag,
         @Named(PROPERTY_S3_VIRTUAL_HOST_BUCKETS) boolean isVhostStyle,
         @Named(PROPERTY_S3_SERVICE_PATH) String servicePath, @Named(PROPERTY_HEADER_TAG) String headerTag,
         @org.jclouds.location.Provider Supplier<Credentials> creds,
         @TimeStamp Provider<String> timeStampProvider, Crypto crypto, HttpUtils utils,
         DateService dateService); }
RequestAuthorizeSignatureV2 implements RequestAuthorizeSignature, RequestSigner { @VisibleForTesting void appendBucketName(HttpRequest req, StringBuilder toSign) { String bucketName = S3Utils.getBucketName(req); if (isVhostStyle && bucketName != null && bucketName.equals(bucketName.toLowerCase())) { toSign.append(servicePath).append(bucketName); } } @Inject  RequestAuthorizeSignatureV2(SignatureWire signatureWire, @Named(PROPERTY_AUTH_TAG) String authTag,
         @Named(PROPERTY_S3_VIRTUAL_HOST_BUCKETS) boolean isVhostStyle,
         @Named(PROPERTY_S3_SERVICE_PATH) String servicePath, @Named(PROPERTY_HEADER_TAG) String headerTag,
         @org.jclouds.location.Provider Supplier<Credentials> creds,
         @TimeStamp Provider<String> timeStampProvider, Crypto crypto, HttpUtils utils,
         DateService dateService); HttpRequest filter(HttpRequest request); String createStringToSign(HttpRequest request); String sign(String toSign); @Override HttpRequest signForTemporaryAccess(HttpRequest request, long timeInSeconds); }
RequestAuthorizeSignatureV2 implements RequestAuthorizeSignature, RequestSigner { @VisibleForTesting void appendBucketName(HttpRequest req, StringBuilder toSign) { String bucketName = S3Utils.getBucketName(req); if (isVhostStyle && bucketName != null && bucketName.equals(bucketName.toLowerCase())) { toSign.append(servicePath).append(bucketName); } } @Inject  RequestAuthorizeSignatureV2(SignatureWire signatureWire, @Named(PROPERTY_AUTH_TAG) String authTag,
         @Named(PROPERTY_S3_VIRTUAL_HOST_BUCKETS) boolean isVhostStyle,
         @Named(PROPERTY_S3_SERVICE_PATH) String servicePath, @Named(PROPERTY_HEADER_TAG) String headerTag,
         @org.jclouds.location.Provider Supplier<Credentials> creds,
         @TimeStamp Provider<String> timeStampProvider, Crypto crypto, HttpUtils utils,
         DateService dateService); HttpRequest filter(HttpRequest request); String createStringToSign(HttpRequest request); String sign(String toSign); @Override HttpRequest signForTemporaryAccess(HttpRequest request, long timeInSeconds);  }