jcaddel/maven-s3-wagon — pull request #5 by jklinger (2012-09-13 00:05:03+00:00)
Title: Authentication bugfix

I had been using the Spring S3 wagon (org.springframework.build.aws.maven 3.0.0.RELEASE), but when I try to run the site goal on my projects, it fails complaining about conflicting versions of commons logging. So I switched to your wagon, which simply didn't work (i.e. it didn't fail my build, but it didn't actually connect to S3 either). It kept telling my that the connection was refused with a 403 from AWS.
After much debugging, I found the problem in the call to list all the buckets. I think this was failing for me because we've set up our security so that our maven user only has access to our maven repo bucket, but we did it in some (apparently) unusual way using a bucket policy. Without getting too far into the details that I frankly don't understand, my theory is that the account I'm connecting with thinks it has several buckets, although it is in fact forbidden from accessing all but one of them. Thus, listing buckets fails.
I looked through the code and could not find any place that actually needed a Bucket instance, and was only using its bucket object to call getName(). I have changed the code to operate on a bucketName directly instead of bucket.getName(). All the tests pass, including the new one I wrote, and the code works for me; however, I did I removed a protected method and I'm not sure if there's some other dependency on it in some other project.

Please let me know if you have any questions; I will be happy to explain more about what I did.

- Justin