pii_safe_schema 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1ebd5e7d63f153bb4cedccaa5345086238c221520e0a9a65e4874c5cdb5e4b0a
4
- data.tar.gz: c788254ae8852acc2dc8a8e1b62fb4463cd4133fdec748499715cbfb4132cd40
3
+ metadata.gz: a5a9abd519262fb092e04490f3b99c5f7e0293a777b1e29ee9a87b3fe0827728
4
+ data.tar.gz: 43c6fc045b82b8075bb73f345d0d60a3f6384a4981edc6c9472fbd8c04e2a9d7
5
5
  SHA512:
6
- metadata.gz: 3ff11da6f69694f15a90b66d4d9ed8a81beb01db60f6ab119120cae2af2019b82026b0721ffb441ef66d199ab794b6d6212ffae25d276f80fb14e8fb8cd68344
7
- data.tar.gz: e3f2cb9127b90fc06ffc56c8a109097dc2dd4b67c2e238ebd3afd4336aca218d2e27606f13936becb4f4e84947c24b0b3db20527baeef6cb4647a345d970e820
6
+ metadata.gz: 26ab3012c6310654ef6a3d8b7f0cd99129105ecee059fa1611f3803da96efba70b1c0bdff854086ff7cc446ce7e84676887dc4299b035fe89507169730c0c68d
7
+ data.tar.gz: 7153c208b0ca0574e61eaa186be393d20bec4cab360531f0c8644a1bd68da78695bcd513194477f73713c44839355e715e754f9da6e8259bdb46c9178695d0b1
data/.github/CODEOWNERS CHANGED
@@ -1 +1 @@
1
- * @wealthsimple/security
1
+ * @wealthsimple/platform-security
@@ -0,0 +1,71 @@
1
+ name: Default
2
+
3
+ # This workflow runs on all pushes to the repo so we can test changes and provide
4
+ # fast feedback. It also gets run when a pull request is created so that we can
5
+ # run the Sonarqube quality gate (which needs information from the PR). Subsequent
6
+ # pushes to the branch will provide PR information of any open PRs.
7
+ on:
8
+ push:
9
+ pull_request:
10
+ types: [opened, reopened]
11
+
12
+ concurrency:
13
+ group: default-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ preflight_check:
18
+ name: Preflight Check
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ matrix:
22
+ ruby-version: [2.7.5, 3.0.3]
23
+ steps:
24
+ # Need to fetch all refs, so we can check if the version has been bumped
25
+ - uses: actions/checkout@v2
26
+ with:
27
+ fetch-depth: 0
28
+
29
+ - name: Set up Ruby ${{ matrix.ruby-version }}
30
+ uses: ruby/setup-ruby@v1
31
+ with:
32
+ bundler-cache: true
33
+ ruby-version: ${{ matrix.ruby-version }}
34
+
35
+ - name: Lint
36
+ uses: wealthsimple/toolbox-script@v1
37
+ with:
38
+ script: toolbox.ruby.lint.run();
39
+
40
+ - name: Test
41
+ uses: wealthsimple/toolbox-script@v1
42
+ with:
43
+ script: toolbox.ruby.test.run();
44
+
45
+ publish:
46
+ name: Publish package
47
+ runs-on: ubuntu-latest
48
+ if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
49
+ needs:
50
+ - preflight_check
51
+ steps:
52
+ - uses: actions/checkout@v2
53
+
54
+ - uses: ruby/setup-ruby@v1
55
+ with:
56
+ bundler-cache: true
57
+
58
+ - name: Release the gem
59
+ run: |
60
+ mkdir -p ~/.gem
61
+ cat << EOF > ~/.gem/credentials
62
+ ---
63
+ :github: Bearer ${GITHUB_TOKEN}
64
+ :rubygems_api_key: ${RUBYGEMS_API_KEY}
65
+ EOF
66
+ chmod 0600 ~/.gem/credentials
67
+ git config user.email "noreply@wealthsimple.com"
68
+ git config user.name "Wolfbot"
69
+ bundle exec rake release
70
+ env:
71
+ RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.2
1
+ 2.7.5
data/CHANGELOG.md CHANGED
@@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file.
4
4
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## 1.4.0 - 2021-12-31
8
+ ### Changed
9
+ - Add Ruby 3.0.x support
10
+
11
+ ## 1.3.5 - 2021-03-15
12
+ ### Changed
13
+ - Add support for Rails 7
14
+
15
+ ## 1.3.4 - 2021-10-21
16
+ ### Changed
17
+ - Switched to Github Actions
18
+
19
+ ## 1.3.3 - 2021-03-15
20
+ ### Changed
21
+ - Pull CI images from ECR repository
22
+
23
+ ## 1.3.2 - 2021-03-15
24
+ ### Changed
25
+ - Update development to Ruby 2.7.2
26
+
7
27
  ## 1.3.1 - 2019-11-06
