kopia lustrzana https://github.com/gaul/s3proxy
Compare identity in blobstore locator
This allows S3Proxy to return the more specific InvalidAccessKeyId instead of SignatureDoesNotMatch. Addresses a s3-tests regression in s3tests.functional.test_s3:test_list_buckets_invalid_auth.pull/53/head
rodzic
1981730a0e
commit
7271a5ace6
|
@ -158,13 +158,16 @@ final class S3ProxyHandler extends AbstractHandler {
|
|||
XMLOutputFactory.newInstance();
|
||||
private BlobStoreLocator blobStoreLocator;
|
||||
|
||||
S3ProxyHandler(final BlobStore blobStore, String identity,
|
||||
S3ProxyHandler(final BlobStore blobStore, final String identity,
|
||||
final String credential, Optional<String> virtualHost) {
|
||||
if (identity != null) {
|
||||
blobStoreLocator = new BlobStoreLocator() {
|
||||
@Override
|
||||
public Map.Entry<String, BlobStore> locateBlobStore(
|
||||
String identity, String container, String blob) {
|
||||
String identityArg, String container, String blob) {
|
||||
if (!identity.equals(identityArg)) {
|
||||
return null;
|
||||
}
|
||||
return Maps.immutableEntry(credential, blobStore);
|
||||
}
|
||||
};
|
||||
|
@ -174,7 +177,7 @@ final class S3ProxyHandler extends AbstractHandler {
|
|||
blobStoreLocator = new BlobStoreLocator() {
|
||||
@Override
|
||||
public Map.Entry<String, BlobStore> locateBlobStore(
|
||||
String identity, String container, String blob) {
|
||||
String identityArg, String container, String blob) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
|
Ładowanie…
Reference in New Issue