Setting up CORS Configuration for a bucket

31 views
Skip to first unread message

jump...@gmail.com

unread,
Sep 17, 2014, 3:02:28 PM9/17/14
to jets3t...@googlegroups.com
Hi,

I want to change CORS Configuration of newly created bucket using JetS3t. I could not find any api for this. I want to change the configuration to support cross origin access.

Can anyone help?

Pankaj

James Murty

unread,
Sep 18, 2014, 9:28:21 AM9/18/14
to jets3t...@googlegroups.com
Hi,

JetS3t doesn't support applying CORS settings [1] to a bucket but you can use the AWS Management Console to do this [2].


--
You received this message because you are subscribed to the Google Groups "JetS3t Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jets3t-users...@googlegroups.com.
To post to this group, send email to jets3t...@googlegroups.com.
Visit this group at http://groups.google.com/group/jets3t-users.
For more options, visit https://groups.google.com/d/optout.

Paul Gregoire

unread,
Sep 13, 2016, 10:54:18 AM9/13/16
to JetS3t Users
James,
If you'd like to point me in the right direction code-wise, I'd be glad to see if I can get CORS support added in. I created an enhancement request for this very feature: https://bitbucket.org/jmurty/jets3t/issues/238/add-support-for-cors

Paul

James Murty

unread,
Sep 14, 2016, 9:05:15 AM9/14/16
to jets3t...@googlegroups.com
Hi Paul,

It would be great if you could submit a pull request for the CORS feature. There's very little chance I will get to it any time soon.

The REST API documentation to set/get/delete the CORS config is here: http://docs.aws.amazon.com/AmazonS3/latest/dev/EnableCorsUsingREST.html

To implement it the best course is probably to:
* copy the *BucketPolicyImpl methods in RestS3Service which work with bucket policy documents, which is almost the same thing. Adjust the new methods to work with CORS documents and the "cors" resource instead
* also copy the *BucketPolicy methods in S3Service which invoke the implementation methods
* add the "cors" request parameter name to the list returned by RestS3Service#getResourceParameterNames so the parameter is treated specially as a resource identifier
* add some unit tests. The existing TestRestS3Service#testLifecycleConfiguration is probably a good one to duplicate and adjust to test the CORS feature.

That should be about it...

 I assume the methods will take a corsXmlDocument string parameter or similar, and it's up to the caller to generate that somehow. In other cases like the `LifecycleConfig` class JetS3t provides helpers to build XML documents, but that would involve a lot more work and I doubt it's worth it for this case?

The java-xmlbuilder library already required/included with JetS3t might be useful for building CORS documents for testing.

Good luck with it. Let me know if you get stuck and I'll help as best I can.

Regards,
James


To unsubscribe from this group and stop receiving emails from it, send an email to jets3t-users+unsubscribe@googlegroups.com.

To post to this group, send email to jets3t...@googlegroups.com.

Mondain

unread,
Sep 14, 2016, 9:26:21 AM9/14/16
to jets3t...@googlegroups.com
Outstanding! I'll see what I can do, time permitting of course.


--
You received this message because you are subscribed to a topic in the Google Groups "JetS3t Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jets3t-users/HR9Zi4tUcvQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jets3t-users...@googlegroups.com.

To post to this group, send email to jets3t...@googlegroups.com.

Mondain

unread,
Sep 16, 2016, 10:08:58 AM9/16/16
to jets3t...@googlegroups.com
I've done all the initial code work + unit test (passing!); I should have a diff patch later today for your review if all goes well. I am attaching an image showing unit test failures in other areas, only so that you're aware.

Paul

jets3-unittests.png

Mondain

unread,
Sep 16, 2016, 2:34:21 PM9/16/16
to jets3t...@googlegroups.com
James,
Attached you'll find the working patch to support AWS S3 CORS. One thing I am having an issue with is the build, ant nor maven properly create the jets3 jar similar to whats found on maven central; if there is a profile or special step, please let me know, thanks!

Best Regards,
Paul
patch.txt

James Murty

unread,
Sep 21, 2016, 8:14:33 PM9/21/16
to jets3t...@googlegroups.com
Hi Paul,