8
28
  ### Fixed
9
29
  - Passing arguments to `rake pii_safe_schema:generate_migrations` actually works
@@ -28,7 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
28
48
  - Added MIT License
29
49
 
30
50
  ## 1.0.4 - 2019-4-16
31
- ### Fixed
51
+ ### Fixed
32
52
  - converted any hyphens to underscores for consistency.
33
53
 
34
54
  ## 1.0.3
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # PII Safe Schema [![CircleCI](https://circleci.com/gh/wealthsimple/pii_safe_schema.svg?style=svg)](https://circleci.com/gh/wealthsimple/pii_safe_schema) [![Coverage Status](https://coveralls.io/repos/github/wealthsimple/pii_safe_schema/badge.svg?branch=master)](https://coveralls.io/github/wealthsimple/pii_safe_schema?branch=master)
1
+ # PII Safe Schema
2
+ ![CI](https://github.com/wealthsimple/pii_safe_schema/actions/workflows/default.yml/badge.svg)
2
3
 
3
4
  Schema migration tool for checking and adding comments on *Personally Identifiable Information* (PII) columns in Rails.
4
5
 
@@ -96,4 +97,4 @@ git clone https://github.com/wealthsimple/pii_safe_schema.git
96
97
  cd pii_safe_schema
97
98
  bundle install
98
99
  bundle exec rspec
99
- ```
100
+ ```
@@ -31,8 +31,8 @@ module PiiSafeSchema
31
31
  def generate_migration_lines(table, columns)
32
32
  migration_lines = columns.map do |c|
33
33
  "#{' ' * (safety_assured? ? 6 : 4)}"\
34
- "change_column :#{table}, :#{c.column.name}, :#{c.column.type}, "\
35
- "comment: \'#{c.suggestion.to_json}\'"\
34
+ "change_column :#{table}, :#{c.column.name}, :#{c.column.type}, "\
35
+ "comment: \'#{c.suggestion.to_json}\'"\
36
36
  end
37
37
  wrap_in_safety_assured(migration_lines)
38
38
  end
@@ -1,3 +1,3 @@
1
1
  module PiiSafeSchema
2
- VERSION = '1.3.2'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
@@ -55,7 +55,7 @@ module PiiSafeSchema
55
55
  end
56
56
  end
57
57
 
58
- def self.print_help!(do_exit: true) # rubocop:disable Metrics/MethodLength
58
+ def self.print_help!(do_exit: true)
59
59
  puts <<~HELPMSG # rubocop:disable Rails/Output
60
60
  Usage:
61
61
  rake pii_safe_schema:generate_migrations [table:column:annotation_type] ...
@@ -21,18 +21,16 @@ Gem::Specification.new do |s|
21
21
  s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  s.require_paths = ['lib']
23
23
 
24
- s.add_dependency 'activesupport', '>= 5', '< 7'
25
24
  s.add_dependency 'colorize'
26
- s.add_dependency 'rails', '>= 5', '< 7'
25
+ s.add_dependency 'rails', '>= 5', '< 8'
27
26
 
28
27
  s.add_development_dependency 'bundler', '>= 1.16'
29
28
  s.add_development_dependency 'bundler-audit'
30
- s.add_development_dependency 'coveralls'
31
29
  s.add_development_dependency 'dogstatsd-ruby'
32
30
  s.add_development_dependency 'git'
33
31
  s.add_development_dependency 'guard-rspec'
34
32
  s.add_development_dependency 'pry'
35
- s.add_development_dependency 'rails', '>= 5.2.3', '< 7'
33
+ s.add_development_dependency 'rails', '>= 5', '< 8'
36
34
  s.add_development_dependency 'rake', '>= 10.0'
37
35
  s.add_development_dependency 'rspec', '< 4', '>= 3.0'
38
36
  s.add_development_dependency 'rspec-collection_matchers'
metadata CHANGED
@@ -1,35 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pii_safe_schema
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexi Garrow
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-15 00:00:00.000000000 Z
11
+ date: 2022-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '5'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '7'
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '5'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '7'
33
13
  - !ruby/object:Gem::Dependency
34
14
  name: colorize
35
15
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +33,7 @@ dependencies:
53
33
  version: '5'
54
34
  - - "<"
55
35
  - !ruby/object:Gem::Version
56
- version: '7'
36
+ version: '8'
57
37
  type: :runtime
58
38
  prerelease: false
59
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -63,7 +43,7 @@ dependencies:
63
43
  version: '5'
64
44
  - - "<"
65
45
  - !ruby/object:Gem::Version
66
- version: '7'
46
+ version: '8'
67
47
  - !ruby/object:Gem::Dependency
68
48
  name: bundler
69
49
  requirement: !ruby/object:Gem::Requirement
@@ -92,20 +72,6 @@ dependencies:
92
72
  - - ">="
93
73
  - !ruby/object:Gem::Version
94
74
  version: '0'
95
- - !ruby/object:Gem::Dependency
96
- name: coveralls
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- version: '0'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: '0'
109
75
  - !ruby/object:Gem::Dependency
110
76
  name: dogstatsd-ruby
111
77
  requirement: !ruby/object:Gem::Requirement
@@ -168,20 +134,20 @@ dependencies:
168
134
  requirements:
169
135
  - - ">="
170
136
  - !ruby/object:Gem::Version
171
- version: 5.2.3
137
+ version: '5'
172
138
  - - "<"
173
139
  - !ruby/object:Gem::Version
174
- version: '7'
140
+ version: '8'
175
141
  type: :development
176
142
  prerelease: false
177
143
  version_requirements: !ruby/object:Gem::Requirement
178
144
  requirements:
179
145
  - - ">="
180
146
  - !ruby/object:Gem::Version
181
- version: 5.2.3
147
+ version: '5'
182
148
  - - "<"
183
149
  - !ruby/object:Gem::Version
184
- version: '7'
150
+ version: '8'
185
151
  - !ruby/object:Gem::Dependency
186
152
  name: rake
187
153
  requirement: !ruby/object:Gem::Requirement
@@ -335,9 +301,9 @@ executables: []
335
301
  extensions: []
336
302
  extra_rdoc_files: []
337
303
  files:
338
- - ".circleci/config.yml"
339
304
  - ".github/CODEOWNERS"
340
305
  - ".github/PULL_REQUEST_TEMPLATE.md"
306
+ - ".github/workflows/default.yml"
341
307
  - ".gitignore"
342
308
  - ".rspec"
343
309
  - ".rubocop.yml"
@@ -381,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
381
347
  - !ruby/object:Gem::Version
382
348
  version: '0'
383
349
  requirements: []
384
- rubygems_version: 3.1.4
350
+ rubygems_version: 3.1.6
385
351
  signing_key:
386
352
  specification_version: 4
387
353
  summary: Schema migration tool for checking and adding comments on PII columns.
data/.circleci/config.yml DELETED
@@ -1,118 +0,0 @@
1
- version: 2
2
-
3
- defaults: &defaults
4
- working_directory: /home/circleci/wealthsimple
5
- docker:
6
- - image: circleci/ruby:2.7.2
7
- - image: circleci/postgres:9.5.9-alpine
8
- environment:
9
- POSTGRES_USER: circleci
10
- POSTGRES_DB: pii_safe_schema_test
11
-
12
- # These are common snippets that are referenced in multiple workflows.
13
- references:
14
- attach_code_workspace: &attach_code_workspace
15
- attach_workspace:
16
- at: /home/circleci/wealthsimple
17
-
18
- restore_bundle_dependencies: &restore_bundle_dependencies
19
- run:
20
- name: Restore bundle dependencies from workspace
21
- command: bundle --path vendor/bundle
22
-
23
- jobs:
24
- checkout_and_bundle:
25
- <<: *defaults
26
- steps:
27
- - checkout
28
- - run:
29
- command: bundle install --jobs=4 --retry=3 --path vendor/bundle
30
- - persist_to_workspace:
31
- root: .
32
- paths: .
33
-
34
- rspec:
35
- <<: *defaults
36
- steps:
37
- - *attach_code_workspace
38
- - *restore_bundle_dependencies
39
- - run:
40
- command: sudo apt install -y postgresql-client || true
41
- - run:
42
- command: bundle exec bundle-audit update && bundle exec bundle-audit check
43
- - run:
44
- command: bundle exec rspec
45
-
46
- lint_check:
47
- <<: *defaults
48
- steps:
49
- - *attach_code_workspace
50
- - *restore_bundle_dependencies
51
- - run:
52
- command: bundle exec rubocop
53
-
54
- vulnerability_check:
55
- <<: *defaults
56
- steps:
57
- - *attach_code_workspace
58
- - *restore_bundle_dependencies
59
- - run:
60
- command: bundle exec bundle-audit update && bundle exec bundle-audit check
61
-
62
- release:
63
- <<: *defaults
64
- steps:
65
- - add_ssh_keys:
66
- fingerprints:
67
- - "46:b5:cb:ee:57:dc:14:95:31:be:12:13:4f:11:94:a4"
68
- - *attach_code_workspace
69
- - *restore_bundle_dependencies
70
- - run:
71
- name: Release to rubygems.org
72
- command: |
73
- mkdir ~/.gem
74
- echo ":rubygems_api_key: ${RUBYGEMS_API_KEY}" >> ~/.gem/credentials
75
- chmod 600 ~/.gem/credentials
76
- mkdir -p ~/.ssh
77
- echo "github.com,192.30.253.112 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==" >> ~/.ssh/known_hosts
78
- bundle exec rake release
79
-
80
- workflows:
81
- version: 2
82
- build_and_test:
83
- jobs:
84
- - checkout_and_bundle:
85
- context: wealthsimple
86
- - rspec:
87
- requires:
88
- - checkout_and_bundle
89
- - lint_check:
90
- requires:
91
- - checkout_and_bundle
92
- - vulnerability_check:
93
- requires:
94
- - checkout_and_bundle
95
- - release:
96
- context: wealthsimple
97
- filters:
98
- branches:
99
- only: master
100
- requires:
101
- - rspec
102
- - lint_check
103
- - vulnerability_check
104
-
105
- security-audit:
106
- triggers:
107
- - schedule:
108
- # 11:45 am UTC: 6:45 am EST / 7:45 am EDT
109
- cron: "45 11 * * *"
110
- filters:
111
- branches:
112
- only: master
113
- jobs:
114
- - checkout_and_bundle:
115
- context: wealthsimple
116
- - vulnerability_check:
117
- requires:
118
- - checkout_and_bundle