Commits

Anonymous committed d22b322

[svn r34] Updated secureS3

  • Participants
  • Parent commits 52ab43b
  • Branches trunk

Comments (0)

Files changed (1)

File aws/secures3.py

 
         return '%s://%s.s3.amazonaws.com/%s?%s' % (
                         scheme, bucket, filename, urllib.urlencode(params))
+    
+    def get_easy_auth_link(self, url, expires=600):
+        ''' url should be the full URL to the secure file hosted on S3.
+            examples:
+            http://s3.amazonaws.com/your-bucket/yourfile.zip
+            http://your-bucket.s3.amazonaws.com/yourfile.zip
+            http://media.your-domain.com/yourfile.zip  (CNAME path to S3)
+        '''
+        try:
+            data = self.get_file_details(url)
+        except ValueError:
+            return None
+
+        return self.get_auth_link(*data[:2], scheme=data[2], expires=expires)