Project

General

Profile

Actions

Bug #44678

open

Can not set CORS via AWS S3 API

Added by J F about 4 years ago. Updated about 4 years ago.

Status:
New
Priority:
Normal
Assignee:
Target version:
% Done:

0%

Source:
Community (user)
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
rgw
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

We use ceph and radosgw to access our storage via the s3 java api. When we try to set a CORS rule, the java api returns an AmazonS3Exception (printing out "null") with the error code MalformedXML (debugging shows that none of the fields of my CORSRule objects has a field that is null).

I was exactly following the s3 guide here: https://docs.amazonaws.cn/en_us/AmazonS3/latest/dev/ManageCorsUsingJava.html

This is my implementation:

private void setCORS() {
    List<CORSRule> corsRules = new ArrayList<>();
    corsRules.add(new CORSRule().withAllowedOrigins(Arrays.asList("*ROCKET_CHAT_DOMAIN*")). //
            withAllowedMethods(Arrays.asList(AllowedMethods.PUT, AllowedMethods.POST, AllowedMethods.GET, AllowedMethods.HEAD)). //
            withMaxAgeSeconds(3000). //
            withAllowedHeaders(Arrays.asList("*")));
    s3Client.setBucketCrossOriginConfiguration(cephBucket, new BucketCrossOriginConfiguration(corsRules));
}

Strange is that the windows tool S3 browser returns the exact same result when I try to create the CORS rule.

Does anybody have experinece setting CORS rules via radosgw in ceph? Optimally using the S3 libraries?

Actions #1

Updated by Casey Bodley about 4 years ago

  • Assignee set to Ali Maredia
Actions

Also available in: Atom PDF