masking 1.1.0 → 1.1.2.pre.alpha
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +9 -4
- data/.github/workflows/acceptance_test_mariadb.yml +57 -1
- data/.github/workflows/acceptance_test_mysql.yml +1 -1
- data/.rubocop.yml +7 -1
- data/.rubocop_todo.yml +105 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +19 -0
- data/CODEOWNERS +1 -0
- data/Dockerfile +5 -3
- data/Dockerfile.ghcr +10 -0
- data/Gemfile +20 -0
- data/Gemfile.lock +67 -51
- data/README.md +38 -26
- data/acceptance/expected_error_result.txt +2 -0
- data/acceptance/expected_query_result.txt +36 -30
- data/acceptance/import_dumpfile.sql +3 -1
- data/acceptance/masking.yml +2 -0
- data/acceptance/run_test.sh +18 -6
- data/docker-compose/mariadb1010.yml +17 -0
- data/docker-compose/mariadb1011.yml +17 -0
- data/docker-compose/mariadb105.yml +17 -0
- data/docker-compose/mariadb106.yml +17 -0
- data/docker-compose/mariadb107.yml +17 -0
- data/docker-compose/mariadb108.yml +17 -0
- data/docker-compose/mariadb109.yml +17 -0
- data/lib/masking/cli/error_message.rb +16 -9
- data/lib/masking/config/target_columns/column.rb +19 -5
- data/lib/masking/config/target_columns/method/string_binary_distinctor.rb +3 -3
- data/lib/masking/config/target_columns/method/type/base.rb +25 -0
- data/lib/masking/config/target_columns/method/type/binary.rb +19 -0
- data/lib/masking/config/target_columns/method/type/boolean.rb +27 -0
- data/lib/masking/config/target_columns/method/type/date.rb +28 -0
- data/lib/masking/config/target_columns/method/type/extension/ignore_null.rb +24 -0
- data/lib/masking/config/target_columns/method/type/float.rb +19 -0
- data/lib/masking/config/target_columns/method/type/integer.rb +19 -0
- data/lib/masking/config/target_columns/method/{null.rb → type/null.rb} +5 -5
- data/lib/masking/config/target_columns/method/type/string.rb +37 -0
- data/lib/masking/config/target_columns/method/type/time.rb +26 -0
- data/lib/masking/config/target_columns/method.rb +14 -10
- data/lib/masking/insert_statement/sql_builder.rb +2 -2
- data/lib/masking/insert_statement.rb +1 -1
- data/lib/masking/sql_dump_line.rb +1 -0
- data/lib/masking/version.rb +1 -1
- data/masking.gemspec +1 -18
- metadata +29 -184
- data/lib/masking/cli/error_messages.yml +0 -10
- data/lib/masking/config/target_columns/method/binary.rb +0 -23
- data/lib/masking/config/target_columns/method/boolean.rb +0 -29
- data/lib/masking/config/target_columns/method/date.rb +0 -30
- data/lib/masking/config/target_columns/method/float.rb +0 -23
- data/lib/masking/config/target_columns/method/integer.rb +0 -23
- data/lib/masking/config/target_columns/method/string.rb +0 -33
- data/lib/masking/config/target_columns/method/time.rb +0 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fff3fddd7077702babd4aeffafe86e80f79ab5151fb40ba92bba3ebf86513e3
|
4
|
+
data.tar.gz: f9f7d5ed2dbd5c1ebb6789d154c6c6fe64b72d4528ee923a6c4d0b8575e869ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 909c267ad406fc1bded87cb368cd5b130612270e2a41046c129cc529f9dd3fbb29b1d799a71613e404333463c7af6f2a33f323b0e3a29af204aae0c48c96e54d
|
7
|
+
data.tar.gz: 618c7ff871b6ae32fc26095d0e409ffe67f1da6c4759a1a9ae45a93bc3336f1f775352a514d095955882c33bb874133df3d258af9c3040a4f6ed0d7bbf354789
|
data/.circleci/config.yml
CHANGED
@@ -14,10 +14,14 @@ test_attributes: &test_attributes
|
|
14
14
|
name: output Ruby version (debug)
|
15
15
|
command: docker run --entrypoint sh masking-$RUBY_VERSION-$CIRCLE_SHA1 -c "ruby -v" # debug
|
16
16
|
- run:
|
17
|
-
name: run test
|
18
|
-
command: docker run --entrypoint sh -e CI -e CODECOV_TOKEN masking-$RUBY_VERSION-$CIRCLE_SHA1 -c "bundle exec
|
17
|
+
name: run test & rubocop & notes
|
18
|
+
command: docker run --entrypoint sh -e CI -e CODECOV_TOKEN masking-$RUBY_VERSION-$CIRCLE_SHA1 -c "bundle exec rake"
|
19
19
|
|
20
20
|
jobs:
|
21
|
+
test-ruby32:
|
22
|
+
<<: *test_attributes
|
23
|
+
environment:
|
24
|
+
RUBY_VERSION: '3.2'
|
21
25
|
test-ruby31:
|
22
26
|
<<: *test_attributes
|
23
27
|
environment:
|
@@ -38,7 +42,8 @@ jobs:
|
|
38
42
|
workflows:
|
39
43
|
'CircleCI: build':
|
40
44
|
jobs:
|
45
|
+
- test-ruby32
|
46
|
+
- test-ruby31
|
47
|
+
- test-ruby30
|
41
48
|
- test-ruby26
|
42
49
|
- test-ruby27
|
43
|
-
- test-ruby30
|
44
|
-
- test-ruby31
|
@@ -2,10 +2,66 @@ name: Acceptance Test MariaDB
|
|
2
2
|
on:
|
3
3
|
push:
|
4
4
|
branches:
|
5
|
-
-
|
5
|
+
- main
|
6
6
|
pull_request:
|
7
7
|
|
8
8
|
jobs:
|
9
|
+
mariadb1011:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- uses: actions/checkout@v1
|
13
|
+
with:
|
14
|
+
fetch-depth: 1 # shallow clone
|
15
|
+
- name: run test
|
16
|
+
run: docker-compose/acceptance_test.sh mariadb1011 docker-compose-ci.yml
|
17
|
+
mariadb1010:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v1
|
21
|
+
with:
|
22
|
+
fetch-depth: 1 # shallow clone
|
23
|
+
- name: run test
|
24
|
+
run: docker-compose/acceptance_test.sh mariadb1010 docker-compose-ci.yml
|
25
|
+
mariadb109:
|
26
|
+
runs-on: ubuntu-latest
|
27
|
+
steps:
|
28
|
+
- uses: actions/checkout@v1
|
29
|
+
with:
|
30
|
+
fetch-depth: 1 # shallow clone
|
31
|
+
- name: run test
|
32
|
+
run: docker-compose/acceptance_test.sh mariadb109 docker-compose-ci.yml
|
33
|
+
mariadb108:
|
34
|
+
runs-on: ubuntu-latest
|
35
|
+
steps:
|
36
|
+
- uses: actions/checkout@v1
|
37
|
+
with:
|
38
|
+
fetch-depth: 1 # shallow clone
|
39
|
+
- name: run test
|
40
|
+
run: docker-compose/acceptance_test.sh mariadb108 docker-compose-ci.yml
|
41
|
+
mariadb107:
|
42
|
+
runs-on: ubuntu-latest
|
43
|
+
steps:
|
44
|
+
- uses: actions/checkout@v1
|
45
|
+
with:
|
46
|
+
fetch-depth: 1 # shallow clone
|
47
|
+
- name: run test
|
48
|
+
run: docker-compose/acceptance_test.sh mariadb107 docker-compose-ci.yml
|
49
|
+
mariadb106:
|
50
|
+
runs-on: ubuntu-latest
|
51
|
+
steps:
|
52
|
+
- uses: actions/checkout@v1
|
53
|
+
with:
|
54
|
+
fetch-depth: 1 # shallow clone
|
55
|
+
- name: run test
|
56
|
+
run: docker-compose/acceptance_test.sh mariadb106 docker-compose-ci.yml
|
57
|
+
mariadb105:
|
58
|
+
runs-on: ubuntu-latest
|
59
|
+
steps:
|
60
|
+
- uses: actions/checkout@v1
|
61
|
+
with:
|
62
|
+
fetch-depth: 1 # shallow clone
|
63
|
+
- name: run test
|
64
|
+
run: docker-compose/acceptance_test.sh mariadb105 docker-compose-ci.yml
|
9
65
|
mariadb104:
|
10
66
|
runs-on: ubuntu-latest
|
11
67
|
steps:
|
data/.rubocop.yml
CHANGED
@@ -1,11 +1,17 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
require:
|
4
|
+
- rubocop-rspec
|
5
|
+
|
1
6
|
AllCops:
|
7
|
+
NewCops: enable
|
2
8
|
Exclude:
|
3
9
|
- 'vendor/**/*'
|
4
10
|
- 'spec/fixtures/**/*'
|
5
11
|
- 'tmp/**/*'
|
6
12
|
TargetRubyVersion: 2.6
|
7
13
|
|
8
|
-
|
14
|
+
Layout/LineLength:
|
9
15
|
Max: 120
|
10
16
|
|
11
17
|
Metrics/BlockLength:
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2023-02-26 19:42:34 UTC using RuboCop version 1.46.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 1
|
10
|
+
RSpec/AnyInstance:
|
11
|
+
Exclude:
|
12
|
+
- 'spec/masking/config_spec.rb'
|
13
|
+
|
14
|
+
# Offense count: 39
|
15
|
+
# Configuration parameters: Prefixes, AllowedPatterns.
|
16
|
+
# Prefixes: when, with, without
|
17
|
+
RSpec/ContextWording:
|
18
|
+
Exclude:
|
19
|
+
- 'spec/integration/commandline_spec.rb'
|
20
|
+
- 'spec/masking/cli_spec.rb'
|
21
|
+
- 'spec/masking/config/target_columns/column_spec.rb'
|
22
|
+
- 'spec/masking/config/target_columns/method/binary_spec.rb'
|
23
|
+
- 'spec/masking/config/target_columns/method/string_binary_distinctor_spec.rb'
|
24
|
+
- 'spec/masking/config/target_columns/method_spec.rb'
|
25
|
+
- 'spec/masking/config/target_columns_spec.rb'
|
26
|
+
- 'spec/masking/config_spec.rb'
|
27
|
+
- 'spec/masking/data_mask_processor/cache_spec.rb'
|
28
|
+
- 'spec/masking/insert_statement_spec.rb'
|
29
|
+
- 'spec/masking/sql_dump_line_spec.rb'
|
30
|
+
|
31
|
+
# Offense count: 1
|
32
|
+
# Configuration parameters: IgnoredMetadata.
|
33
|
+
RSpec/DescribeClass:
|
34
|
+
Exclude:
|
35
|
+
- '**/spec/features/**/*'
|
36
|
+
- '**/spec/requests/**/*'
|
37
|
+
- '**/spec/routing/**/*'
|
38
|
+
- '**/spec/system/**/*'
|
39
|
+
- '**/spec/views/**/*'
|
40
|
+
- 'spec/integration/commandline_spec.rb'
|
41
|
+
|
42
|
+
# Offense count: 6
|
43
|
+
# Configuration parameters: CountAsOne.
|
44
|
+
RSpec/ExampleLength:
|
45
|
+
Max: 7
|
46
|
+
|
47
|
+
# Offense count: 1
|
48
|
+
RSpec/ExpectInHook:
|
49
|
+
Exclude:
|
50
|
+
- 'spec/masking/insert_statement_spec.rb'
|
51
|
+
|
52
|
+
# Offense count: 4
|
53
|
+
RSpec/ExpectOutput:
|
54
|
+
Exclude:
|
55
|
+
- 'spec/masking/cli_spec.rb'
|
56
|
+
|
57
|
+
# Offense count: 1
|
58
|
+
RSpec/MessageChain:
|
59
|
+
Exclude:
|
60
|
+
- 'spec/masking_spec.rb'
|
61
|
+
|
62
|
+
# Offense count: 16
|
63
|
+
# Configuration parameters: .
|
64
|
+
# SupportedStyles: have_received, receive
|
65
|
+
RSpec/MessageSpies:
|
66
|
+
EnforcedStyle: receive
|
67
|
+
|
68
|
+
# Offense count: 5
|
69
|
+
RSpec/MultipleExpectations:
|
70
|
+
Max: 3
|
71
|
+
|
72
|
+
# Offense count: 44
|
73
|
+
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
|
74
|
+
# SupportedStyles: always, named_only
|
75
|
+
RSpec/NamedSubject:
|
76
|
+
Exclude:
|
77
|
+
- 'spec/masking/cli/error_message_spec.rb'
|
78
|
+
- 'spec/masking/config/target_columns/column_spec.rb'
|
79
|
+
- 'spec/masking/config/target_columns/method/binary_spec.rb'
|
80
|
+
- 'spec/masking/config/target_columns/method/string_spec.rb'
|
81
|
+
- 'spec/masking/config/target_columns/method_spec.rb'
|
82
|
+
- 'spec/masking/config/target_columns/table_spec.rb'
|
83
|
+
- 'spec/masking/config/target_columns_spec.rb'
|
84
|
+
- 'spec/masking/config_spec.rb'
|
85
|
+
- 'spec/masking/insert_statement/sql_builder_spec.rb'
|
86
|
+
- 'spec/masking/insert_statement_spec.rb'
|
87
|
+
- 'spec/masking_spec.rb'
|
88
|
+
|
89
|
+
# Offense count: 19
|
90
|
+
# Configuration parameters: AllowedGroups.
|
91
|
+
RSpec/NestedGroups:
|
92
|
+
Max: 5
|
93
|
+
|
94
|
+
# Offense count: 4
|
95
|
+
RSpec/RepeatedExampleGroupDescription:
|
96
|
+
Exclude:
|
97
|
+
- 'spec/integration/commandline_spec.rb'
|
98
|
+
- 'spec/masking/cli_spec.rb'
|
99
|
+
|
100
|
+
# Offense count: 3
|
101
|
+
RSpec/StubbedMock:
|
102
|
+
Exclude:
|
103
|
+
- 'spec/masking/cli_spec.rb'
|
104
|
+
- 'spec/masking/config/target_columns/method_spec.rb'
|
105
|
+
- 'spec/masking/sql_dump_line_spec.rb'
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.1
|
1
|
+
3.2.1
|
data/CHANGELOG.md
CHANGED
@@ -7,12 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- adding dockerfile for github container images [#77](https://github.com/kibitan/masking/pull/77)
|
13
|
+
- Update README.md about frequent asked question [#74](https://github.com/kibitan/masking/pull/74)
|
14
|
+
|
15
|
+
### Fix
|
16
|
+
|
17
|
+
- fix the error on the error message [#74](https://github.com/kibitan/masking/pull/74) relates issue [#73](https://github.com/kibitan/masking/issues/73)
|
18
|
+
|
19
|
+
## [v1.1.1] - 2023-04-03
|
20
|
+
|
21
|
+
### Added
|
22
|
+
|
23
|
+
- add ignore NULL option [#66](https://github.com/kibitan/masking/pull/66) requested feature by [#59](https://github.com/kibitan/masking/pull/59) from @spyro2000
|
24
|
+
- add MariaDB 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11 support [#65](https://github.com/kibitan/masking/pull/65)
|
25
|
+
- add Ruby 3.2 support [#64](https://github.com/kibitan/masking/pull/64)
|
26
|
+
- update development libraries [#61](https://github.com/kibitan/masking/pull/61)
|
27
|
+
|
10
28
|
## [v1.1.0] - 2023-02-25 Happy #ruby30th Birthday🎉
|
11
29
|
|
12
30
|
### Added
|
13
31
|
|
14
32
|
- add Ruby 3.0 support [#55](https://github.com/kibitan/masking/pull/55)
|
15
33
|
- add Ruby 3.1 support [#60](https://github.com/kibitan/masking/pull/60)
|
34
|
+
- drop Ruby 2.5 support [#60](https://github.com/kibitan/masking/pull/60)
|
16
35
|
|
17
36
|
### Security
|
18
37
|
|
data/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @kibitan
|
data/Dockerfile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
ARG
|
1
|
+
ARG RUBY_VERSION=3.2
|
2
2
|
|
3
|
-
FROM ruby:$
|
3
|
+
FROM ruby:${RUBY_VERSION}-alpine AS builder
|
4
4
|
RUN apk add --no-cache build-base git
|
5
5
|
RUN addgroup -S app && adduser -S -G app app
|
6
6
|
USER app
|
@@ -13,7 +13,7 @@ USER root
|
|
13
13
|
RUN apk add --no-cache mysql-client
|
14
14
|
USER app
|
15
15
|
|
16
|
-
FROM ruby:$
|
16
|
+
FROM ruby:${RUBY_VERSION}-alpine
|
17
17
|
# TODO: remove dependecy of `git` from masking.gemspec:L19
|
18
18
|
RUN apk add --no-cache git
|
19
19
|
RUN addgroup -S app && adduser -S -G app app
|
@@ -23,4 +23,6 @@ RUN chown app /app
|
|
23
23
|
USER app
|
24
24
|
COPY --from=builder /usr/local/bundle/ /usr/local/bundle/
|
25
25
|
COPY --chown=app . ./
|
26
|
+
# workaround: at some reason, ruby-prof is not recognized in Ruby 2.6 image https://app.circleci.com/pipelines/github/kibitan/masking/197/workflows/8cbdb843-a42f-413a-ab2f-9c5f74397d43/jobs/512
|
27
|
+
RUN bundle
|
26
28
|
ENTRYPOINT ["bundle", "exec", "exe/masking"]
|
data/Dockerfile.ghcr
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# `docker run ghcr.io/kibitan/masking`
|
2
|
+
ARG RUBY_VERSION=3.2
|
3
|
+
|
4
|
+
FROM ruby:$RUBY_VERSION-alpine
|
5
|
+
RUN addgroup -S app && adduser -S -G app app
|
6
|
+
USER app
|
7
|
+
WORKDIR /app
|
8
|
+
ARG MASKING_VERSION=1.1.1
|
9
|
+
RUN gem install masking -v "${MASKING_VERSION}"
|
10
|
+
ENTRYPOINT ["masking"]
|
data/Gemfile
CHANGED
@@ -4,5 +4,25 @@ source 'https://rubygems.org'
|
|
4
4
|
|
5
5
|
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
6
6
|
|
7
|
+
gem 'bundler'
|
8
|
+
gem 'rake'
|
9
|
+
gem 'rake-notes'
|
10
|
+
gem 'ruby-prof'
|
11
|
+
|
12
|
+
# linter/static analyzer
|
13
|
+
gem 'mdl'
|
14
|
+
gem 'rubocop'
|
15
|
+
gem 'rubocop-rspec'
|
16
|
+
|
17
|
+
# test
|
18
|
+
gem 'codecov'
|
19
|
+
gem 'rspec'
|
20
|
+
gem 'simplecov'
|
21
|
+
|
22
|
+
# debug
|
23
|
+
gem 'pry'
|
24
|
+
gem 'pry-byebug'
|
25
|
+
gem 'tapp'
|
26
|
+
|
7
27
|
# Specify your gem's dependencies in masking.gemspec
|
8
28
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,83 +1,98 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
masking (1.1.
|
4
|
+
masking (1.1.2.pre.alpha)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
ast (2.4.
|
10
|
-
byebug (11.
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
ast (2.4.2)
|
10
|
+
byebug (11.1.3)
|
11
|
+
chef-utils (18.1.0)
|
12
|
+
concurrent-ruby
|
13
|
+
codecov (0.6.0)
|
14
|
+
simplecov (>= 0.15, < 0.22)
|
15
|
+
coderay (1.1.3)
|
15
16
|
colored (1.2)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
json (2.3
|
20
|
-
kramdown (2.
|
17
|
+
concurrent-ruby (1.2.2)
|
18
|
+
diff-lcs (1.5.0)
|
19
|
+
docile (1.4.0)
|
20
|
+
json (2.6.3)
|
21
|
+
kramdown (2.4.0)
|
21
22
|
rexml
|
22
23
|
kramdown-parser-gfm (1.1.0)
|
23
24
|
kramdown (~> 2.0)
|
24
|
-
mdl (0.
|
25
|
-
kramdown (~> 2.
|
26
|
-
kramdown-parser-gfm (~> 1.
|
25
|
+
mdl (0.12.0)
|
26
|
+
kramdown (~> 2.3)
|
27
|
+
kramdown-parser-gfm (~> 1.1)
|
27
28
|
mixlib-cli (~> 2.1, >= 2.1.1)
|
28
29
|
mixlib-config (>= 2.2.1, < 4)
|
29
|
-
|
30
|
-
|
31
|
-
mixlib-
|
30
|
+
mixlib-shellout
|
31
|
+
method_source (1.0.0)
|
32
|
+
mixlib-cli (2.1.8)
|
33
|
+
mixlib-config (3.0.27)
|
32
34
|
tomlrb
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
mixlib-shellout (3.2.7)
|
36
|
+
chef-utils
|
37
|
+
parallel (1.22.1)
|
38
|
+
parser (3.2.1.0)
|
39
|
+
ast (~> 2.4.1)
|
40
|
+
pry (0.14.2)
|
41
|
+
coderay (~> 1.1)
|
42
|
+
method_source (~> 1.0)
|
43
|
+
pry-byebug (3.10.1)
|
40
44
|
byebug (~> 11.0)
|
41
|
-
pry (
|
42
|
-
rainbow (3.
|
43
|
-
rake (13.0.
|
45
|
+
pry (>= 0.13, < 0.15)
|
46
|
+
rainbow (3.1.1)
|
47
|
+
rake (13.0.6)
|
44
48
|
rake-notes (0.2.2)
|
45
49
|
colored
|
46
50
|
rake
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
rspec-
|
51
|
-
rspec-
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
regexp_parser (2.7.0)
|
52
|
+
rexml (3.2.5)
|
53
|
+
rspec (3.12.0)
|
54
|
+
rspec-core (~> 3.12.0)
|
55
|
+
rspec-expectations (~> 3.12.0)
|
56
|
+
rspec-mocks (~> 3.12.0)
|
57
|
+
rspec-core (3.12.1)
|
58
|
+
rspec-support (~> 3.12.0)
|
59
|
+
rspec-expectations (3.12.2)
|
55
60
|
diff-lcs (>= 1.2.0, < 2.0)
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-mocks (3.
|
61
|
+
rspec-support (~> 3.12.0)
|
62
|
+
rspec-mocks (3.12.3)
|
58
63
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-support (3.
|
61
|
-
rubocop (
|
62
|
-
|
64
|
+
rspec-support (~> 3.12.0)
|
65
|
+
rspec-support (3.12.0)
|
66
|
+
rubocop (1.46.0)
|
67
|
+
json (~> 2.3)
|
63
68
|
parallel (~> 1.10)
|
64
|
-
parser (>= 2.
|
69
|
+
parser (>= 3.2.0.0)
|
65
70
|
rainbow (>= 2.2.2, < 4.0)
|
71
|
+
regexp_parser (>= 1.8, < 3.0)
|
72
|
+
rexml (>= 3.2.5, < 4.0)
|
73
|
+
rubocop-ast (>= 1.26.0, < 2.0)
|
66
74
|
ruby-progressbar (~> 1.7)
|
67
|
-
unicode-display_width (>=
|
68
|
-
|
69
|
-
|
70
|
-
|
75
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
76
|
+
rubocop-ast (1.26.0)
|
77
|
+
parser (>= 3.2.1.0)
|
78
|
+
rubocop-capybara (2.17.1)
|
79
|
+
rubocop (~> 1.41)
|
80
|
+
rubocop-rspec (2.18.1)
|
81
|
+
rubocop (~> 1.33)
|
82
|
+
rubocop-capybara (~> 2.17)
|
83
|
+
ruby-prof (1.6.1)
|
84
|
+
ruby-progressbar (1.11.0)
|
85
|
+
simplecov (0.21.2)
|
71
86
|
docile (~> 1.1)
|
72
87
|
simplecov-html (~> 0.11)
|
73
88
|
simplecov_json_formatter (~> 0.1)
|
74
89
|
simplecov-html (0.12.3)
|
75
|
-
simplecov_json_formatter (0.1.
|
90
|
+
simplecov_json_formatter (0.1.4)
|
76
91
|
tapp (1.5.1)
|
77
92
|
thor
|
78
|
-
thor (1.
|
79
|
-
tomlrb (
|
80
|
-
unicode-display_width (
|
93
|
+
thor (1.2.1)
|
94
|
+
tomlrb (2.0.3)
|
95
|
+
unicode-display_width (2.4.2)
|
81
96
|
|
82
97
|
PLATFORMS
|
83
98
|
ruby
|
@@ -93,6 +108,7 @@ DEPENDENCIES
|
|
93
108
|
rake-notes
|
94
109
|
rspec
|
95
110
|
rubocop
|
111
|
+
rubocop-rspec
|
96
112
|
ruby-prof
|
97
113
|
simplecov
|
98
114
|
tapp
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# MasKING🤴
|
2
2
|
|
3
|
-
[![CircleCI](https://circleci.com/gh/kibitan/masking/tree/
|
4
|
-
[![Acceptance Test MySQL Status](https://github.com/kibitan/masking/workflows/Acceptance%20Test%20MySQL/badge.svg?branch=
|
5
|
-
[![Acceptance Test MariaDB Status](https://github.com/kibitan/masking/workflows/Acceptance%20Test%20MariaDB/badge.svg?branch=
|
3
|
+
[![CircleCI](https://circleci.com/gh/kibitan/masking/tree/main.svg?style=svg)](https://circleci.com/gh/kibitan/masking/tree/main)
|
4
|
+
[![Acceptance Test MySQL Status](https://github.com/kibitan/masking/workflows/Acceptance%20Test%20MySQL/badge.svg?branch=main)](https://github.com/kibitan/masking/actions?query=workflow%3A%22Acceptance+Test+MySQL%22+branch%3Amain)
|
5
|
+
[![Acceptance Test MariaDB Status](https://github.com/kibitan/masking/workflows/Acceptance%20Test%20MariaDB/badge.svg?branch=main)](https://github.com/kibitan/masking/actions?query=workflow%3A%22Acceptance+Test+MariaDB%22+branch%3Amain)
|
6
6
|
|
7
|
-
[![codecov](https://codecov.io/gh/kibitan/masking/branch/
|
7
|
+
[![codecov](https://codecov.io/gh/kibitan/masking/branch/main/graph/badge.svg)](https://codecov.io/gh/kibitan/masking)
|
8
8
|
[![Maintainability](https://api.codeclimate.com/v1/badges/290b3005ecc193a3d138/maintainability)](https://codeclimate.com/github/kibitan/masking/maintainability)
|
9
9
|
[![Gem Version](https://badge.fury.io/rb/masking.svg)](https://badge.fury.io/rb/masking)
|
10
10
|
|
@@ -18,41 +18,46 @@ gem install masking
|
|
18
18
|
|
19
19
|
## Requirement
|
20
20
|
|
21
|
-
* Ruby 2.6/2.7/3.0/3.1
|
21
|
+
* Ruby 2.6/2.7/3.0/3.1/3.2
|
22
22
|
|
23
|
-
##
|
23
|
+
## Supporting RDBMS
|
24
24
|
|
25
25
|
* MySQL: 5.5<sup>[1](#footnote1)</sup>, 5.6, 5.7, 8.0
|
26
|
-
* MariaDB: 5.5, 10.0<sup>[2](#footnote2)</sup>, 10.1, 10.2, 10.3, 10.4
|
26
|
+
* MariaDB: 5.5, 10.0<sup>[2](#footnote2)</sup>, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
|
27
27
|
|
28
28
|
## Usage
|
29
29
|
|
30
30
|
1. Setup configuration for anonymizing target tables/columns to `masking.yml`
|
31
31
|
|
32
|
+
*NOTE: the columns which doesn't mention here will be NOT anonymized, it stays as it is.*
|
33
|
+
|
32
34
|
```yaml
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
35
|
+
# table_name:
|
36
|
+
# column_name: masked_value
|
37
|
+
|
38
|
+
users:
|
39
|
+
string: anonymized string
|
40
|
+
email: anonymized+%{n}@example.com # %{n} will be replaced with sequential number
|
41
|
+
integer: 12345
|
42
|
+
float: 123.45
|
43
|
+
boolean: true
|
44
|
+
null_column: null
|
45
|
+
date: 2018-08-24
|
46
|
+
time: 2018-08-24 15:54:06
|
47
|
+
binary_or_blob: !binary | # Binary Data Language-Independent Type for YAML™ Version 1.1: http://yaml.org/type/binary.html
|
48
|
+
R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5
|
49
|
+
OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+
|
50
|
+
+f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC
|
51
|
+
AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs=
|
52
|
+
# When a column name is suffixed with `?`, the original NULL value will not be anonymized.
|
53
|
+
# This option can be beneficial for simulating SQL execution that closely resembles the original data.
|
54
|
+
nullable_string?: anonymized nullable %{n} string
|
50
55
|
```
|
51
56
|
|
52
57
|
A value will be implicitly converted to a compatible type. If you prefer to explicitly convert, you could use a tag as defined in [YAML Version 1.1](http://yaml.org/spec/current.html#id2503753)
|
53
58
|
|
54
59
|
```yaml
|
55
|
-
|
60
|
+
not-date: !!str 2002-04-28
|
56
61
|
```
|
57
62
|
|
58
63
|
String should be matched with [MySQL String Type]( https://dev.mysql.com/doc/refman/8.0/en/string-type-overview.html). Integer/Float should be matched with [MySQL Numeric Type](https://dev.mysql.com/doc/refman/8.0/en/numeric-type-overview.html). Date/Time should be matched with [MySQL Date and Time Type](https://dev.mysql.com/doc/refman/8.0/en/date-and-time-type-overview.html).
|
@@ -160,6 +165,13 @@ The docker-compose file names for other database versions, specify that file.
|
|
160
165
|
* MySQL 5.7: [`docker-compose/mysql57.yml`](./docker-compose/mysql57.yml)
|
161
166
|
* MySQL 5.6: [`docker-compose/mysql56.yml`](./docker-compose/mysql56.yml)
|
162
167
|
* MySQL 5.5<sup>[1](#footnote1)</sup>: [`docker-compose/mysql55.yml`](./docker-compose/mysql55.yml)
|
168
|
+
* MariaDB 10.11: [`docker-compose/mariadb1011.yml`](./docker-compose/mariadb1011.yml)
|
169
|
+
* MariaDB 10.10: [`docker-compose/mariadb1010.yml`](./docker-compose/mariadb1010.yml)
|
170
|
+
* MariaDB 10.9: [`docker-compose/mariadb109.yml`](./docker-compose/mariadb109.yml)
|
171
|
+
* MariaDB 10.8: [`docker-compose/mariadb108.yml`](./docker-compose/mariadb108.yml)
|
172
|
+
* MariaDB 10.7: [`docker-compose/mariadb107.yml`](./docker-compose/mariadb107.yml)
|
173
|
+
* MariaDB 10.6: [`docker-compose/mariadb106.yml`](./docker-compose/mariadb106.yml)
|
174
|
+
* MariaDB 10.5: [`docker-compose/mariadb105.yml`](./docker-compose/mariadb105.yml)
|
163
175
|
* MariaDB 10.4: [`docker-compose/mariadb104.yml`](./docker-compose/mariadb104.yml)
|
164
176
|
* MariaDB 10.3: [`docker-compose/mariadb103.yml`](./docker-compose/mariadb103.yml)
|
165
177
|
* MariaDB 10.2: [`docker-compose/mariadb102.yml`](./docker-compose/mariadb102.yml)
|
@@ -238,7 +250,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
238
250
|
|
239
251
|
## Code of Conduct
|
240
252
|
|
241
|
-
Everyone interacting in the Masking project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kibitan/masking/blob/
|
253
|
+
Everyone interacting in the Masking project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/kibitan/masking/blob/main/CODE_OF_CONDUCT.md).
|
242
254
|
|
243
255
|
<a name="footnote1">1</a>: <small> MySQL 5.5 is already not supported by [official](https://www.mysql.com/support/supportedplatforms/database.html)</small>
|
244
256
|
|