ndr_pseudonymise 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/ndr_pseudonymise/ndr_encrypt/repository.rb +11 -3
- data/lib/ndr_pseudonymise/version.rb +1 -1
- data/ndr_pseudonymise.gemspec +4 -2
- data/script/ndr_encrypt/README.md +17 -0
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de8ff4d87384ab58d1e16263095f619dc03269d4342829fd47cfc2dff98d539d
|
4
|
+
data.tar.gz: 4186c0f859293592e4f78d3acbd000a3caad604c3e0129979f02aba3a036b55c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ccfc71d5b259a5694bd96fb06e4014977e5d1287ff8f816bf46f59b12b40c83e1f31a327c4c37e8434d477df34c9b4f9391c769e294739ee6bc6d197ee503c3
|
7
|
+
data.tar.gz: f3b2aab13ee7ab67bb398d0c5c5966452afa9e42aa809b787ad668c84d6af1ad78cc45bff27adb342f31651f4f88cd60101341ce2275c2afe7ab39131835423a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'csv'
|
2
2
|
require 'fileutils'
|
3
|
+
require 'find'
|
3
4
|
require 'set'
|
4
5
|
require 'stringio'
|
5
6
|
|
@@ -35,9 +36,16 @@ module NdrPseudonymise
|
|
35
36
|
raise(ArgumentError, 'Invalid ndr_encrypted encrypted store') unless valid_repository?
|
36
37
|
|
37
38
|
paths.each do |path|
|
38
|
-
|
39
|
-
|
40
|
-
|
39
|
+
Find.find(path) do |fn|
|
40
|
+
next unless File.file?(fn)
|
41
|
+
|
42
|
+
real_encrypted_dir = File.realdirpath(File.join(@repo_dir, ENCRYPTED_DIR))
|
43
|
+
next if File.realdirpath(fn).start_with?(real_encrypted_dir)
|
44
|
+
|
45
|
+
git_blobid, _encrypted_id = hash_object(fn, key_name: key_name,
|
46
|
+
pub_key: pub_key, write: true)
|
47
|
+
File.open(index_filename, 'ab') { |f| f << [git_blobid, fn].to_csv }
|
48
|
+
end
|
41
49
|
end
|
42
50
|
end
|
43
51
|
|
data/ndr_pseudonymise.gemspec
CHANGED
@@ -27,10 +27,12 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.add_development_dependency 'bundler'
|
28
28
|
spec.add_development_dependency 'minitest', '>= 5.0'
|
29
29
|
spec.add_development_dependency 'mocha'
|
30
|
-
spec.add_development_dependency 'ndr_dev_support', '>=
|
30
|
+
spec.add_development_dependency 'ndr_dev_support', '>= 1.1'
|
31
31
|
spec.add_development_dependency 'ndr_import'
|
32
32
|
spec.add_development_dependency 'pry'
|
33
33
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
34
34
|
|
35
|
-
|
35
|
+
# Ruby 2.6.0 or later expected for normal operation, and needed for testing,
|
36
|
+
# but we support 2.0.0 for the ndr_encrypt utility
|
37
|
+
spec.required_ruby_version = '>= 2.0.0'
|
36
38
|
end
|
@@ -4,6 +4,21 @@
|
|
4
4
|
retrieved safely. The files still need to be hosted securely, but public /
|
5
5
|
private key encryption provides additional protection.
|
6
6
|
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'ndr_pseudonymise'
|
13
|
+
```
|
14
|
+
|
15
|
+
or for command line usage only, without installing any gems:
|
16
|
+
|
17
|
+
``` shell
|
18
|
+
$ git clone https://github.com/NHSDigital/ndr_pseudonymise.git
|
19
|
+
$ ndr_pseudonymise/script/ndr_encrypt/ndr_encrypt --help
|
20
|
+
```
|
21
|
+
|
7
22
|
## Overview
|
8
23
|
|
9
24
|
We define a simple suite of tools, `ndr_encrypt`, to generate the encrypted
|
@@ -81,6 +96,8 @@ BASE64
|
|
81
96
|
|
82
97
|
# Add the object to the repository
|
83
98
|
ndr_encrypt add --key_name=ourkey1 --pub_key=ourkey1.pub test/dir/ok.gif
|
99
|
+
# or add the directory contents recursively
|
100
|
+
# ndr_encrypt add --key_name=ourkey1 --pub_key=ourkey1.pub test
|
84
101
|
|
85
102
|
# Move aside the original file, to test recovery
|
86
103
|
mv test/dir/ok.gif{,.orig}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ndr_pseudonymise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NCRS development team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '1.1'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '1.1'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: ndr_import
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -183,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
183
183
|
requirements:
|
184
184
|
- - ">="
|
185
185
|
- !ruby/object:Gem::Version
|
186
|
-
version: 2.
|
186
|
+
version: 2.0.0
|
187
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
188
188
|
requirements:
|
189
189
|
- - ">="
|