castle_devise 0.4.3 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6843034cd0d1278d25140abc645d54dca7b8a3431829c6d7b58920ad987381a6
4
- data.tar.gz: 58f4ae8fb336b3299f96b067210b788f9906efd223965c7c17143a2e2583fad3
3
+ metadata.gz: a64b67ee6cdd64729672a54ec1f17457a03ac36833d00fa52ea3c2c8752a4f7a
4
+ data.tar.gz: 56de964e966c6dd76953fffda7b5121b06883aa79b21dc680aaccd64ba94383a
5
5
  SHA512:
6
- metadata.gz: 0b8f9feca618661708bf6695d3c870c54e4fd4eb747b8ea96031e8a88bcb53c7af7b52b47ce38b92cd44bb85e352b5a9a6bc1aba6a80d4218ecee6dbbe6fdd6c
7
- data.tar.gz: e81f6b014851e78444088a9949746aec347a800c39487ab4cae3c0727c6568b8a2b9691f561c7366be873725ea00f0e62e9d33e2ca919193d3c758da975b116a
6
+ metadata.gz: 55d9047b2d6ecfca23badbd25736afa89acc132f2a6d8267eedd936f69d96c33da85a7f7ee2a7ac9e7a9a69f0e250532229d06fc22eb454a76b2a8c493233233
7
+ data.tar.gz: 695ed027ffff37f150a238897d98d2e68d156871895576e5f40cf287fa983964c0a36f378983e88c995080de95ba64d0f342e0e02b3c8b740a11e99d88f776fc
@@ -1,21 +1,18 @@
1
1
  name: Lint
2
2
 
3
- on: [pull_request]
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
4
7
 
5
8
  jobs:
6
9
  standardrb:
7
- name: runner / standardrb
10
+ name: standardrb
8
11
  runs-on: ubuntu-latest
9
12
  steps:
10
- - name: Check out code
11
- uses: actions/checkout@v1
12
- - name: Give permissions
13
- run: |
14
- sudo chown -R root:root $GITHUB_WORKSPACE
15
- - name: standardrb
16
- uses: SennaLabs/action-standardrb@v0.0.3
13
+ - uses: actions/checkout@v4
14
+ - uses: ruby/setup-ruby@v1
17
15
  with:
18
- github_token: ${{ secrets.github_token }}
19
- reporter: github-pr-review # Default is github-pr-check
20
- rubocop_version: 1.1.6 # note: this actually refers to standardb version, not Rubocop
21
- rubocop_flags: --format progress
16
+ ruby-version: "3.4"
17
+ bundler-cache: true
18
+ - run: bundle exec standardrb --format progress
@@ -10,31 +10,60 @@ jobs:
10
10
  strategy:
11
11
  fail-fast: false
12
12
  matrix:
13
- ruby: ["2.7", "3.0", "3.1", "3.2"]
14
- rails: ["6.0", "6.1", "7.0"]
15
-
13
+ include:
14
+ # Rails 6.0
15
+ - ruby: "3.2"
16
+ rails: "6.0"
17
+ # Rails 6.1
18
+ - ruby: "3.2"
19
+ rails: "6.1"
20
+ # Rails 7.0
21
+ - ruby: "3.2"
22
+ rails: "7.0"
23
+ # Rails 7.1
24
+ - ruby: "3.2"
25
+ rails: "7.1"
26
+ - ruby: "3.3"
27
+ rails: "7.1"
28
+ # Rails 7.2
29
+ - ruby: "3.2"
30
+ rails: "7.2"
31
+ - ruby: "3.3"
32
+ rails: "7.2"
33
+ # Rails 8.0
34
+ - ruby: "3.3"
35
+ rails: "8.0"
36
+ - ruby: "3.4"
37
+ rails: "8.0"
38
+ - ruby: "4.0"
39
+ rails: "8.0"
40
+ # Rails 8.1
41
+ - ruby: "3.3"
42
+ rails: "8.1"
43
+ - ruby: "3.4"
44
+ rails: "8.1"
45
+ - ruby: "4.0"
46
+ rails: "8.1"
16
47
  steps:
17
- - uses: actions/checkout@v2
18
- - name: Set up Ruby ${{ matrix.ruby }}
19
- uses: ruby/setup-ruby@v1
20
- with:
21
- ruby-version: ${{ matrix.ruby }}
22
- - name: Install dependencies
23
- env:
24
- BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
25
- run: |
26
- gem update --system
27
- bundle config path vendor/bundle
28
- bundle install
29
- - name: Run specs
30
- env:
31
- BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
32
- CASTLE_API_SECRET: ${{ secrets.CASTLE_API_SECRET }}
33
- run: |
34
- bundle exec rake
35
- - name: Simplecov Report
36
- if:
37
- ${{ matrix.rails == '6.1' && matrix.ruby >= '3.0' }}
38
- uses: aki77/simplecov-report-action@v1
39
- with:
40
- token: ${{ secrets.GITHUB_TOKEN }}
48
+ - uses: actions/checkout@v4
49
+ - name: Set up Ruby ${{ matrix.ruby }}
50
+ uses: ruby/setup-ruby@v1
51
+ with:
52
+ ruby-version: ${{ matrix.ruby }}
53
+ - name: Install dependencies
54
+ env:
55
+ BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
56
+ run: |
57
+ bundle config path vendor/bundle
58
+ bundle install
59
+ - name: Run specs
60
+ env:
61
+ BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile
62
+ CASTLE_API_SECRET: ${{ secrets.CASTLE_API_SECRET }}
63
+ run: |
64
+ bundle exec rake
65
+ - name: Simplecov Report
66
+ uses: k1LoW/octocov-action@v1
67
+ if: matrix.ruby == '3.4' && matrix.rails == '8.1'
68
+ with:
69
+ github-token: ${{ secrets.GITHUB_TOKEN }}
data/.gitignore CHANGED
@@ -22,3 +22,4 @@ gemfiles/*.lock
22
22
  vendor/
23
23
 
24
24
  spec/dummy_app/log/
25
+ spec/dummy_app/tmp/
data/.octocov.yml ADDED
@@ -0,0 +1,14 @@
1
+ # generated by octocov init
2
+ coverage:
3
+ if: true
4
+ testExecutionTime:
5
+ if: true
6
+ diff:
7
+ datastores:
8
+ - artifact://${GITHUB_REPOSITORY}
9
+ summary:
10
+ if: true
11
+ report:
12
+ if: is_default_branch
13
+ datastores:
14
+ - artifact://${GITHUB_REPOSITORY}
data/.standard.yml ADDED
@@ -0,0 +1,3 @@
1
+ ignore:
2
+ - "gemfiles/vendor/**/*"
3
+ - "vendor/**/*"
data/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
2
2
 
