Skip to content

ceph: fix SignatureDoesNotMatch by using correct secret key when create bucket #11115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,19 +193,19 @@
policyConfig = "{\"Version\":\"2012-10-17\",\"Statement\":[]}";
}

AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getAccessKey());
AmazonS3 client = getS3Client(getStoreURL(storeId), bucket.getAccessKey(), bucket.getSecretKey());

Check warning on line 196 in plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java

View check run for this annotation

Codecov / codecov/patch

plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java#L196

Added line #L196 was not covered by tests
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());

Check warning on line 202 in plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java

View check run for this annotation

Codecov / codecov/patch

plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java#L202

Added line #L202 was not covered by tests
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());

Check warning on line 208 in plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java

View check run for this annotation

Codecov / codecov/patch

plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java#L208

Added line #L208 was not covered by tests
Comment on lines +196 to +208
Copy link
Preview

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider extracting the repeated getS3Client initialization into a private helper method to reduce duplication and improve readability across bucket operations.

Copilot uses AI. Check for mistakes.

client.deleteBucketPolicy(new DeleteBucketPolicyRequest(bucket.getName()));
}

Expand Down Expand Up @@ -255,7 +255,7 @@

@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());

Check warning on line 258 in plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java

View check run for this annotation

Codecov / codecov/patch

plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java#L258

Added line #L258 was not covered by tests
try {
BucketVersioningConfiguration configuration =
new BucketVersioningConfiguration().withStatus("Enabled");
Expand All @@ -272,7 +272,7 @@

@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());

Check warning on line 275 in plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java

View check run for this annotation

Codecov / codecov/patch

plugins/storage/object/ceph/src/main/java/org/apache/cloudstack/storage/datastore/driver/CephObjectStoreDriverImpl.java#L275

Added line #L275 was not covered by tests
try {
BucketVersioningConfiguration configuration =
new BucketVersioningConfiguration().withStatus("Suspended");
Expand Down
Loading