forked from decidim/decidim
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: password for zip of personal data
- Loading branch information
1 parent
41607b5
commit 68ad43e
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ def export | |
dirname = File.dirname(@path) | ||
FileUtils.mkdir_p(dirname) unless File.directory?(dirname) | ||
File.open(@path, "wb") do |file| | ||
SevenZipRuby::Writer.open(file, password: @password) do |szw| | ||
SevenZipRuby::Writer.open(file) do |szw| | ||
szw.header_encryption = true | ||
szw.add_data(data, ZIP_FILE_NAME) | ||
end | ||
|
@@ -42,7 +42,8 @@ def export | |
private | ||
|
||
def data | ||
buffer = Zip::OutputStream.write_buffer do |out| | ||
enc = Zip::TraditionalEncrypter.new(@password) | ||
Check failure Code scanning / check-spelling Unrecognized Spelling Error
Encrypter is not a recognized word. (unrecognized-spelling)
|
||
buffer = Zip::OutputStream.write_buffer(::StringIO.new(""), enc) do |out| | ||
user_data, attachments = data_for(@user, @export_format) | ||
|
||
add_user_data_to_zip_stream(out, user_data) | ||
|