I realise I hadn't gotten back to you about this patch, sorry about that.

I haven't had time to look at the patch or look into the test failures, but it is on my radar.

Cheers,
James


To unsubscribe from this group and stop receiving emails from it, send an email to jets3t-users+unsubscribe@googlegroups.com.

To post to this group, send email to jets3t...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "JetS3t Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jets3t-users/HR9Zi4tUcvQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jets3t-users+unsubscribe@googlegroups.com.

To post to this group, send email to jets3t...@googlegroups.com.
Visit this group at https://groups.google.com/group/jets3t-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "JetS3t Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jets3t-users+unsubscribe@googlegroups.com.

Mondain

unread,
Sep 21, 2016, 8:34:14 PM9/21/16
to jets3t...@googlegroups.com
Its all good James, I'm sure most of us are pretty busy these days and that's a good thing. I'm using a build of the patched source in our private maven repo for now, so whenever you get to it is fine.

Regards,
Paul

--
You received this message because you are subscribed to a topic in the Google Groups "JetS3t Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jets3t-users/HR9Zi4tUcvQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jets3t-users...@googlegroups.com.

To post to this group, send email to jets3t...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "JetS3t Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jets3t-users...@googlegroups.com.
To post to this group, send email to jets3t...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "JetS3t Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jets3t-users/HR9Zi4tUcvQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jets3t-users...@googlegroups.com.

To post to this group, send email to jets3t...@googlegroups.com.

Mondain

unread,
Oct 24, 2018, 12:46:51 PM10/24/18
to jets3t...@googlegroups.com
Hello James,
It's been a couple years now since we last coordinated and I'd like to put the modified source in a public github repo, so that I can provide maintenance. Do you have any issue with this course? Full creator attribution etc will remain as well as any links back to your repo.

Best Regards,
Paul

James Murty

unread,
Oct 25, 2018, 5:06:47 AM10/25/18
to jets3t...@googlegroups.com
Hi Paul,

It’s fine by me for you to put JetS3t code on GitHub with your improvements. 

When you say you will provide maintenance, do you mean just for your changes or for the project as a whole? 

I am not able to spend time on it any more so if you are willing and/or planning to take over ownership of the project I would be completely in favour. It’s basically moribund as is. 

Let me know what you are thinking and I’ll try to help out as best I can if needed. 

Cheers,
James

Mondain

unread,
Oct 25, 2018, 6:33:17 PM10/25/18
to jets3t...@googlegroups.com
Yes, I'm cool with taking the helm as I have to make adjustments for my corporate work and I want those fixes to be available to the opensource public.

Best Regards,
Paul

David Kocher

unread,
Oct 25, 2018, 6:33:17 PM10/25/18
to jets3t...@googlegroups.com
We are also maintaining a fork of Jets3t at https://github.com/iterate-ch/jets3t

– David

> On 25 Oct 2018, at 11:06, James Murty <ja...@murty.co> wrote:
>
> Hi Paul,
>

Mondain

unread,
Nov 5, 2018, 5:21:45 PM11/5/18
to jets3t...@googlegroups.com
James, 
I put up a repo here https://github.com/mondain/jets3t and started the Maven work; if you see anything not to your liking, let me know. I have not added my CORS patch yet.

Regards,
Paul

James Murty

unread,
Nov 17, 2018, 7:49:28 AM11/17/18
to jets3t...@googlegroups.com
Hi Paul,

I have applied the TXT record to jets3t.org in what I hope is the correct format. See for example https://mxtoolbox.com/SuperTool.aspx?action=txt%3ajets3t.org&run=toolpage#
Like every time I have dealt with Sonatype, it's unclear exactly what I am supposed to do and I can't find any useful documentation. I guess the next step is to ask them to confirm the TXT record and see if your request proceeds.

I also posted a notification about you taking on the maintainer role to the JetS3t Users mailing list, to help kick of this transition more formally and to hopefully get you some contributors to help out – https://groups.google.com/forum/#!topic/jets3t-users/GoErNkCYiyE

Regards,
James


Reply all
Reply to author
Forward
0 new messages