Merge lp:~fredrik-loch/duplicity/duplicity-S3-SSE into lp:duplicity/0.6

Proposed by senjindarashiva
Status: Merged
Merged at revision: 968
Proposed branch: lp:~fredrik-loch/duplicity/duplicity-S3-SSE
Merge into: lp:duplicity/0.6
Diff against target: 64 lines (+16/-2)
4 files modified
duplicity/backends/_boto_multi.py (+1/-1)
duplicity/backends/_boto_single.py (+9/-1)
duplicity/commandline.py (+3/-0)
duplicity/globals.py (+3/-0)
To merge this branch: bzr merge lp:~fredrik-loch/duplicity/duplicity-S3-SSE
Reviewer Review Type Date Requested Status
duplicity-team Pending
Review via email: mp+214949@code.launchpad.net

Description of the change

Adds support for server side encryption as requested in Bug #996660

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'duplicity/backends/_boto_multi.py'
--- duplicity/backends/_boto_multi.py 2014-02-26 19:48:56 +0000
+++ duplicity/backends/_boto_multi.py 2014-04-09 13:40:03 +0000
@@ -125,7 +125,7 @@
125125
126 log.Debug("Uploading %d bytes in %d chunks" % (bytes, chunks))126 log.Debug("Uploading %d bytes in %d chunks" % (bytes, chunks))
127127
128 mp = self.bucket.initiate_multipart_upload(key.key, headers)128 mp = self.bucket.initiate_multipart_upload(key.key, headers,encrypt_key=globals.s3_use_sse)
129129
130 # Initiate a queue to share progress data between the pool130 # Initiate a queue to share progress data between the pool
131 # workers and a consumer thread, that will collect and report131 # workers and a consumer thread, that will collect and report
132132
=== modified file 'duplicity/backends/_boto_single.py'
--- duplicity/backends/_boto_single.py 2014-03-06 14:21:34 +0000
+++ duplicity/backends/_boto_single.py 2014-04-09 13:40:03 +0000
@@ -232,10 +232,18 @@
232 storage_class = 'STANDARD'232 storage_class = 'STANDARD'
233 log.Info("Uploading %s/%s to %s Storage" % (self.straight_url, remote_filename, storage_class))233 log.Info("Uploading %s/%s to %s Storage" % (self.straight_url, remote_filename, storage_class))
234 try:234 try:
235 headers = {235 if globals.s3_use_sse:
236 headers = {
237 'Content-Type': 'application/octet-stream',
238 'x-amz-storage-class': storage_class,
239 'x-amz-server-side-encryption': 'AES256'
240 }
241 else:
242 headers = {
236 'Content-Type': 'application/octet-stream',243 'Content-Type': 'application/octet-stream',
237 'x-amz-storage-class': storage_class244 'x-amz-storage-class': storage_class
238 }245 }
246
239 upload_start = time.time()247 upload_start = time.time()
240 self.upload(source_path.name, key, headers)248 self.upload(source_path.name, key, headers)
241 upload_end = time.time()249 upload_end = time.time()
242250
=== modified file 'duplicity/commandline.py'
--- duplicity/commandline.py 2014-03-09 20:37:24 +0000
+++ duplicity/commandline.py 2014-04-09 13:40:03 +0000
@@ -511,6 +511,9 @@
511 if sys.version_info[:2] >= (2, 6):511 if sys.version_info[:2] >= (2, 6):
512 parser.add_option("--s3-use-multiprocessing", action = "store_true")512 parser.add_option("--s3-use-multiprocessing", action = "store_true")
513513
514 # Option to allow use of server side encryption in s3
515 parser.add_option("--s3-use-server-side-encryption", action="store_true", dest="s3_use_sse")
516
514 # scp command to use (ssh pexpect backend)517 # scp command to use (ssh pexpect backend)
515 parser.add_option("--scp-command", metavar = _("command"))518 parser.add_option("--scp-command", metavar = _("command"))
516519
517520
=== modified file 'duplicity/globals.py'
--- duplicity/globals.py 2014-03-09 20:37:24 +0000
+++ duplicity/globals.py 2014-04-09 13:40:03 +0000
@@ -206,6 +206,9 @@
206# Maximum time to wait for a part to finish when doig a multipart upload to S3206# Maximum time to wait for a part to finish when doig a multipart upload to S3
207s3_multipart_max_timeout = None207s3_multipart_max_timeout = None
208208
209# Use server side encryption in s3
210s3_use_sse = False
211
209# Whether to use the full email address as the user name when212# Whether to use the full email address as the user name when
210# logging into an imap server. If false just the user name213# logging into an imap server. If false just the user name
211# part of the email address is used.214# part of the email address is used.

Subscribers

People subscribed via source and target branches