3
3
  ## [Unreleased][main]
4
4
 
5
+ ## [0.6.0] - 2026-05-25
6
+ - Add support for Rails 8.1
7
+ - Add support for Devise 5
8
+ - Allow `castle-rb` 9.x (constraint widened to `>= 7.2, < 10.0`); verified
9
+ against the upcoming 9.0 release — castle_devise uses only the
10
+ `#risk` / `#filter` / `#log` Client APIs and the `Castle::Error` /
11
+ `InvalidParametersError` / `InvalidRequestTokenError` classes, all of
12
+ which remain in 9.0.
13
+ - Bump `castle-rb` to 9.1.0
14
+ - Add Ruby 3.3, 3.4, and 4.0 to the CI matrix
15
+ - Bump minimum required Ruby version to 3.2
16
+ - Replace deprecated `ActiveSupport::Configurable` with plain Ruby attribute accessors (drops the Rails 8.2 deprecation warning)
17
+ - Drop `appraisal` development dependency in favor of hand-maintained `gemfiles/*.gemfile`
18
+ - Bump development Gemfile to Rails 8.1, Devise 5, sqlite3 ~> 2.1, Bundler 2.7.x
19
+
20
+ ## [0.5.0] - 2025-06-17
21
+ - Throw a warning instead of an error for the `$login.failed` event when an exception is raised
22
+ - Security fixes and dependency updates
23
+
5
24
  ## [0.4.3] - 2023-07-11
6
25
  - Fix an issue where we would send a `login.failed` event on any attempt of accessing a protected resource, not only when the user failed to log in specifically
7
26
 
@@ -29,7 +48,9 @@
29
48
 
30
49
  - Initial release
31
50
 
32
- [main]: https://github.com/castle/castle_devise/compare/v0.4.3...HEAD
51
+ [main]: https://github.com/castle/castle_devise/compare/v0.6.0...HEAD
52
+ [0.6.0]: https://github.com/castle/castle_devise/compare/v0.5.0...v0.6.0
53
+ [0.5.0]: https://github.com/castle/castle_devise/compare/v0.4.3...v0.5.0
33
54
  [0.4.3]: https://github.com/castle/castle_devise/compare/v0.4.2...v0.4.3
34
55
  [0.4.2]: https://github.com/castle/castle_devise/compare/v0.4.1...v0.4.2
35
56
  [0.4.1]: https://github.com/castle/castle_devise/compare/v0.4.0...v0.4.1
data/Gemfile CHANGED
@@ -7,13 +7,16 @@ gemspec
7
7
 
8
8
  gem "actionmailer"
9
9
  gem "activerecord"
10
+ # Dev/test: track castle-rb upstream develop. Gemspec uses rubygems.
11
+ gem "castle-rb", github: "castle/castle-ruby", branch: "develop"
10
12
  gem "byebug"
11
- gem "railties", "~> 7.0"
13
+ gem "devise", "~> 5.0"
14
+ gem "railties", "~> 8.1"
12
15
  gem "rake"
13
16
  gem "rspec"
14
17
  gem "rspec-rails"
15
18
  gem "simplecov"
19
+ gem "sqlite3", "~> 2.1"
16
20
  gem "standard"
17
- gem "sqlite3"
18
21
  gem "vcr"
19
22
  gem "webmock"
data/Gemfile.lock CHANGED
@@ -1,238 +1,311 @@
1
+ GIT
2
+ remote: https://github.com/castle/castle-ruby.git
3
+ revision: 66c0523be56f5f24b8a8933dc522b5487bc77fce
4
+ branch: develop
5
+ specs:
6
+ castle-rb (9.1.0)
7
+ base64 (~> 0.2)
8
+
1
9
  PATH
2
10
  remote: .
3
11
  specs:
4
- castle_devise (0.4.3)
5
- activesupport (>= 5.0)
6
- castle-rb (>= 7.2, < 8.0)
7
- devise (>= 4.3.0, < 5.0)
12
+ castle_devise (0.6.0)
13
+ activesupport (>= 6.0)
14
+ castle-rb (>= 7.2, < 10.0)
15
+ devise (>= 4.3.0, < 6.0)
8
16
 
9
17
  GEM
10
18
  remote: https://rubygems.org/
11
19
  specs:
