mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ceph: fix SignatureDoesNotMatch by using correct secret key (#11115)
Ensure bucket.getSecretKey() is used when building the S3 client. Previously, only getAccessKey() was passed for both key and secret, causing V4 signature validation failures during operations such as bucket creation and policy updates. Co-authored-by: Jean Vetorello <jean@paneas.com>
This commit is contained in:
parent
a84c4cb351
commit
ccd86d96d9
@ -193,19 +193,19 @@ public class CephObjectStoreDriverImpl extends BaseObjectStoreDriverImpl {
|
||||
policyConfig = "{\"Version\":\"2012-10-17\",\"Statement\":[]}";
|
||||
}
|
||||
|
||||
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey());
|
||||
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey());
|
||||
client.setBucketPolicy(new SetBucketPolicyRequest(bucket.getName(), policyConfig));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BucketPolicy getBucketPolicy(BucketTO bucket, long storeId) {
|
||||
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey());
|
||||
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey());
|
||||
return client.getBucketPolicy(new GetBucketPolicyRequest(bucket.getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBucketPolicy(BucketTO bucket, long storeId) {
|
||||
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey());
|
||||
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey());
|
||||
client.deleteBucketPolicy(new DeleteBucketPolicyRequest(bucket.getName()));
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ public class CephObjectStoreDriverImpl extends BaseObjectStoreDriverImpl {
|
||||
|
||||
@Override
|
||||
public boolean setBucketVersioning(BucketTO bucket, long storeId) {
|
||||
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey());
|
||||
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey());
|
||||
try {
|
||||
BucketVersioningConfiguration configuration =
|
||||
new BucketVersioningConfiguration().withStatus("Enabled");
|
||||
@ -272,7 +272,7 @@ public class CephObjectStoreDriverImpl extends BaseObjectStoreDriverImpl {
|
||||
|
||||
@Override
|
||||
public boolean deleteBucketVersioning(BucketTO bucket, long storeId) {
|
||||
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey());
|
||||
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey());
|
||||
try {
|
||||
BucketVersioningConfiguration configuration =
|
||||
new BucketVersioningConfiguration().withStatus("Suspended");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user