safety_goggles 2.1.1 → 2.2.0
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 +60 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +8 -0
- data/.gitignore +0 -1
- data/.pre-commit-config.yaml +62 -0
- data/.rubocop.yml +44 -42
- data/.secrets.baseline +44 -0
- data/.travis.yml +14 -9
- data/CHANGELOG.md +12 -5
- data/Gemfile +2 -0
- data/Gemfile.lock +78 -68
- data/LICENSE +14 -0
- data/Rakefile +2 -0
- data/lib/safety_goggles.rb +2 -0
- data/lib/safety_goggles/handler.rb +9 -3
- data/lib/safety_goggles/record_not_found_error.rb +2 -0
- data/lib/safety_goggles/unauthorized_error.rb +2 -0
- data/safety_goggles.gemspec +19 -17
- data/spec/lib/handler_spec.rb +5 -5
- data/spec/lib/record_not_found_error_spec.rb +2 -0
- data/spec/lib/unauthorized_error_spec.rb +2 -0
- data/spec/spec_helper.rb +2 -0
- metadata +120 -56
- data/Makefile +0 -26
- data/VERSION +0 -1
- data/ci/README.md +0 -21
- data/ci/push.sh +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b1e159356c9abc67b5042c96605bf47117b3ffb157cf16e3d8a1ac1ebad9519
|
4
|
+
data.tar.gz: ac3c63c701c3139b57fad9e755266ed5b2a97977ff676dfa61f7d37316aff9b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cb4f3b8a3aa8d547ddd58a3e0cea083e92c7c7369fb807f14505cfebddc5e22b90ee7c1a61f878c216e1091fa434afbe38f3fca3e64b9b5c2a2cf2519ca18b0
|
7
|
+
data.tar.gz: 98b0982ad7f53b5a9a2ba9ba77ba6c34368dfc5397be388a81b5c0d6f4ad4187cca3664c01a5e0b2abcacbc0d22ad263d795910f0865fc30e2d1e607f1a342f1
|
@@ -0,0 +1,60 @@
|
|
1
|
+
---
|
2
|
+
# Ruby CircleCI 2.0 configuration file
|
3
|
+
#
|
4
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
5
|
+
#
|
6
|
+
version: 2
|
7
|
+
jobs:
|
8
|
+
build:
|
9
|
+
docker:
|
10
|
+
# specify the version you desire here
|
11
|
+
- image: circleci/ruby:2.6.5-node-browsers
|
12
|
+
|
13
|
+
# Specify service dependencies here if necessary
|
14
|
+
# CircleCI maintains a library of pre-built images
|
15
|
+
# documented at https://circleci.com/docs/2.0/circleci-images/
|
16
|
+
# - image: circleci/postgres:9.4
|
17
|
+
|
18
|
+
working_directory: ~/repo
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- checkout
|
22
|
+
|
23
|
+
# Download and cache dependencies
|
24
|
+
- restore_cache:
|
25
|
+
keys:
|
26
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
27
|
+
# fallback to using the latest cache if no exact match is found
|
28
|
+
- v1-dependencies-
|
29
|
+
|
30
|
+
- run:
|
31
|
+
name: install dependencies
|
32
|
+
command: |
|
33
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
34
|
+
|
35
|
+
- save_cache:
|
36
|
+
paths:
|
37
|
+
- ./vendor/bundle
|
38
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
39
|
+
|
40
|
+
# run tests!
|
41
|
+
- run:
|
42
|
+
name: run tests
|
43
|
+
command: |
|
44
|
+
mkdir /tmp/test-results
|
45
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | \
|
46
|
+
circleci tests split --split-by=timings)"
|
47
|
+
|
48
|
+
bundle exec rspec \
|
49
|
+
--format progress \
|
50
|
+
--format RspecJunitFormatter \
|
51
|
+
--out /tmp/test-results/rspec.xml \
|
52
|
+
--format progress \
|
53
|
+
$TEST_FILES
|
54
|
+
|
55
|
+
# collect reports
|
56
|
+
- store_test_results:
|
57
|
+
path: /tmp/test-results
|
58
|
+
- store_artifacts:
|
59
|
+
path: /tmp/test-results
|
60
|
+
destination: test-results
|
data/.gitignore
CHANGED
@@ -0,0 +1,62 @@
|
|
1
|
+
---
|
2
|
+
# Install pre-commit via either of these:
|
3
|
+
# pip install pre-commit
|
4
|
+
# brew install pre-commit
|
5
|
+
#
|
6
|
+
# Enable the current repo for pre-commit:
|
7
|
+
# pre-commit install
|
8
|
+
#
|
9
|
+
# Check current commit:
|
10
|
+
# pre-commit
|
11
|
+
#
|
12
|
+
# Check all files:
|
13
|
+
# pre-commit run --all-files
|
14
|
+
repos:
|
15
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
16
|
+
rev: v2.3.0
|
17
|
+
hooks:
|
18
|
+
- id: check-ast # Python syntax
|
19
|
+
- id: check-case-conflict # VERSION and version in same repo
|
20
|
+
- id: check-docstring-first # Python docs
|
21
|
+
- id: check-executables-have-shebangs # #!/bin/bash
|
22
|
+
- id: check-json
|
23
|
+
- id: check-merge-conflict
|
24
|
+
- id: check-symlinks
|
25
|
+
- id: check-xml
|
26
|
+
- id: check-yaml
|
27
|
+
- id: debug-statements # Python debug stuff
|
28
|
+
- id: detect-aws-credentials
|
29
|
+
args:
|
30
|
+
- --allow-missing-credentials
|
31
|
+
- id: detect-private-key
|
32
|
+
- id: end-of-file-fixer # Forces newline at the end
|
33
|
+
- id: flake8 # Lint Python stuff
|
34
|
+
- id: mixed-line-ending
|
35
|
+
# - id: no-commit-to-branch # Protect master
|
36
|
+
- id: pretty-format-json
|
37
|
+
args:
|
38
|
+
- --autofix
|
39
|
+
- id: requirements-txt-fixer
|
40
|
+
- id: sort-simple-yaml
|
41
|
+
- id: trailing-whitespace
|
42
|
+
|
43
|
+
# Install detect-secrets:
|
44
|
+
# pip install detect-secrets
|
45
|
+
#
|
46
|
+
# For every additional repo, generate a known secrets file:
|
47
|
+
# detect-secrets scan > .secrets.baseline
|
48
|
+
#
|
49
|
+
# And whitelist known good stuff:
|
50
|
+
# detect-secrets audit .secrets.baseline
|
51
|
+
#
|
52
|
+
# You can update and whitelist more later:
|
53
|
+
# detect-secrets scan --update .secrets.baseline
|
54
|
+
#
|
55
|
+
# https://github.com/Yelp/detect-secrets
|
56
|
+
- repo: https://github.com/Yelp/detect-secrets
|
57
|
+
rev: v0.12.7
|
58
|
+
hooks:
|
59
|
+
- id: detect-secrets
|
60
|
+
args: ["--baseline", ".secrets.baseline"]
|
61
|
+
exclude: .*/tests/.*
|
62
|
+
language_version: python3
|
data/.rubocop.yml
CHANGED
@@ -1,53 +1,43 @@
|
|
1
|
-
|
1
|
+
---
|
2
|
+
require:
|
3
|
+
- rubocop-gitlab-security
|
4
|
+
- rubocop-performance
|
5
|
+
- rubocop-rails
|
2
6
|
|
3
7
|
# Common configuration.
|
4
8
|
AllCops:
|
5
9
|
# Include gemspec and Rakefile
|
6
10
|
Include:
|
7
|
-
-
|
8
|
-
-
|
9
|
-
-
|
10
|
-
-
|
11
|
-
-
|
11
|
+
- "**/Gemfile"
|
12
|
+
- "**/Rakefile"
|
13
|
+
- "**/*.gemspec"
|
14
|
+
- "**/*.jbuilder"
|
15
|
+
- "**/*.rb"
|
12
16
|
Exclude:
|
13
|
-
-
|
14
|
-
-
|
15
|
-
-
|
16
|
-
-
|
17
|
-
-
|
18
|
-
-
|
19
|
-
-
|
20
|
-
-
|
21
|
-
-
|
22
|
-
-
|
23
|
-
-
|
24
|
-
-
|
25
|
-
-
|
26
|
-
-
|
27
|
-
-
|
28
|
-
-
|
17
|
+
- "bin/bundle"
|
18
|
+
- "bin/rails"
|
19
|
+
- "bin/rake"
|
20
|
+
- "bin/setup"
|
21
|
+
- "bin/spring"
|
22
|
+
- "bin/update"
|
23
|
+
- "config.ru"
|
24
|
+
- "config/application.rb"
|
25
|
+
- "config/boot.rb"
|
26
|
+
- "config/environment.rb"
|
27
|
+
- "db/migrate/**/*"
|
28
|
+
- "db/schema.rb"
|
29
|
+
- "secure_rails"
|
30
|
+
- "test/**/*"
|
31
|
+
- "tmp/**/*"
|
32
|
+
- "vendor/**/*"
|
33
|
+
TargetRubyVersion: 2.6
|
29
34
|
|
30
|
-
Rails:
|
31
|
-
Enabled: true
|
32
|
-
|
33
|
-
# # Not compatible with Rails < 4
|
34
|
-
# ActionFilter:
|
35
|
-
# Enabled: false
|
36
|
-
|
37
|
-
AlignParameters:
|
38
|
-
EnforcedStyle: with_fixed_indentation
|
39
|
-
|
40
|
-
ClassLength:
|
41
|
-
Max: 300
|
42
35
|
|
43
36
|
Encoding:
|
44
37
|
Enabled: false
|
45
38
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
HasAndBelongsToMany:
|
50
|
-
Enabled: false
|
39
|
+
Rails:
|
40
|
+
Enabled: true
|
51
41
|
|
52
42
|
Layout/AlignHash:
|
53
43
|
# Alignment of entries using colon as separator. Valid values are:
|
@@ -63,21 +53,33 @@ Layout/AlignHash:
|
|
63
53
|
# bb: 1
|
64
54
|
EnforcedColonStyle: table
|
65
55
|
|
56
|
+
Layout/IndentFirstHashElement:
|
57
|
+
EnforcedStyle: consistent
|
58
|
+
|
66
59
|
Layout/SpaceBeforeFirstArg:
|
67
60
|
Enabled: false
|
68
61
|
|
69
|
-
|
62
|
+
Metrics/ClassLength:
|
63
|
+
Max: 300
|
64
|
+
|
65
|
+
Metrics/LineLength:
|
70
66
|
Max: 120
|
71
67
|
|
72
68
|
# Default 10
|
73
|
-
MethodLength:
|
69
|
+
Metrics/MethodLength:
|
74
70
|
Max: 30
|
75
71
|
|
76
72
|
# Default 15
|
77
73
|
Metrics/AbcSize:
|
78
74
|
Max: 30
|
79
75
|
|
80
|
-
|
76
|
+
Rails/HasAndBelongsToMany:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
Style/AliParameters:
|
80
|
+
EnforcedStygnle: with_fixed_indentation
|
81
|
+
|
82
|
+
Style/StringLiterals:
|
81
83
|
EnforcedStyle: double_quotes
|
82
84
|
|
83
85
|
Style/AsciiComments:
|
data/.secrets.baseline
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
{
|
2
|
+
"exclude": {
|
3
|
+
"files": null,
|
4
|
+
"lines": null
|
5
|
+
},
|
6
|
+
"generated_at": "2019-10-21T17:11:16Z",
|
7
|
+
"plugins_used": [
|
8
|
+
{
|
9
|
+
"name": "AWSKeyDetector"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"base64_limit": 4.5,
|
13
|
+
"name": "Base64HighEntropyString"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"name": "BasicAuthDetector"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"hex_limit": 3,
|
20
|
+
"name": "HexHighEntropyString"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"name": "KeywordDetector"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"name": "PrivateKeyDetector"
|
27
|
+
}
|
28
|
+
],
|
29
|
+
"results": {
|
30
|
+
"ci/push.sh": [
|
31
|
+
{
|
32
|
+
"hashed_secret": "335fb8097dbbc802d82afa076d8984279f81c32a",
|
33
|
+
"is_verified": false,
|
34
|
+
"line_number": 14,
|
35
|
+
"type": "Secret Keyword"
|
36
|
+
}
|
37
|
+
]
|
38
|
+
},
|
39
|
+
"version": "0.12.7",
|
40
|
+
"word_list": {
|
41
|
+
"file": null,
|
42
|
+
"hash": null
|
43
|
+
}
|
44
|
+
}
|
data/.travis.yml
CHANGED
@@ -2,31 +2,36 @@
|
|
2
2
|
sudo: false
|
3
3
|
language: ruby
|
4
4
|
rvm:
|
5
|
-
- 2.
|
5
|
+
- 2.6.5
|
6
6
|
|
7
7
|
cache:
|
8
|
-
# - apt
|
9
8
|
- bundler
|
10
9
|
|
11
10
|
before_install:
|
12
11
|
- gem install bundler -v 1.16.2
|
13
|
-
- gem install bundler-audit -v 0.6.
|
12
|
+
- gem install bundler-audit -v 0.6.1
|
14
13
|
|
15
14
|
# We don't want deployment mode
|
16
15
|
# It gets confusing when the gem we're building is part of the Gemfile.lock
|
17
|
-
install:
|
16
|
+
install:
|
17
|
+
- bundle install --jobs=3 --retry=3 --path vendor/bundle
|
18
18
|
|
19
19
|
script:
|
20
20
|
- bundle audit --update
|
21
21
|
- bundle exec rubocop -D Gemfile safety_goggles.gemspec lib/
|
22
22
|
- bundle exec rake spec
|
23
23
|
|
24
|
+
before_deploy:
|
25
|
+
- mkdir -p ~/.gem
|
26
|
+
- 'echo ":rubygems_api_key: ${RUBYGEMS_API_KEY:?}" > ~/.gem/credentials'
|
27
|
+
- chmod 600 ~/.gem/credentials
|
28
|
+
- gem build *.gemspec
|
29
|
+
- git checkout -- Gemfile.lock
|
30
|
+
- ls -la
|
31
|
+
|
24
32
|
deploy:
|
25
33
|
provider: script
|
26
|
-
script:
|
34
|
+
script: 'gem push safety_goggles-${TRAVIS_TAG:?}.gem'
|
35
|
+
skip_cleanup: true
|
27
36
|
on:
|
28
37
|
tags: true
|
29
|
-
|
30
|
-
notifications:
|
31
|
-
slack:
|
32
|
-
secure: "IEvcFxI8CddcjTjRPQYlh4SSyedYV55RRRyFBfuT9bpb0WRdmsOfsdyzCyJ2LjcqKlJ9IJIXd2oS9RQniSLgoc77KRyFhyX3ZnYr/v+d2Dk/IVWF7gDyMZ1UaYMhmnyXgX3SrUnu3uL5ID3KjsfQh5C7fATlj+M6k1qBLrpSJ8Q2rSkDEGOdtLKNAPp/eamXXizZcNUXmLXqqKhtOB8hvAtzVaXNxypfSkYQu9YpqS8GWwnK9EWgjMw0axPJ80iE9wlXDcOax5DdROfhbz9E8NZjaCSjadqPij3OebINI0ToRYlCvtjOQ32nx3av1rJV5rZ33/vn2Uq15RBOW/dkTI4ilQ+6ymlKVuDs+PsLzpYXmkT2XZJo+KXENUc+1MYxhpewmtio/KpV/1ecbtpzWFeFM/beLmrASePoKOgiNvH66b+ifSP4sQsFBZMhccF5px6+kiW3i8A1jY3mEyO9Ubh0jRl4bRdhaMqS5CqM5B7Vs86xiWoZqF+XEE4CPTT5oKTWptLEdXKTkJHkOLHohjjYKu2YT41Bm7jIng3CXD2Ej26bg65VHs78v/g/z5qimxrBgW1VgbUST+PpCyjb2CPNoAU++QgdstHX8Z4usPi2PpvP/zm+hGH4yCIDKvbSapGyC/aemlNQm2v7Pe+qNNFpqv/eVAn9YBS2kmMeNfA="
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
7
7
|
|
8
8
|
## [Unreleased][]
|
9
9
|
|
10
|
+
## [2.2.0][] - 2019-10-21
|
11
|
+
|
12
|
+
## Changed
|
13
|
+
|
14
|
+
- Published open source version.
|
15
|
+
|
10
16
|
## [2.1.1][] - 2018-07-13
|
11
17
|
|
12
18
|
### Fixed
|
@@ -65,8 +71,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
65
71
|
|
66
72
|
- Fix for environment check
|
67
73
|
|
68
|
-
[unreleased]: https://github.
|
69
|
-
[2.
|
70
|
-
[2.1.
|
71
|
-
[2.0
|
72
|
-
[
|
74
|
+
[unreleased]: https://github.com/IBM/safety-goggles/compare/2.2.0...HEAD
|
75
|
+
[2.2.0]: https://github.com/IBM/safety-goggles/compare/2.1.1...2.2.0
|
76
|
+
[2.1.1]: https://github.com/IBM/safety-goggles/compare/2.1.0...2.1.1
|
77
|
+
[2.1.0]: https://github.com/IBM/safety-goggles/compare/2.0.10...2.1.0
|
78
|
+
[2.0.10]: https://github.com/IBM/safety-goggles/compare/v1.2.2...2.0.10
|
79
|
+
[1.2.2]: https://github.com/IBM/safety-goggles/compare/v1.1.0...v1.2.2
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
safety_goggles (2.
|
4
|
+
safety_goggles (2.2.0)
|
5
5
|
sentry-raven (~> 2.6)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actionpack (5.2.
|
11
|
-
actionview (= 5.2.
|
12
|
-
activesupport (= 5.2.
|
10
|
+
actionpack (5.2.3)
|
11
|
+
actionview (= 5.2.3)
|
12
|
+
activesupport (= 5.2.3)
|
13
13
|
rack (~> 2.0)
|
14
14
|
rack-test (>= 0.6.3)
|
15
15
|
rails-dom-testing (~> 2.0)
|
16
16
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
17
|
-
actionview (5.2.
|
18
|
-
activesupport (= 5.2.
|
17
|
+
actionview (5.2.3)
|
18
|
+
activesupport (= 5.2.3)
|
19
19
|
builder (~> 3.1)
|
20
20
|
erubi (~> 1.4)
|
21
21
|
rails-dom-testing (~> 2.0)
|
22
22
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
23
|
-
activemodel (5.2.
|
24
|
-
activesupport (= 5.2.
|
25
|
-
activerecord (5.2.
|
26
|
-
activemodel (= 5.2.
|
27
|
-
activesupport (= 5.2.
|
23
|
+
activemodel (5.2.3)
|
24
|
+
activesupport (= 5.2.3)
|
25
|
+
activerecord (5.2.3)
|
26
|
+
activemodel (= 5.2.3)
|
27
|
+
activesupport (= 5.2.3)
|
28
28
|
arel (>= 9.0)
|
29
|
-
activesupport (5.2.
|
29
|
+
activesupport (5.2.3)
|
30
30
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
31
31
|
i18n (>= 0.7, < 2)
|
32
32
|
minitest (~> 5.1)
|
@@ -34,23 +34,23 @@ GEM
|
|
34
34
|
addressable (2.4.0)
|
35
35
|
arel (9.0.0)
|
36
36
|
ast (2.4.0)
|
37
|
-
backports (3.
|
37
|
+
backports (3.15.0)
|
38
38
|
builder (3.2.3)
|
39
|
-
bundler-audit (0.6.
|
40
|
-
bundler (
|
39
|
+
bundler-audit (0.6.1)
|
40
|
+
bundler (>= 1.2.0, < 3)
|
41
41
|
thor (~> 0.18)
|
42
|
-
concurrent-ruby (1.
|
43
|
-
crass (1.0.
|
42
|
+
concurrent-ruby (1.1.5)
|
43
|
+
crass (1.0.5)
|
44
44
|
diff-lcs (1.3)
|
45
|
-
docile (1.3.
|
46
|
-
erubi (1.
|
47
|
-
ethon (0.
|
45
|
+
docile (1.3.2)
|
46
|
+
erubi (1.9.0)
|
47
|
+
ethon (0.12.0)
|
48
48
|
ffi (>= 1.3.0)
|
49
|
-
faraday (0.
|
49
|
+
faraday (0.17.0)
|
50
50
|
multipart-post (>= 1.2, < 3)
|
51
|
-
faraday_middleware (0.
|
51
|
+
faraday_middleware (0.13.1)
|
52
52
|
faraday (>= 0.7.4, < 1.0)
|
53
|
-
ffi (1.
|
53
|
+
ffi (1.11.1)
|
54
54
|
gh (0.15.1)
|
55
55
|
addressable (~> 2.4.0)
|
56
56
|
backports
|
@@ -59,73 +59,78 @@ GEM
|
|
59
59
|
net-http-persistent (~> 2.9)
|
60
60
|
net-http-pipeline
|
61
61
|
highline (1.7.10)
|
62
|
-
i18n (1.0
|
62
|
+
i18n (1.7.0)
|
63
63
|
concurrent-ruby (~> 1.0)
|
64
|
-
jaro_winkler (1.5.
|
65
|
-
json (2.
|
64
|
+
jaro_winkler (1.5.3)
|
65
|
+
json (2.2.0)
|
66
66
|
launchy (2.4.3)
|
67
67
|
addressable (~> 2.3)
|
68
|
-
loofah (2.
|
68
|
+
loofah (2.3.0)
|
69
69
|
crass (~> 1.0.2)
|
70
70
|
nokogiri (>= 1.5.9)
|
71
|
-
mini_portile2 (2.
|
72
|
-
minitest (5.
|
73
|
-
multi_json (1.
|
74
|
-
multipart-post (2.
|
71
|
+
mini_portile2 (2.4.0)
|
72
|
+
minitest (5.12.2)
|
73
|
+
multi_json (1.14.1)
|
74
|
+
multipart-post (2.1.1)
|
75
75
|
net-http-persistent (2.9.4)
|
76
76
|
net-http-pipeline (1.0.1)
|
77
77
|
net-ldap (0.16.1)
|
78
|
-
nokogiri (1.
|
79
|
-
mini_portile2 (~> 2.
|
80
|
-
parallel (1.
|
81
|
-
parser (2.5.
|
78
|
+
nokogiri (1.10.4)
|
79
|
+
mini_portile2 (~> 2.4.0)
|
80
|
+
parallel (1.18.0)
|
81
|
+
parser (2.6.5.0)
|
82
82
|
ast (~> 2.4.0)
|
83
|
-
powerpack (0.1.2)
|
84
83
|
pusher-client (0.6.2)
|
85
84
|
json
|
86
85
|
websocket (~> 1.0)
|
87
|
-
rack (2.0.
|
88
|
-
rack-test (1.
|
86
|
+
rack (2.0.7)
|
87
|
+
rack-test (1.1.0)
|
89
88
|
rack (>= 1.0, < 3)
|
90
89
|
rails-dom-testing (2.0.3)
|
91
90
|
activesupport (>= 4.2.0)
|
92
91
|
nokogiri (>= 1.6)
|
93
|
-
rails-html-sanitizer (1.0
|
94
|
-
loofah (~> 2.
|
92
|
+
rails-html-sanitizer (1.3.0)
|
93
|
+
loofah (~> 2.3)
|
95
94
|
rainbow (3.0.0)
|
96
|
-
rake (12.3.
|
97
|
-
rspec (3.
|
98
|
-
rspec-core (~> 3.
|
99
|
-
rspec-expectations (~> 3.
|
100
|
-
rspec-mocks (~> 3.
|
101
|
-
rspec-core (3.
|
102
|
-
rspec-support (~> 3.
|
103
|
-
rspec-expectations (3.
|
95
|
+
rake (12.3.3)
|
96
|
+
rspec (3.9.0)
|
97
|
+
rspec-core (~> 3.9.0)
|
98
|
+
rspec-expectations (~> 3.9.0)
|
99
|
+
rspec-mocks (~> 3.9.0)
|
100
|
+
rspec-core (3.9.0)
|
101
|
+
rspec-support (~> 3.9.0)
|
102
|
+
rspec-expectations (3.9.0)
|
104
103
|
diff-lcs (>= 1.2.0, < 2.0)
|
105
|
-
rspec-support (~> 3.
|
106
|
-
rspec-mocks (3.
|
104
|
+
rspec-support (~> 3.9.0)
|
105
|
+
rspec-mocks (3.9.0)
|
107
106
|
diff-lcs (>= 1.2.0, < 2.0)
|
108
|
-
rspec-support (~> 3.
|
109
|
-
rspec-support (3.
|
110
|
-
rubocop (0.
|
107
|
+
rspec-support (~> 3.9.0)
|
108
|
+
rspec-support (3.9.0)
|
109
|
+
rubocop (0.75.1)
|
111
110
|
jaro_winkler (~> 1.5.1)
|
112
111
|
parallel (~> 1.10)
|
113
|
-
parser (>= 2.
|
114
|
-
powerpack (~> 0.1)
|
112
|
+
parser (>= 2.6)
|
115
113
|
rainbow (>= 2.2.2, < 4.0)
|
116
114
|
ruby-progressbar (~> 1.7)
|
117
|
-
unicode-display_width (
|
118
|
-
|
119
|
-
|
115
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
116
|
+
rubocop-gitlab-security (0.1.1)
|
117
|
+
rubocop (>= 0.51)
|
118
|
+
rubocop-performance (1.5.0)
|
119
|
+
rubocop (>= 0.71.0)
|
120
|
+
rubocop-rails (2.3.2)
|
121
|
+
rack (>= 1.1)
|
122
|
+
rubocop (>= 0.72.0)
|
123
|
+
ruby-progressbar (1.10.1)
|
124
|
+
sentry-raven (2.12.0)
|
120
125
|
faraday (>= 0.7.6, < 1.0)
|
121
|
-
simplecov (0.
|
126
|
+
simplecov (0.17.1)
|
122
127
|
docile (~> 1.1)
|
123
128
|
json (>= 1.8, < 3)
|
124
129
|
simplecov-html (~> 0.10.0)
|
125
130
|
simplecov-html (0.10.2)
|
126
|
-
thor (0.20.
|
131
|
+
thor (0.20.3)
|
127
132
|
thread_safe (0.3.6)
|
128
|
-
travis (1.8.
|
133
|
+
travis (1.8.10)
|
129
134
|
backports
|
130
135
|
faraday (~> 0.9)
|
131
136
|
faraday_middleware (~> 0.9, >= 0.9.1)
|
@@ -138,27 +143,32 @@ GEM
|
|
138
143
|
ethon (>= 0.8.0)
|
139
144
|
tzinfo (1.2.5)
|
140
145
|
thread_safe (~> 0.1)
|
141
|
-
unicode-display_width (1.
|
146
|
+
unicode-display_width (1.6.0)
|
142
147
|
websocket (1.2.8)
|
143
148
|
|
144
149
|
PLATFORMS
|
145
150
|
ruby
|
146
151
|
|
147
152
|
DEPENDENCIES
|
148
|
-
actionpack (~> 5.
|
149
|
-
|
150
|
-
|
153
|
+
actionpack (~> 5.2)
|
154
|
+
actionview (~> 5.2, >= 5.2.2.1)
|
155
|
+
activemodel (~> 5.2)
|
156
|
+
activerecord (~> 5.2)
|
151
157
|
bundler-audit (~> 0.6)
|
152
|
-
loofah (~> 2.2, >= 2.2.
|
158
|
+
loofah (~> 2.2, >= 2.2.3)
|
153
159
|
net-ldap (~> 0.16)
|
154
|
-
nokogiri (~> 1.
|
160
|
+
nokogiri (~> 1.10, >= 1.10.4)
|
161
|
+
rack (~> 2.0, >= 2.0.6)
|
155
162
|
rails-html-sanitizer (~> 1.0, >= 1.0.4)
|
156
163
|
rake (~> 12.0)
|
157
164
|
rspec (~> 3.4)
|
158
165
|
rubocop (~> 0.49)
|
166
|
+
rubocop-gitlab-security (~> 0.1)
|
167
|
+
rubocop-performance (~> 1.5)
|
168
|
+
rubocop-rails (~> 2.3)
|
159
169
|
safety_goggles!
|
160
170
|
simplecov (~> 0.11, >= 0.11.1)
|
161
171
|
travis (~> 1.8)
|
162
172
|
|
163
173
|
BUNDLED WITH
|
164
|
-
1.
|
174
|
+
1.17.3
|
data/LICENSE
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
Copyright 2019 IBM
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
4
|
+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
|
5
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
|
6
|
+
persons to whom the Software is furnished to do so, subject to the following conditions:
|
7
|
+
|
8
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
|
9
|
+
Software.
|
10
|
+
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
|
12
|
+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
13
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
14
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
data/lib/safety_goggles.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module SafetyGoggles
|
2
4
|
class Handler
|
3
5
|
ERROR_CODES = {
|
@@ -38,14 +40,15 @@ module SafetyGoggles
|
|
38
40
|
severity = SEVERITIES.fetch(code, "warning")
|
39
41
|
|
40
42
|
Raven.capture_exception(error,
|
41
|
-
|
42
|
-
|
43
|
-
|
43
|
+
extra: { nice_backtrace: get_backtrace(error) },
|
44
|
+
level: severity,
|
45
|
+
tags: { code: code, class: error.class })
|
44
46
|
end
|
45
47
|
# :nocov:
|
46
48
|
|
47
49
|
def self.serious_env?
|
48
50
|
return false unless defined?(Rails)
|
51
|
+
|
49
52
|
# :nocov:
|
50
53
|
# rubocop:disable Rails/UnknownEnv
|
51
54
|
Rails.env.production? || Rails.env.staging?
|
@@ -56,16 +59,19 @@ module SafetyGoggles
|
|
56
59
|
def self.get_backtrace(error)
|
57
60
|
return [] unless error.respond_to?(:backtrace)
|
58
61
|
return [] if error.backtrace.nil?
|
62
|
+
|
59
63
|
error.backtrace.reject { |line| %r{/gems/}.match(line).present? }
|
60
64
|
end
|
61
65
|
|
62
66
|
def self.logger
|
63
67
|
return Rails.logger if defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger.present?
|
68
|
+
|
64
69
|
Logger.new(STDOUT)
|
65
70
|
end
|
66
71
|
|
67
72
|
def self.guess_env
|
68
73
|
return Rails.env if defined?(Rails) && Rails.respond_to?(:env)
|
74
|
+
|
69
75
|
"development"
|
70
76
|
end
|
71
77
|
end
|
data/safety_goggles.gemspec
CHANGED
@@ -1,18 +1,17 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
lib = File.expand_path("lib", __dir__)
|
4
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
|
6
|
-
# rubocop:disable Metrics/BlockLength
|
7
6
|
Gem::Specification.new do |spec|
|
8
7
|
spec.name = "safety_goggles"
|
9
|
-
spec.version =
|
8
|
+
spec.version = ENV.fetch("TRAVIS_TAG", "0.0.0")
|
10
9
|
spec.authors = ["Leons Petrazickis"]
|
11
10
|
spec.email = ["leonsp@ca.ibm.com"]
|
12
11
|
spec.summary = "Rails error handler"
|
13
12
|
spec.description = "Rails error handler that integrates with Sentry and generates 4xx error responses"
|
14
|
-
spec.homepage = "
|
15
|
-
spec.license = "
|
13
|
+
spec.homepage = "https://github.com/IBM/safety-goggles"
|
14
|
+
spec.license = "MIT"
|
16
15
|
|
17
16
|
# TODO: Remove dependency on git.
|
18
17
|
spec.files = %x(git ls-files).split($INPUT_RECORD_SEPARATOR)
|
@@ -20,24 +19,25 @@ Gem::Specification.new do |spec|
|
|
20
19
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
20
|
spec.require_paths = ["lib"]
|
22
21
|
|
23
|
-
# Install geminabox on the system but don't include it here
|
24
|
-
# so that Sinatra doesn't conflict with Rails5 stuff
|
25
|
-
|
26
|
-
# Force dependency update because of vulnerabilities
|
27
|
-
spec.add_development_dependency "loofah", "~> 2.2", ">= 2.2.1"
|
28
|
-
spec.add_development_dependency "nokogiri", "~> 1.8", ">= 1.8.3"
|
29
|
-
spec.add_development_dependency "rails-html-sanitizer", "~> 1.0", ">= 1.0.4"
|
30
|
-
|
31
22
|
# ActionController, ActiveRecord, and ActiveModel error definitions
|
32
|
-
spec.add_development_dependency "actionpack", "~> 5.
|
33
|
-
spec.add_development_dependency "
|
34
|
-
spec.add_development_dependency "
|
23
|
+
spec.add_development_dependency "actionpack", "~> 5.2"
|
24
|
+
spec.add_development_dependency "actionview", "~> 5.2", ">= 5.2.2.1"
|
25
|
+
spec.add_development_dependency "activemodel", "~> 5.2"
|
26
|
+
spec.add_development_dependency "activerecord", "~> 5.2"
|
35
27
|
|
36
28
|
spec.add_development_dependency "bundler-audit", "~> 0.6"
|
37
29
|
|
30
|
+
spec.add_development_dependency "loofah", "~> 2.2", ">= 2.2.3"
|
31
|
+
|
38
32
|
# LDAP errors
|
39
33
|
spec.add_development_dependency "net-ldap", "~> 0.16"
|
40
34
|
|
35
|
+
spec.add_development_dependency "nokogiri", "~> 1.10", ">= 1.10.4"
|
36
|
+
|
37
|
+
spec.add_development_dependency "rack", "~> 2.0", ">= 2.0.6"
|
38
|
+
|
39
|
+
spec.add_development_dependency "rails-html-sanitizer", "~> 1.0", ">= 1.0.4"
|
40
|
+
|
41
41
|
# To install the gem locally:
|
42
42
|
# bundle exec rake install
|
43
43
|
spec.add_development_dependency "rake", "~> 12.0"
|
@@ -55,8 +55,10 @@ Gem::Specification.new do |spec|
|
|
55
55
|
# Ruby Style Guide.
|
56
56
|
# https://github.com/bbatsov/rubocop
|
57
57
|
spec.add_development_dependency "rubocop", "~> 0.49"
|
58
|
+
spec.add_development_dependency "rubocop-gitlab-security", "~> 0.1"
|
59
|
+
spec.add_development_dependency "rubocop-performance", "~> 1.5"
|
60
|
+
spec.add_development_dependency "rubocop-rails", "~> 2.3"
|
58
61
|
|
59
62
|
# Also send stacktraces
|
60
63
|
spec.add_runtime_dependency "sentry-raven", "~> 2.6"
|
61
64
|
end
|
62
|
-
# rubocop:enable Metrics/BlockLength
|
data/spec/lib/handler_spec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "action_controller"
|
2
4
|
require "active_model"
|
3
5
|
require "active_model/validations"
|
@@ -14,11 +16,9 @@ require "safety_goggles/unauthorized_error"
|
|
14
16
|
RSpec.describe(SafetyGoggles::Handler) do
|
15
17
|
describe :handle_error do
|
16
18
|
it "doesn't throw any errors" do
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
expect { SafetyGoggles::Handler.handle_error(error) }.not_to raise_error
|
21
|
-
end
|
19
|
+
raise SafetyGoggles::UnauthorizedError, "Just testing"
|
20
|
+
rescue StandardError => e
|
21
|
+
expect { SafetyGoggles::Handler.handle_error(e) }.not_to raise_error
|
22
22
|
end
|
23
23
|
|
24
24
|
ERROR_CODES = {
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,163 +1,185 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: safety_goggles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leons Petrazickis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: actionpack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 2.2.1
|
19
|
+
version: '5.2'
|
23
20
|
type: :development
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 2.2.1
|
26
|
+
version: '5.2'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
|
-
name:
|
28
|
+
name: actionview
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
31
|
- - "~>"
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
33
|
+
version: '5.2'
|
40
34
|
- - ">="
|
41
35
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
36
|
+
version: 5.2.2.1
|
43
37
|
type: :development
|
44
38
|
prerelease: false
|
45
39
|
version_requirements: !ruby/object:Gem::Requirement
|
46
40
|
requirements:
|
47
41
|
- - "~>"
|
48
42
|
- !ruby/object:Gem::Version
|
49
|
-
version: '
|
43
|
+
version: '5.2'
|
50
44
|
- - ">="
|
51
45
|
- !ruby/object:Gem::Version
|
52
|
-
version:
|
46
|
+
version: 5.2.2.1
|
53
47
|
- !ruby/object:Gem::Dependency
|
54
|
-
name:
|
48
|
+
name: activemodel
|
55
49
|
requirement: !ruby/object:Gem::Requirement
|
56
50
|
requirements:
|
57
51
|
- - "~>"
|
58
52
|
- !ruby/object:Gem::Version
|
59
|
-
version: '
|
60
|
-
|
53
|
+
version: '5.2'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - "~>"
|
61
59
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
60
|
+
version: '5.2'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
name: activerecord
|
63
|
+
requirement: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '5.2'
|
63
68
|
type: :development
|
64
69
|
prerelease: false
|
65
70
|
version_requirements: !ruby/object:Gem::Requirement
|
66
71
|
requirements:
|
67
72
|
- - "~>"
|
68
73
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
70
|
-
|
74
|
+
version: '5.2'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: bundler-audit
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - "~>"
|
71
80
|
- !ruby/object:Gem::Version
|
72
|
-
version:
|
81
|
+
version: '0.6'
|
82
|
+
type: :development
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0.6'
|
73
89
|
- !ruby/object:Gem::Dependency
|
74
|
-
name:
|
90
|
+
name: loofah
|
75
91
|
requirement: !ruby/object:Gem::Requirement
|
76
92
|
requirements:
|
77
93
|
- - "~>"
|
78
94
|
- !ruby/object:Gem::Version
|
79
|
-
version: '
|
95
|
+
version: '2.2'
|
80
96
|
- - ">="
|
81
97
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
98
|
+
version: 2.2.3
|
83
99
|
type: :development
|
84
100
|
prerelease: false
|
85
101
|
version_requirements: !ruby/object:Gem::Requirement
|
86
102
|
requirements:
|
87
103
|
- - "~>"
|
88
104
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
105
|
+
version: '2.2'
|
90
106
|
- - ">="
|
91
107
|
- !ruby/object:Gem::Version
|
92
|
-
version:
|
108
|
+
version: 2.2.3
|
93
109
|
- !ruby/object:Gem::Dependency
|
94
|
-
name:
|
110
|
+
name: net-ldap
|
95
111
|
requirement: !ruby/object:Gem::Requirement
|
96
112
|
requirements:
|
97
113
|
- - "~>"
|
98
114
|
- !ruby/object:Gem::Version
|
99
|
-
version: '
|
100
|
-
- - ">="
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: 5.0.2
|
115
|
+
version: '0.16'
|
103
116
|
type: :development
|
104
117
|
prerelease: false
|
105
118
|
version_requirements: !ruby/object:Gem::Requirement
|
106
119
|
requirements:
|
107
120
|
- - "~>"
|
108
121
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
110
|
-
- - ">="
|
111
|
-
- !ruby/object:Gem::Version
|
112
|
-
version: 5.0.2
|
122
|
+
version: '0.16'
|
113
123
|
- !ruby/object:Gem::Dependency
|
114
|
-
name:
|
124
|
+
name: nokogiri
|
115
125
|
requirement: !ruby/object:Gem::Requirement
|
116
126
|
requirements:
|
117
127
|
- - "~>"
|
118
128
|
- !ruby/object:Gem::Version
|
119
|
-
version: '
|
129
|
+
version: '1.10'
|
120
130
|
- - ">="
|
121
131
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
132
|
+
version: 1.10.4
|
123
133
|
type: :development
|
124
134
|
prerelease: false
|
125
135
|
version_requirements: !ruby/object:Gem::Requirement
|
126
136
|
requirements:
|
127
137
|
- - "~>"
|
128
138
|
- !ruby/object:Gem::Version
|
129
|
-
version: '
|
139
|
+
version: '1.10'
|
130
140
|
- - ">="
|
131
141
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
142
|
+
version: 1.10.4
|
133
143
|
- !ruby/object:Gem::Dependency
|
134
|
-
name:
|
144
|
+
name: rack
|
135
145
|
requirement: !ruby/object:Gem::Requirement
|
136
146
|
requirements:
|
137
147
|
- - "~>"
|
138
148
|
- !ruby/object:Gem::Version
|
139
|
-
version: '0
|
149
|
+
version: '2.0'
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 2.0.6
|
140
153
|
type: :development
|
141
154
|
prerelease: false
|
142
155
|
version_requirements: !ruby/object:Gem::Requirement
|
143
156
|
requirements:
|
144
157
|
- - "~>"
|
145
158
|
- !ruby/object:Gem::Version
|
146
|
-
version: '0
|
159
|
+
version: '2.0'
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: 2.0.6
|
147
163
|
- !ruby/object:Gem::Dependency
|
148
|
-
name:
|
164
|
+
name: rails-html-sanitizer
|
149
165
|
requirement: !ruby/object:Gem::Requirement
|
150
166
|
requirements:
|
151
167
|
- - "~>"
|
152
168
|
- !ruby/object:Gem::Version
|
153
|
-
version: '0
|
169
|
+
version: '1.0'
|
170
|
+
- - ">="
|
171
|
+
- !ruby/object:Gem::Version
|
172
|
+
version: 1.0.4
|
154
173
|
type: :development
|
155
174
|
prerelease: false
|
156
175
|
version_requirements: !ruby/object:Gem::Requirement
|
157
176
|
requirements:
|
158
177
|
- - "~>"
|
159
178
|
- !ruby/object:Gem::Version
|
160
|
-
version: '0
|
179
|
+
version: '1.0'
|
180
|
+
- - ">="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: 1.0.4
|
161
183
|
- !ruby/object:Gem::Dependency
|
162
184
|
name: rake
|
163
185
|
requirement: !ruby/object:Gem::Requirement
|
@@ -234,6 +256,48 @@ dependencies:
|
|
234
256
|
- - "~>"
|
235
257
|
- !ruby/object:Gem::Version
|
236
258
|
version: '0.49'
|
259
|
+
- !ruby/object:Gem::Dependency
|
260
|
+
name: rubocop-gitlab-security
|
261
|
+
requirement: !ruby/object:Gem::Requirement
|
262
|
+
requirements:
|
263
|
+
- - "~>"
|
264
|
+
- !ruby/object:Gem::Version
|
265
|
+
version: '0.1'
|
266
|
+
type: :development
|
267
|
+
prerelease: false
|
268
|
+
version_requirements: !ruby/object:Gem::Requirement
|
269
|
+
requirements:
|
270
|
+
- - "~>"
|
271
|
+
- !ruby/object:Gem::Version
|
272
|
+
version: '0.1'
|
273
|
+
- !ruby/object:Gem::Dependency
|
274
|
+
name: rubocop-performance
|
275
|
+
requirement: !ruby/object:Gem::Requirement
|
276
|
+
requirements:
|
277
|
+
- - "~>"
|
278
|
+
- !ruby/object:Gem::Version
|
279
|
+
version: '1.5'
|
280
|
+
type: :development
|
281
|
+
prerelease: false
|
282
|
+
version_requirements: !ruby/object:Gem::Requirement
|
283
|
+
requirements:
|
284
|
+
- - "~>"
|
285
|
+
- !ruby/object:Gem::Version
|
286
|
+
version: '1.5'
|
287
|
+
- !ruby/object:Gem::Dependency
|
288
|
+
name: rubocop-rails
|
289
|
+
requirement: !ruby/object:Gem::Requirement
|
290
|
+
requirements:
|
291
|
+
- - "~>"
|
292
|
+
- !ruby/object:Gem::Version
|
293
|
+
version: '2.3'
|
294
|
+
type: :development
|
295
|
+
prerelease: false
|
296
|
+
version_requirements: !ruby/object:Gem::Requirement
|
297
|
+
requirements:
|
298
|
+
- - "~>"
|
299
|
+
- !ruby/object:Gem::Version
|
300
|
+
version: '2.3'
|
237
301
|
- !ruby/object:Gem::Dependency
|
238
302
|
name: sentry-raven
|
239
303
|
requirement: !ruby/object:Gem::Requirement
|
@@ -256,20 +320,21 @@ executables: []
|
|
256
320
|
extensions: []
|
257
321
|
extra_rdoc_files: []
|
258
322
|
files:
|
323
|
+
- ".circleci/config.yml"
|
259
324
|
- ".editorconfig"
|
325
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
260
326
|
- ".gitignore"
|
327
|
+
- ".pre-commit-config.yaml"
|
261
328
|
- ".rspec"
|
262
329
|
- ".rubocop.yml"
|
330
|
+
- ".secrets.baseline"
|
263
331
|
- ".travis.yml"
|
264
332
|
- CHANGELOG.md
|
265
333
|
- Gemfile
|
266
334
|
- Gemfile.lock
|
267
|
-
-
|
335
|
+
- LICENSE
|
268
336
|
- README.md
|
269
337
|
- Rakefile
|
270
|
-
- VERSION
|
271
|
-
- ci/README.md
|
272
|
-
- ci/push.sh
|
273
338
|
- lib/safety_goggles.rb
|
274
339
|
- lib/safety_goggles/handler.rb
|
275
340
|
- lib/safety_goggles/record_not_found_error.rb
|
@@ -279,9 +344,9 @@ files:
|
|
279
344
|
- spec/lib/record_not_found_error_spec.rb
|
280
345
|
- spec/lib/unauthorized_error_spec.rb
|
281
346
|
- spec/spec_helper.rb
|
282
|
-
homepage:
|
347
|
+
homepage: https://github.com/IBM/safety-goggles
|
283
348
|
licenses:
|
284
|
-
-
|
349
|
+
- MIT
|
285
350
|
metadata: {}
|
286
351
|
post_install_message:
|
287
352
|
rdoc_options: []
|
@@ -298,8 +363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
298
363
|
- !ruby/object:Gem::Version
|
299
364
|
version: '0'
|
300
365
|
requirements: []
|
301
|
-
|
302
|
-
rubygems_version: 2.7.6
|
366
|
+
rubygems_version: 3.0.6
|
303
367
|
signing_key:
|
304
368
|
specification_version: 4
|
305
369
|
summary: Rails error handler
|
data/Makefile
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
.PHONY: build clean precommit publish spec
|
2
|
-
|
3
|
-
VERSION:=$(shell cat VERSION)
|
4
|
-
|
5
|
-
build: precommit tag
|
6
|
-
gem build *.gemspec
|
7
|
-
gem install *.gem --ignore-dependencies
|
8
|
-
|
9
|
-
clean:
|
10
|
-
rm *.gem
|
11
|
-
|
12
|
-
publish: build
|
13
|
-
gem inabox *.gem
|
14
|
-
make clean
|
15
|
-
|
16
|
-
precommit:
|
17
|
-
-@gem install geminabox
|
18
|
-
-rubocop -Da
|
19
|
-
-bundle
|
20
|
-
-bundle-audit check --update
|
21
|
-
|
22
|
-
spec:
|
23
|
-
bundle exec rspec
|
24
|
-
|
25
|
-
tag:
|
26
|
-
git tag -f v$(VERSION)
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.1.1
|
data/ci/README.md
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# CI
|
2
|
-
|
3
|
-
|
4
|
-
The following commands were used to configure CI with Travis (one-time setup).
|
5
|
-
|
6
|
-
```shell
|
7
|
-
travis env set ART_URL <...>
|
8
|
-
travis env set ART_USERNAME <...>
|
9
|
-
travis env set ART_API_KEY <...>
|
10
|
-
```
|
11
|
-
|
12
|
-
Note: If your username has an `@`, change it to `%40`
|
13
|
-
|
14
|
-
You can also set these values through the Travis web gui
|
15
|
-
|
16
|
-
The value for `notifications/slack/secure` is obtained by running the following
|
17
|
-
command.
|
18
|
-
|
19
|
-
```sh
|
20
|
-
travis encrypt "<SLACK_TEAM_SUB_DOMAIN>:<SLACK_TOKEN>" --add notifications.slack
|
21
|
-
```
|
data/ci/push.sh
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# Exit immediately if a command exits with a non-zero status.
|
4
|
-
set -e
|
5
|
-
|
6
|
-
echo "Clean the environment"
|
7
|
-
rm -f *.gem
|
8
|
-
|
9
|
-
echo "Building gem"
|
10
|
-
gem build *.gemspec
|
11
|
-
|
12
|
-
# Log into Artifactory
|
13
|
-
echo "Getting repository api key"
|
14
|
-
curl -fsu "${ART_USERNAME:?}:${ART_API_KEY:?}" "${ART_URL:?}/api/v1/api_key.yaml" >> ~/.gem/credentials
|
15
|
-
|
16
|
-
echo "Setting credential permissions"
|
17
|
-
chmod 0600 ~/.gem/credentials
|
18
|
-
|
19
|
-
echo "Publishing gem"
|
20
|
-
gem push *.gem --host "$ART_URL"
|
21
|
-
|
22
|
-
echo "Gem published"
|