12
- actionmailer (7.0.4.3)
13
- actionpack (= 7.0.4.3)
14
- actionview (= 7.0.4.3)
15
- activejob (= 7.0.4.3)
16
- activesupport (= 7.0.4.3)
17
- mail (~> 2.5, >= 2.5.4)
18
- net-imap
19
- net-pop
20
- net-smtp
21
- rails-dom-testing (~> 2.0)
22
- actionpack (7.0.4.3)
23
- actionview (= 7.0.4.3)
24
- activesupport (= 7.0.4.3)
25
- rack (~> 2.0, >= 2.2.0)
20
+ actionmailer (8.1.3)
21
+ actionpack (= 8.1.3)
22
+ actionview (= 8.1.3)
23
+ activejob (= 8.1.3)
24
+ activesupport (= 8.1.3)
25
+ mail (>= 2.8.0)
26
+ rails-dom-testing (~> 2.2)
27
+ actionpack (8.1.3)
28
+ actionview (= 8.1.3)
29
+ activesupport (= 8.1.3)
30
+ nokogiri (>= 1.8.5)
31
+ rack (>= 2.2.4)
32
+ rack-session (>= 1.0.1)
26
33
  rack-test (>= 0.6.3)
27
- rails-dom-testing (~> 2.0)
28
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
29
- actionview (7.0.4.3)
30
- activesupport (= 7.0.4.3)
34
+ rails-dom-testing (~> 2.2)
35
+ rails-html-sanitizer (~> 1.6)
36
+ useragent (~> 0.16)
37
+ actionview (8.1.3)
38
+ activesupport (= 8.1.3)
31
39
  builder (~> 3.1)
32
- erubi (~> 1.4)
33
- rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
35
- activejob (7.0.4.3)
36
- activesupport (= 7.0.4.3)
40
+ erubi (~> 1.11)
41
+ rails-dom-testing (~> 2.2)
42
+ rails-html-sanitizer (~> 1.6)
43
+ activejob (8.1.3)
44
+ activesupport (= 8.1.3)
37
45
  globalid (>= 0.3.6)
38
- activemodel (7.0.4.3)
39
- activesupport (= 7.0.4.3)
40
- activerecord (7.0.4.3)
41
- activemodel (= 7.0.4.3)
42
- activesupport (= 7.0.4.3)
43
- activesupport (7.0.4.3)
44
- concurrent-ruby (~> 1.0, >= 1.0.2)
46
+ activemodel (8.1.3)
47
+ activesupport (= 8.1.3)
48
+ activerecord (8.1.3)
49
+ activemodel (= 8.1.3)
50
+ activesupport (= 8.1.3)
51
+ timeout (>= 0.4.0)
52
+ activesupport (8.1.3)
53
+ base64
54
+ bigdecimal
55
+ concurrent-ruby (~> 1.0, >= 1.3.1)
56
+ connection_pool (>= 2.2.5)
57
+ drb
45
58
  i18n (>= 1.6, < 2)
59
+ json
60
+ logger (>= 1.4.2)
46
61
  minitest (>= 5.1)
47
- tzinfo (~> 2.0)
48
- addressable (2.8.4)
49
- public_suffix (>= 2.0.2, < 6.0)
50
- appraisal (2.3.0)
51
- bundler
52
- rake
53
- thor (>= 0.14.0)
54
- ast (2.4.2)
55
- bcrypt (3.1.19)
56
- builder (3.2.4)
57
- byebug (11.1.3)
58
- castle-rb (7.2.0)
59
- concurrent-ruby (1.2.2)
60
- crack (0.4.5)
62
+ securerandom (>= 0.3)
63
+ tzinfo (~> 2.0, >= 2.0.5)
64
+ uri (>= 0.13.1)
65
+ addressable (2.9.0)
66
+ public_suffix (>= 2.0.2, < 8.0)
67
+ ast (2.4.3)
68
+ base64 (0.3.0)
69
+ bcrypt (3.1.22)
70
+ bigdecimal (4.1.2)
71
+ builder (3.3.0)
72
+ byebug (13.0.0)
73
+ reline (>= 0.6.0)
74
+ concurrent-ruby (1.3.6)
75
+ connection_pool (3.0.2)
76
+ crack (1.0.1)
77
+ bigdecimal
61
78
  rexml
62
79
  crass (1.0.6)
63
- date (3.3.3)
64
- devise (4.9.2)
80
+ date (3.5.1)
81
+ devise (5.0.4)
65
82
  bcrypt (~> 3.0)
66
83
  orm_adapter (~> 0.1)
67
- railties (>= 4.1.0)
84
+ railties (>= 7.0)
68
85
  responders
69
86
  warden (~> 1.2.3)
70
- diff-lcs (1.5.0)
71
- docile (1.4.0)
72
- erubi (1.12.0)
73
- globalid (1.1.0)
74
- activesupport (>= 5.0)
75
- hashdiff (1.0.1)
76
- i18n (1.13.0)
87
+ diff-lcs (1.6.2)
88
+ docile (1.4.1)
89
+ drb (2.2.3)
90
+ erb (6.0.4)
91
+ erubi (1.13.1)
92
+ globalid (1.3.0)
93
+ activesupport (>= 6.1)
94
+ hashdiff (1.2.1)
95
+ i18n (1.14.8)
77
96
  concurrent-ruby (~> 1.0)
