Skip to content
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

S3 class becoming a Trait. #79

Closed
marleyiam opened this issue Mar 3, 2014 · 1 comment
Closed

S3 class becoming a Trait. #79

marleyiam opened this issue Mar 3, 2014 · 1 comment

Comments

@marleyiam
Copy link

Hi there!
S3 class is just amazing but I'm really interested in setting it into "dryer" and more straightforward approach by transforming it in a Trait.
Anyone did that already?
I'm trying for now and I got some pitfalls such as "non constructor" and "non constant attributes" nature of Traits.
At first shoot I could get some basic stuff such as listing buckets, but for now I'm not able to create neither upload to it.
By looking the following error message we can figure it out some clues:

S3::putBucket(locals-bucket, public-read, ): [AccessDenied] Anonymous access is forbidden for this operation in...

It seems that there's no defined valid S3 credentials!
Once there's no construct function in Traits, I just setted both key and secret in a regular function, but it does not seem to work ;(

Well...that's it, any ideas will be highly appreciated. Cheers!

@marleyiam
Copy link
Author

Just got it! Since a long time actually...nothing to die for but works properly.
All that I did consists in create a kinda "wrapper" helper class which provides access to main methods such as "auth", "putObject" and "listBuckets". Later I create a Trait which wrapps a intance of my brand new S3Helper class. Finally I can use it into any regular class to access S3 API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant