can't S3 versioning through REST

Bug #751309 reported by Dick Tang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Eucalyptus
New
Undecided
Neil Soman

Bug Description

while I can access successfully
 by s3curl http://192.168.0.37:8773/services/Walrus/dick-personal-bucket?acl
I can't show versioning status by
s3curl http://192.168.0.37:8773/services/Walrus/dick-personal-bucket?versioning
and it returns:
javax.security.auth.login.LoginException: Login Failure: all modules ignored

I've taken a look on the
clc/modules/wsstack/src/main/java/com/eucalyptus/ws/handlers/WalrusAuthenticationHandler.java line ~182
for(WalrusProperties.SubResource subResource : WalrusProperties.SubResource.values()) {
                                                if(subResourceCandidate.equals(subResource.toString().toLowerCase())) {
and accroding to
clc/modules/core/src/main/java/com/eucalyptus/util/WalrusProperties.java
WalrusProperties.SubResource is defined as enum { acl, logging, torrent, location }

I tried to replace part of WalrusProperties.java with
        public enum SubResource {
                acl, logging, torrent, location, versioning, versions
        }

and everything seems ok now

Revision history for this message
Dick Tang (dictcp) wrote :

suggested fix:
clc/modules/wsstack/src/main/java/com/eucalyptus/ws/handlers/WalrusAuthenticationHandler.java line 182

                        if(addrStrings.length > 1) {
                                addrString += "?";
                                String[] subResourcesCandidates = addrStrings[1].split("&");
                                for(String subResourceCandidate : subResourcesCandidates) {
                                        String subResourceCandidateHead = subResourceCandidate.split("=")[0];
                                        for(WalrusProperties.SubResource subResource : WalrusProperties.SubResource.values()) {
                                                if(subResourceCandidateHead.equals(subResource.toString())) {
                                                        if(!addrString.substring(addrString.length()-1).equals("?")) addrString += "&";
                                                        addrString += subResourceCandidate;
                                                }
                                        }
                                }
                        }

clc/modules/core/src/main/java/com/eucalyptus/util/WalrusProperties.java: line 245
        public enum SubResource {
                acl, logging, torrent, location, versionId, versioning, versions
        }

Revision history for this message
Dick Tang (dictcp) wrote :

ref:
http://docs.amazonwebservices.com/AmazonS3/latest/dev/RESTAuthentication.html#ConstructingTheCanonicalizedResourceElement

* lexicographically sorted
* list of sub-resources: acl, location, logging, notification, partNumber, policy, requestPayment, torrent, uploadId, uploads, versionId, versioning, versions and website
* NO NEED to convert to lowercase for sub-resource

Revision history for this message
Dick Tang (dictcp) wrote :

changed a little bit to avoid problems

                        if(addrStrings.length > 1) {
                                String[] subResourcesCandidates = addrStrings[1].split("&");
                                for(String subResourceCandidate : subResourcesCandidates) {
                                        String subResourceCandidateHead = subResourceCandidate.split("=")[0];
                                        for(WalrusProperties.SubResource subResource : WalrusProperties.SubResource.values()) {
                                                if(subResourceCandidateHead.equals(subResource.toString())) {
                                                        if(addrString.equals(addrStrings[0])) addrString += "?";
                                                        else addrString += "&";
                                                        //if(!addrString.substring(addrString.length()-1).equals("?")) addrString += "&";
                                                        addrString += subResourceCandidate;
                                                }
                                        }
                                }
                        }

Daniel Nurmi (nurmi)
Changed in eucalyptus:
assignee: nobody → Neil Soman (neilsoman)
Revision history for this message
Andy Grimm (agrimm) wrote :

This issue is now being tracked upstream at http://eucalyptus.atlassian.net/browse/EUCA-2763

Please watch that issue for further updates.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.