78
- json (2.6.3)
79
- language_server-protocol (3.17.0.3)
80
- lint_roller (1.0.0)
81
- loofah (2.21.3)
97
+ io-console (0.8.2)
98
+ irb (1.18.0)
99
+ pp (>= 0.6.0)
100
+ prism (>= 1.3.0)
101
+ rdoc (>= 4.0.0)
102
+ reline (>= 0.4.2)
103
+ json (2.19.7)
104
+ language_server-protocol (3.17.0.5)
105
+ lint_roller (1.1.0)
106
+ logger (1.7.0)
107
+ loofah (2.25.1)
82
108
  crass (~> 1.0.2)
83
109
  nokogiri (>= 1.12.0)
84
- mail (2.8.1)
110
+ mail (2.9.0)
111
+ logger
85
112
  mini_mime (>= 0.1.1)
86
113
  net-imap
87
114
  net-pop
88
115
  net-smtp
89
- method_source (1.0.0)
90
- mini_mime (1.1.2)
91
- mini_portile2 (2.8.2)
92
- minitest (5.18.0)
93
- net-imap (0.3.4)
116
+ mini_mime (1.1.5)
117
+ minitest (6.0.6)
118
+ drb (~> 2.0)
119
+ prism (~> 1.5)
120
+ net-imap (0.6.4)
94
121
  date
95
122
  net-protocol
96
123
  net-pop (0.1.2)
97
124
  net-protocol
98
- net-protocol (0.2.1)
125
+ net-protocol (0.2.2)
99
126
  timeout
100
- net-smtp (0.3.3)
127
+ net-smtp (0.5.1)
101
128
  net-protocol
102
- nokogiri (1.15.1)
103
- mini_portile2 (~> 2.8.2)
129
+ nokogiri (1.19.3-aarch64-linux-gnu)
130
+ racc (~> 1.4)
131
+ nokogiri (1.19.3-aarch64-linux-musl)
104
132
  racc (~> 1.4)
105
- nokogiri (1.15.1-aarch64-linux)
133
+ nokogiri (1.19.3-arm-linux-gnu)
106
134
  racc (~> 1.4)
107
- nokogiri (1.15.1-arm64-darwin)
135
+ nokogiri (1.19.3-arm-linux-musl)
108
136
  racc (~> 1.4)
109
- nokogiri (1.15.1-x86_64-darwin)
137
+ nokogiri (1.19.3-arm64-darwin)
138
+ racc (~> 1.4)
139
+ nokogiri (1.19.3-x86_64-darwin)
140
+ racc (~> 1.4)
141
+ nokogiri (1.19.3-x86_64-linux-gnu)
142
+ racc (~> 1.4)
143
+ nokogiri (1.19.3-x86_64-linux-musl)
110
144
  racc (~> 1.4)
111
145
  orm_adapter (0.5.0)
112
- parallel (1.23.0)
113
- parser (3.2.2.1)
146
+ parallel (1.28.0)
147
+ parser (3.3.11.1)
114
148
  ast (~> 2.4.1)
115
- public_suffix (5.0.1)
116
- racc (1.6.2)
117
- rack (2.2.7)
118
- rack-test (2.1.0)
149
+ racc
150
+ pp (0.6.3)
151
+ prettyprint
152
+ prettyprint (0.2.0)
153
+ prism (1.9.0)
154
+ psych (5.3.1)
155
+ date
156
+ stringio
157
+ public_suffix (7.0.5)
158
+ racc (1.8.1)
159
+ rack (3.2.6)
160
+ rack-session (2.1.2)
161
+ base64 (>= 0.1.0)
162
+ rack (>= 3.0.0)
163
+ rack-test (2.2.0)
119
164
  rack (>= 1.3)
120
- rails-dom-testing (2.0.3)
121
- activesupport (>= 4.2.0)
165
+ rackup (2.3.1)
166
+ rack (>= 3)
167
+ rails-dom-testing (2.3.0)
168
+ activesupport (>= 5.0.0)
169
+ minitest
122
170
  nokogiri (>= 1.6)
123
- rails-html-sanitizer (1.5.0)
124
- loofah (~> 2.19, >= 2.19.1)
125
- railties (7.0.4.3)
126
- actionpack (= 7.0.4.3)
127
- activesupport (= 7.0.4.3)
128
- method_source
171
+ rails-html-sanitizer (1.7.0)
172
+ loofah (~> 2.25)
173
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
174
+ railties (8.1.3)
175
+ actionpack (= 8.1.3)
176
+ activesupport (= 8.1.3)
177
+ irb (~> 1.13)
178
+ rackup (>= 1.0.0)
129
179
  rake (>= 12.2)
130
- thor (~> 1.0)
131
- zeitwerk (~> 2.5)
180
+ thor (~> 1.0, >= 1.2.2)
181
+ tsort (>= 0.2)
182
+ zeitwerk (~> 2.6)
132
183
  rainbow (3.1.1)
133
- rake (13.0.6)
134
- regexp_parser (2.8.0)
135
- responders (3.1.0)
136
- actionpack (>= 5.2)
137
- railties (>= 5.2)
138
- rexml (3.2.5)
139
- rspec (3.12.0)
140
- rspec-core (~> 3.12.0)
141
- rspec-expectations (~> 3.12.0)
142
- rspec-mocks (~> 3.12.0)
143
- rspec-core (3.12.2)
144
- rspec-support (~> 3.12.0)
145
- rspec-expectations (3.12.3)
184
+ rake (13.4.2)
185
+ rdoc (7.2.0)
186
+ erb
187
+ psych (>= 4.0.0)
188
+ tsort
189
+ regexp_parser (2.12.0)
190
+ reline (0.6.3)
191
+ io-console (~> 0.5)
192
+ responders (3.2.0)
193
+ actionpack (>= 7.0)
194
+ railties (>= 7.0)
195
+ rexml (3.4.4)
196
+ rspec (3.13.2)
197
+ rspec-core (~> 3.13.0)
198
+ rspec-expectations (~> 3.13.0)
199
+ rspec-mocks (~> 3.13.0)
200
+ rspec-core (3.13.6)
201
+ rspec-support (~> 3.13.0)
202
+ rspec-expectations (3.13.5)
146
203
  diff-lcs (>= 1.2.0, < 2.0)
147
- rspec-support (~> 3.12.0)
148
- rspec-mocks (3.12.5)
204
+ rspec-support (~> 3.13.0)
205
+ rspec-mocks (3.13.8)
149
206
  diff-lcs (>= 1.2.0, < 2.0)
150
- rspec-support (~> 3.12.0)
151
- rspec-rails (6.0.2)
152
- actionpack (>= 6.1)
153
- activesupport (>= 6.1)
154
- railties (>= 6.1)
155
- rspec-core (~> 3.12)
156
- rspec-expectations (~> 3.12)
157
- rspec-mocks (~> 3.12)
158
- rspec-support (~> 3.12)
159
- rspec-support (3.12.0)
160
- rubocop (1.50.2)
207
+ rspec-support (~> 3.13.0)
208
+ rspec-rails (8.0.4)
209
+ actionpack (>= 7.2)
210
+ activesupport (>= 7.2)
211
+ railties (>= 7.2)
212
+ rspec-core (>= 3.13.0, < 5.0.0)
213
+ rspec-expectations (>= 3.13.0, < 5.0.0)
214
+ rspec-mocks (>= 3.13.0, < 5.0.0)
215
+ rspec-support (>= 3.13.0, < 5.0.0)
216
+ rspec-support (3.13.7)
217
+ rubocop (1.84.2)
161
218
  json (~> 2.3)
219
+ language_server-protocol (~> 3.17.0.2)
220
+ lint_roller (~> 1.1.0)
162
221
  parallel (~> 1.10)
163
- parser (>= 3.2.0.0)
222
+ parser (>= 3.3.0.2)
164
223
  rainbow (>= 2.2.2, < 4.0)
165
- regexp_parser (>= 1.8, < 3.0)
166
- rexml (>= 3.2.5, < 4.0)
167
- rubocop-ast (>= 1.28.0, < 2.0)
224
+ regexp_parser (>= 2.9.3, < 3.0)
225
+ rubocop-ast (>= 1.49.0, < 2.0)
168
226
  ruby-progressbar (~> 1.7)
169
- unicode-display_width (>= 2.4.0, < 3.0)
170
- rubocop-ast (1.28.1)
171
- parser (>= 3.2.1.0)
172
- rubocop-performance (1.16.0)
173
- rubocop (>= 1.7.0, < 2.0)
174
- rubocop-ast (>= 0.4.0)
227
+ unicode-display_width (>= 2.4.0, < 4.0)
228
+ rubocop-ast (1.49.1)
229
+ parser (>= 3.3.7.2)
230
+ prism (~> 1.7)
231
+ rubocop-performance (1.26.1)
232
+ lint_roller (~> 1.1)
233
+ rubocop (>= 1.75.0, < 2.0)
234
+ rubocop-ast (>= 1.47.1, < 2.0)
175
235
  ruby-progressbar (1.13.0)
236
+ securerandom (0.4.1)
176
237
  simplecov (0.22.0)
177
238
  docile (~> 1.1)
178
239
  simplecov-html (~> 0.11)
179
240
  simplecov_json_formatter (~> 0.1)
180
- simplecov-html (0.12.3)
241
+ simplecov-html (0.13.2)
181
242
  simplecov_json_formatter (0.1.4)
182
- sqlite3 (1.6.3)
183
- mini_portile2 (~> 2.8.0)
184
- sqlite3 (1.6.3-aarch64-linux)
185
- sqlite3 (1.6.3-arm64-darwin)
186
- sqlite3 (1.6.3-x86_64-darwin)
187
- standard (1.28.2)
243
+ sqlite3 (2.9.4-aarch64-linux-gnu)
244
+ sqlite3 (2.9.4-aarch64-linux-musl)
245
+ sqlite3 (2.9.4-arm-linux-gnu)
246
+ sqlite3 (2.9.4-arm-linux-musl)
247
+ sqlite3 (2.9.4-arm64-darwin)
248
+ sqlite3 (2.9.4-x86_64-darwin)
249
+ sqlite3 (2.9.4-x86_64-linux-gnu)
250
+ sqlite3 (2.9.4-x86_64-linux-musl)
251
+ standard (1.54.0)
188
252
  language_server-protocol (~> 3.17.0.2)
189
253
  lint_roller (~> 1.0)
190
- rubocop (~> 1.50.2)
254
+ rubocop (~> 1.84.0)
191
255
  standard-custom (~> 1.0.0)
192
- standard-performance (~> 1.0.1)
193
- standard-custom (1.0.0)
194
- lint_roller (~> 1.0)
195
- standard-performance (1.0.1)
256
+ standard-performance (~> 1.8)
257
+ standard-custom (1.0.2)
196
258
  lint_roller (~> 1.0)
197
- rubocop-performance (~> 1.16.0)
198
- thor (1.2.2)
199
- timeout (0.3.2)
259
+ rubocop (~> 1.50)
260
+ standard-performance (1.9.0)
261
+ lint_roller (~> 1.1)
262
+ rubocop-performance (~> 1.26.0)
263
+ stringio (3.2.0)
264
+ thor (1.5.0)
265
+ timeout (0.6.1)
266
+ tsort (0.2.0)
200
267
  tzinfo (2.0.6)
201
268
  concurrent-ruby (~> 1.0)
202
- unicode-display_width (2.4.2)
203
- vcr (6.1.0)
269
+ unicode-display_width (3.2.0)
270
+ unicode-emoji (~> 4.1)
271
+ unicode-emoji (4.2.0)
272
+ uri (1.1.1)
273
+ useragent (0.16.11)
274
+ vcr (6.4.0)
204
275
  warden (1.2.9)
205
276
  rack (>= 2.0.9)
206
- webmock (3.18.1)
277
+ webmock (3.26.2)
207
278
  addressable (>= 2.8.0)
208
279
  crack (>= 0.3.2)
209
280
  hashdiff (>= 0.4.0, < 2.0.0)
210
- zeitwerk (2.6.8)
281
+ zeitwerk (2.8.2)
211
282
 
212
283
  PLATFORMS
213
- aarch64-linux
214
- arm64-darwin-21
215
- ruby
216
- x86_64-darwin-18
217
- x86_64-darwin-19
218
- x86_64-darwin-20
219
- x86_64-darwin-22
284
+ aarch64-linux-gnu
285
+ aarch64-linux-musl
286
+ arm-linux-gnu
287
+ arm-linux-musl
288
+ arm64-darwin
289
+ x86_64-darwin
290
+ x86_64-linux-gnu
291
+ x86_64-linux-musl
220
292
 
221
293
  DEPENDENCIES
222
294
  actionmailer
223
295
  activerecord
224
- appraisal (~> 2.3.0)
225
296
  byebug
297
+ castle-rb!
226
298
  castle_devise!
227
- railties (~> 7.0)
299
+ devise (~> 5.0)
300
+ railties (~> 8.1)
228
301
  rake
229
302
  rspec
230
303
  rspec-rails
231
304
  simplecov
232
- sqlite3
305
+ sqlite3 (~> 2.1)
233
306
  standard
234
307
  vcr
235
308
  webmock
236
309
 
237
310
  BUNDLED WITH
238
- 2.4.12
311
+ 2.7.2
data/README.md CHANGED
@@ -1,9 +1,5 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/castle_devise.svg)](https://badge.fury.io/rb/castle_devise)
2
2
 
3
- **Disclaimer:** CastleDevise is currently in beta. There might be some upcoming breaking changes to the gem before we stabilize the API.
4
-
5
- ---
6
-
7
3
  # CastleDevise
8
4
 
9
5
  CastleDevise is a [Devise](https://github.com/heartcombo/devise) plugin that integrates [Castle](https://castle.io).
data/bin/console CHANGED
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require "bundler/setup"
5
- require "castle/devise"
5
+ require "castle_devise"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -9,10 +9,10 @@ Gem::Specification.new do |spec|
9
9
  spec.summary = "Integrates Castle with Devise"
10
10
  spec.description = "castle_devise provides out-of-the-box protection against bot registrations and account takeover attacks."
11
11
  spec.homepage = "https://github.com/castle/castle_devise"
12
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
12
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.2.0")
13
13
 
14
- spec.authors = ["Kacper Madej", "Dawid Libiszewski", "Johan Brissmyr"]
15
- spec.email = ["kacper@castle.io"]
14
+ spec.authors = ["Kacper Madej", "Dawid Libiszewski", "Bartosz Knapik", "Johan Brissmyr"]
15
+ spec.email = ["team@castle.io"]
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = "https://github.com/castle/castle_devise"
@@ -27,9 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
29
29
 
30
- spec.add_dependency "activesupport", ">= 5.0"
31
- spec.add_dependency "castle-rb", ">= 7.2", "< 8.0"
32
- spec.add_dependency "devise", ">= 4.3.0", "< 5.0"
33
-
34
- spec.add_development_dependency "appraisal", "~> 2.3.0"
30
+ spec.add_dependency "activesupport", ">= 6.0"
31
+ spec.add_dependency "castle-rb", ">= 7.2", "< 10.0"
32
+ spec.add_dependency "devise", ">= 4.3.0", "< 6.0"
35
33
  end
@@ -1,17 +1,18 @@
1
- # This file was generated by Appraisal
2
-
3
1
  source "https://rubygems.org"
4
2
 
5
3
  gem "actionmailer"
6
4
  gem "activerecord"
7
- gem "railties", "~> 6.0.4"
5
+ gem "byebug"
6
+ gem "railties", "~> 6.0"
8
7
  gem "rake"
9
8
  gem "rspec"
10
9
  gem "rspec-rails"
11
10
  gem "simplecov"
12
11
  gem "standard"
13
- gem "sqlite3"
12
+ gem "sqlite3", "~> 1.7"
14
13
  gem "vcr"
15
14
  gem "webmock"
15
+ gem "mutex_m"
16
+ gem "logger"
16
17
 
17
18
  gemspec path: "../"
@@ -1,17 +1,18 @@
1
- # This file was generated by Appraisal
2
-
3
1
  source "https://rubygems.org"
4
2
 
5
3
  gem "actionmailer"
6
4
  gem "activerecord"
7
- gem "railties", "~> 6.1.4"
5
+ gem "byebug"
6
+ gem "railties", "~> 6.1"
8
7
  gem "rake"
9
8
  gem "rspec"
10
9
  gem "rspec-rails"
11
10
  gem "simplecov"
12
11
  gem "standard"
13
- gem "sqlite3"
12
+ gem "sqlite3", "~> 1.7"
14
13
  gem "vcr"
15
14
  gem "webmock"
15
+ gem "mutex_m"
16
+ gem "logger"
16
17
 
17
18
  gemspec path: "../"
@@ -1,17 +1,18 @@
1
- # This file was generated by Appraisal
2
-
3
1
  source "https://rubygems.org"
4
2
 
5
3
  gem "actionmailer"
6
4
  gem "activerecord"
5
+ gem "byebug"
7
6
  gem "railties", "~> 7.0"
8
7
  gem "rake"
9
8
  gem "rspec"
10
9
  gem "rspec-rails"
11
10
  gem "simplecov"
12
11
  gem "standard"
13
- gem "sqlite3"
12
+ gem "sqlite3", "~> 1.7"
14
13
  gem "vcr"
15
14
  gem "webmock"
15
+ gem "mutex_m"
16
+ gem "logger"
16
17
 
17
18
  gemspec path: "../"
@@ -0,0 +1,18 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "actionmailer"
4
+ gem "activerecord"
5
+ gem "byebug"
6
+ gem "railties", "~> 7.1"
7
+ gem "rake"
8
+ gem "rspec"
9
+ gem "rspec-rails"
10
+ gem "simplecov"
11
+ gem "standard"
12
+ gem "sqlite3", "~> 1.7"
13
+ gem "vcr"
14
+ gem "webmock"
15
+ gem "mutex_m"
16
+ gem "logger"
17
+
18
+ gemspec path: "../"
@@ -0,0 +1,18 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "actionmailer"
4
+ gem "activerecord"
5
+ gem "byebug"
6
+ gem "railties", "~> 7.2"
7
+ gem "rake"
8
+ gem "rspec"
9
+ gem "rspec-rails"
10
+ gem "simplecov"
11
+ gem "standard"
12
+ gem "sqlite3", "~> 1.7"
13
+ gem "vcr"
14
+ gem "webmock"
15
+ gem "mutex_m"
16
+ gem "logger"
17
+
18
+ gemspec path: "../"
@@ -0,0 +1,18 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "actionmailer"
4
+ gem "activerecord"
5
+ gem "byebug"
6
+ gem "railties", "~> 8.0.0"
7
+ gem "rake"
8
+ gem "rspec"
9
+ gem "rspec-rails"
10
+ gem "simplecov"
11
+ gem "standard"
12
+ gem "sqlite3"
13
+ gem "vcr"
14
+ gem "webmock"
15
+ gem "mutex_m"
16
+ gem "logger"
17
+
18
+ gemspec path: "../"
@@ -0,0 +1,17 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "actionmailer"
4
+ gem "activerecord"
5
+ gem "byebug"
6
+ gem "devise", "~> 5.0"
7
+ gem "railties", "~> 8.1.0"
8
+ gem "rake"
9
+ gem "rspec"
10
+ gem "rspec-rails"
11
+ gem "simplecov"
12
+ gem "standard"
13
+ gem "sqlite3"
14
+ gem "vcr"
15
+ gem "webmock"
16
+
17
+ gemspec path: "../"
@@ -1,20 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "active_support/configurable"
4
3
  require "logger"
5
4
 
6
5
  module CastleDevise
7
- # Configuration object using {ActiveSupport::Configurable}
6
+ # Plain Ruby configuration object for CastleDevise.
7
+ #
8
+ # Previously this used +ActiveSupport::Configurable+, which is deprecated
9
+ # and slated for removal in Rails 8.2.
8
10
  class Configuration
9
- include ActiveSupport::Configurable
10
-
11
11
  # @!attribute api_secret
12
12
  # @return [String] Your API secret
13
- config_accessor(:api_secret)
13
+ attr_accessor :api_secret
14
14
 
15
15
  # @!attribute app_id
16
16
  # @return [String] Your Castle App ID
17
- config_accessor(:app_id)
17
+ attr_accessor :app_id
18
18
 
19
19
  # @!attribute monitoring_mode
20
20
  # When CastleDevise is in monitoring mode, it sends requests to Castle
@@ -25,27 +25,41 @@ module CastleDevise
25
25
  # from logging in/registering.
26
26
  #
27
27
  # @return [true, false] whether to act on deny requests or not
28
- config_accessor(:monitoring_mode) { false }
29
-
30
- # @!attribute logger
31
- # @return [Logger] A Logger instance. You might want to use Rails.logger here.
32
- config_accessor(:logger) { Logger.new("/dev/null") }
28
+ attr_accessor :monitoring_mode
33
29
 
34
30
  # @!attribute before_request_hooks
35
31
  # @return [Array<Proc>] Array of procs that will get called before a request to the Castle API
36
- config_accessor(:before_request_hooks) { [] }
32
+ attr_accessor :before_request_hooks
37
33
 
38
34
  # @!attribute after_request_hooks
39
35
  # @return [Array<Proc>] Array of procs that will get called after a request to the Castle API
40
- config_accessor(:after_request_hooks) { [] }
36
+ attr_accessor :after_request_hooks
37
+
38
+ attr_writer :logger, :castle_sdk_facade_class, :castle_client
39
+
40
+ def initialize
41
+ @monitoring_mode = false
42
+ @before_request_hooks = []
43
+ @after_request_hooks = []
44
+ end
45
+
46
+ # @!attribute logger
47
+ # @return [Logger] A Logger instance. You might want to use Rails.logger here.
48
+ def logger
49
+ @logger ||= Logger.new(File::NULL)
50
+ end
41
51
 
42
52
  # @!attribute castle_sdk_facade_class
43
53
  # @return [Class] Castle API implementation
44
- config_accessor(:castle_sdk_facade_class) { ::CastleDevise::SdkFacade }
54
+ def castle_sdk_facade_class
55
+ @castle_sdk_facade_class ||= ::CastleDevise::SdkFacade
56
+ end
45
57
 
46
58
  # @!attribute castle_client
47
- # @return [Class] Castle SDK client
48
- config_accessor(:castle_client) { ::Castle::Client.new }
59
+ # @return [Castle::Client] Castle SDK client
60
+ def castle_client
61
+ @castle_client ||= ::Castle::Client.new
62
+ end
49
63
 
50
64
  # Adds a new before_request hook
51
65
  # @param blk [Proc]
@@ -63,6 +63,6 @@ Warden::Manager.before_failure do |env, opts|
63
63
  context: context
64
64
  )
65
65
  rescue Castle::Error => e
66
- CastleDevise.logger.error("[CastleDevise] filter($login, $failed): #{e}")
66
+ CastleDevise.logger.warn("[CastleDevise] filter($login, $failed): #{e}")
67
67
  end
68
68
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CastleDevise
4
- VERSION = "0.4.3"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: castle_devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kacper Madej
8
8
  - Dawid Libiszewski
9
+ - Bartosz Knapik
9
10
  - Johan Brissmyr
10
- autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2023-07-11 00:00:00.000000000 Z
13
+ date: 1980-01-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: '5.0'
21
+ version: '6.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: '5.0'
28
+ version: '6.0'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: castle-rb
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -35,7 +35,7 @@ dependencies:
35
35
  version: '7.2'
36
36
  - - "<"
37
37
  - !ruby/object:Gem::Version
38
- version: '8.0'
38
+ version: '10.0'
39
39
  type: :runtime
40
40
  prerelease: false
41
41
  version_requirements: !ruby/object:Gem::Requirement
@@ -45,7 +45,7 @@ dependencies:
45
45
  version: '7.2'
46
46
  - - "<"
47
47
  - !ruby/object:Gem::Version
48
- version: '8.0'
48
+ version: '10.0'
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: devise
51
51
  requirement: !ruby/object:Gem::Requirement
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: 4.3.0
56
56
  - - "<"
57
57
  - !ruby/object:Gem::Version
58
- version: '5.0'
58
+ version: '6.0'
59
59
  type: :runtime
60
60
  prerelease: false
61
61
  version_requirements: !ruby/object:Gem::Requirement
@@ -65,25 +65,11 @@ dependencies:
65
65
  version: 4.3.0
66
66
  - - "<"
67
67
  - !ruby/object:Gem::Version
68
- version: '5.0'
69
- - !ruby/object:Gem::Dependency
70
- name: appraisal
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 2.3.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 2.3.0
68
+ version: '6.0'
83
69
  description: castle_devise provides out-of-the-box protection against bot registrations
84
70
  and account takeover attacks.
85
71
  email:
86
- - kacper@castle.io
72
+ - team@castle.io
87
73
  executables: []
88
74
  extensions: []
89
75
  extra_rdoc_files: []
@@ -91,8 +77,9 @@ files:
91
77
  - ".github/workflows/lint.yml"
92
78
  - ".github/workflows/specs.yml"
93
79
  - ".gitignore"
80
+ - ".octocov.yml"
94
81
  - ".rspec"
95
- - Appraisals
82
+ - ".standard.yml"
96
83
  - CHANGELOG.md
97
84
  - Gemfile
98
85
  - Gemfile.lock
@@ -105,6 +92,10 @@ files:
105
92
  - gemfiles/rails_6.0.gemfile
106
93
  - gemfiles/rails_6.1.gemfile
107
94
  - gemfiles/rails_7.0.gemfile
95
+ - gemfiles/rails_7.1.gemfile
96
+ - gemfiles/rails_7.2.gemfile
97
+ - gemfiles/rails_8.0.gemfile
98
+ - gemfiles/rails_8.1.gemfile
108
99
  - lib/castle_devise.rb
109
100
  - lib/castle_devise/configuration.rb
110
101
  - lib/castle_devise/context.rb
@@ -125,7 +116,6 @@ metadata:
125
116
  homepage_uri: https://github.com/castle/castle_devise
126
117
  source_code_uri: https://github.com/castle/castle_devise
127
118
  changelog_uri: https://github.com/castle/castle_devise/CHANGELOG.md
128
- post_install_message:
129
119
  rdoc_options: []
130
120
  require_paths:
131
121
  - lib
@@ -133,15 +123,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
123
  requirements:
134
124
  - - ">="
135
125
  - !ruby/object:Gem::Version
136
- version: 2.5.0
126
+ version: 3.2.0
137
127
  required_rubygems_version: !ruby/object:Gem::Requirement
138
128
  requirements:
139
129
  - - ">="
140
130
  - !ruby/object:Gem::Version
141
131
  version: '0'
142
132
  requirements: []
143
- rubygems_version: 3.3.3
144
- signing_key:
133
+ rubygems_version: 4.0.8
145
134
  specification_version: 4
146
135
  summary: Integrates Castle with Devise
147
136
  test_files: []
data/Appraisals DELETED
@@ -1,11 +0,0 @@
1
- appraise "rails-6.0" do
2
- gem "railties", "~> 6.0.4"
3
- end
4
-
5
- appraise "rails-6.1" do
6
- gem "railties", "~> 6.1.4"
7
- end
8
-
9
- appraise "rails-7.0" do
10
- gem "railties", "~> 7.0"
11
- end