castle_devise 0.4.3 → 0.7.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 +4 -4
- data/.github/workflows/lint.yml +10 -13
- data/.github/workflows/specs.yml +55 -27
- data/.gitignore +1 -0
- data/.octocov.yml +14 -0
- data/.standard.yml +3 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +32 -1
- data/Gemfile +5 -2
- data/Gemfile.lock +232 -164
- data/README.md +16 -28
- data/bin/console +1 -1
- data/castle_devise.gemspec +6 -8
- data/gemfiles/rails_6.0.gemfile +5 -4
- data/gemfiles/rails_6.1.gemfile +5 -4
- data/gemfiles/rails_7.0.gemfile +4 -3
- data/gemfiles/rails_7.1.gemfile +18 -0
- data/gemfiles/rails_7.2.gemfile +18 -0
- data/gemfiles/rails_8.0.gemfile +18 -0
- data/gemfiles/rails_8.1.gemfile +17 -0
- data/lib/castle_devise/configuration.rb +32 -18
- data/lib/castle_devise/helpers/castle_devise.js +48 -0
- data/lib/castle_devise/helpers/castle_helper.rb +33 -13
- data/lib/castle_devise/hooks/castle_protectable.rb +1 -1
- data/lib/castle_devise/version.rb +1 -1
- data/mise.toml +11 -0
- metadata +21 -29
- data/Appraisals +0 -11
data/Gemfile.lock
CHANGED
|
@@ -1,238 +1,306 @@
|
|
|
1
|
+
GIT
|
|
2
|
+
remote: https://github.com/castle/castle-ruby.git
|
|
3
|
+
revision: 09f37c6d68754c229ade675513c4abe473d69ad2
|
|
4
|
+
branch: develop
|
|
5
|
+
specs:
|
|
6
|
+
castle-rb (9.3.0)
|
|
7
|
+
base64 (~> 0.2)
|
|
8
|
+
|
|
1
9
|
PATH
|
|
2
10
|
remote: .
|
|
3
11
|
specs:
|
|
4
|
-
castle_devise (0.
|
|
5
|
-
activesupport (>=
|
|
6
|
-
castle-rb (>= 7.2, <
|
|
7
|
-
devise (>= 4.3.0, <
|
|
12
|
+
castle_devise (0.7.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 (
|
|
13
|
-
actionpack (=
|
|
14
|
-
actionview (=
|
|
15
|
-
activejob (=
|
|
16
|
-
activesupport (=
|
|
17
|
-
mail (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
rack (~> 2.0, >= 2.2.0)
|
|
20
|
+
actionmailer (8.1.3.1)
|
|
21
|
+
actionpack (= 8.1.3.1)
|
|
22
|
+
actionview (= 8.1.3.1)
|
|
23
|
+
activejob (= 8.1.3.1)
|
|
24
|
+
activesupport (= 8.1.3.1)
|
|
25
|
+
mail (>= 2.8.0)
|
|
26
|
+
rails-dom-testing (~> 2.2)
|
|
27
|
+
actionpack (8.1.3.1)
|
|
28
|
+
actionview (= 8.1.3.1)
|
|
29
|
+
activesupport (= 8.1.3.1)
|
|
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.
|
|
28
|
-
rails-html-sanitizer (~> 1.
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
rails-dom-testing (~> 2.2)
|
|
35
|
+
rails-html-sanitizer (~> 1.6)
|
|
36
|
+
useragent (~> 0.16)
|
|
37
|
+
actionview (8.1.3.1)
|
|
38
|
+
activesupport (= 8.1.3.1)
|
|
31
39
|
builder (~> 3.1)
|
|
32
|
-
erubi (~> 1.
|
|
33
|
-
rails-dom-testing (~> 2.
|
|
34
|
-
rails-html-sanitizer (~> 1.
|
|
35
|
-
activejob (
|
|
36
|
-
activesupport (=
|
|
40
|
+
erubi (~> 1.11)
|
|
41
|
+
rails-dom-testing (~> 2.2)
|
|
42
|
+
rails-html-sanitizer (~> 1.6)
|
|
43
|
+
activejob (8.1.3.1)
|
|
44
|
+
activesupport (= 8.1.3.1)
|
|
37
45
|
globalid (>= 0.3.6)
|
|
38
|
-
activemodel (
|
|
39
|
-
activesupport (=
|
|
40
|
-
activerecord (
|
|
41
|
-
activemodel (=
|
|
42
|
-
activesupport (=
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
activemodel (8.1.3.1)
|
|
47
|
+
activesupport (= 8.1.3.1)
|
|
48
|
+
activerecord (8.1.3.1)
|
|
49
|
+
activemodel (= 8.1.3.1)
|
|
50
|
+
activesupport (= 8.1.3.1)
|
|
51
|
+
timeout (>= 0.4.0)
|
|
52
|
+
activesupport (8.1.3.1)
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
builder (3.
|
|
57
|
-
byebug (
|
|
58
|
-
|
|
59
|
-
concurrent-ruby (1.
|
|
60
|
-
|
|
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.8)
|
|
75
|
+
connection_pool (3.0.2)
|
|
76
|
+
crack (1.0.1)
|
|
77
|
+
bigdecimal
|
|
61
78
|
rexml
|
|
62
|
-
crass (1.0.
|
|
63
|
-
date (3.
|
|
64
|
-
devise (
|
|
79
|
+
crass (1.0.7)
|
|
80
|
+
date (3.5.1)
|
|
81
|
+
devise (5.0.4)
|
|
65
82
|
bcrypt (~> 3.0)
|
|
66
83
|
orm_adapter (~> 0.1)
|
|
67
|
-
railties (>=
|
|
84
|
+
railties (>= 7.0)
|
|
68
85
|
responders
|
|
69
86
|
warden (~> 1.2.3)
|
|
70
|
-
diff-lcs (1.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
87
|
+
diff-lcs (1.6.2)
|
|
88
|
+
drb (2.2.3)
|
|
89
|
+
erb (6.0.7)
|
|
90
|
+
erubi (1.13.1)
|
|
91
|
+
globalid (1.4.0)
|
|
92
|
+
activesupport (>= 6.1)
|
|
93
|
+
hashdiff (1.2.1)
|
|
94
|
+
i18n (1.15.2)
|
|
77
95
|
concurrent-ruby (~> 1.0)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
96
|
+
io-console (0.9.2)
|
|
97
|
+
irb (1.18.0)
|
|
98
|
+
pp (>= 0.6.0)
|
|
99
|
+
prism (>= 1.3.0)
|
|
100
|
+
rdoc (>= 4.0.0)
|
|
101
|
+
reline (>= 0.4.2)
|
|
102
|
+
json (2.21.2)
|
|
103
|
+
language_server-protocol (3.17.0.6)
|
|
104
|
+
lint_roller (1.1.0)
|
|
105
|
+
logger (1.7.0)
|
|
106
|
+
loofah (2.25.2)
|
|
82
107
|
crass (~> 1.0.2)
|
|
83
108
|
nokogiri (>= 1.12.0)
|
|
84
|
-
mail (2.
|
|
109
|
+
mail (2.9.1)
|
|
110
|
+
logger
|
|
85
111
|
mini_mime (>= 0.1.1)
|
|
86
112
|
net-imap
|
|
87
113
|
net-pop
|
|
88
114
|
net-smtp
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
net-imap (0.
|
|
115
|
+
mini_mime (1.1.5)
|
|
116
|
+
minitest (6.0.6)
|
|
117
|
+
drb (~> 2.0)
|
|
118
|
+
prism (~> 1.5)
|
|
119
|
+
net-imap (0.6.6)
|
|
94
120
|
date
|
|
95
121
|
net-protocol
|
|
96
122
|
net-pop (0.1.2)
|
|
97
123
|
net-protocol
|
|
98
|
-
net-protocol (0.
|
|
124
|
+
net-protocol (0.3.0)
|
|
99
125
|
timeout
|
|
100
|
-
net-smtp (0.
|
|
126
|
+
net-smtp (0.5.1)
|
|
101
127
|
net-protocol
|
|
102
|
-
nokogiri (1.
|
|
103
|
-
|
|
128
|
+
nokogiri (1.19.4-aarch64-linux-gnu)
|
|
129
|
+
racc (~> 1.4)
|
|
130
|
+
nokogiri (1.19.4-aarch64-linux-musl)
|
|
104
131
|
racc (~> 1.4)
|
|
105
|
-
nokogiri (1.
|
|
132
|
+
nokogiri (1.19.4-arm-linux-gnu)
|
|
106
133
|
racc (~> 1.4)
|
|
107
|
-
nokogiri (1.
|
|
134
|
+
nokogiri (1.19.4-arm-linux-musl)
|
|
108
135
|
racc (~> 1.4)
|
|
109
|
-
nokogiri (1.
|
|
136
|
+
nokogiri (1.19.4-arm64-darwin)
|
|
137
|
+
racc (~> 1.4)
|
|
138
|
+
nokogiri (1.19.4-x86_64-darwin)
|
|
139
|
+
racc (~> 1.4)
|
|
140
|
+
nokogiri (1.19.4-x86_64-linux-gnu)
|
|
141
|
+
racc (~> 1.4)
|
|
142
|
+
nokogiri (1.19.4-x86_64-linux-musl)
|
|
110
143
|
racc (~> 1.4)
|
|
111
144
|
orm_adapter (0.5.0)
|
|
112
|
-
parallel (
|
|
113
|
-
parser (3.
|
|
145
|
+
parallel (2.2.0)
|
|
146
|
+
parser (3.3.12.0)
|
|
114
147
|
ast (~> 2.4.1)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
148
|
+
racc
|
|
149
|
+
pp (0.6.4)
|
|
150
|
+
prettyprint
|
|
151
|
+
prettyprint (0.2.0)
|
|
152
|
+
prism (1.9.0)
|
|
153
|
+
public_suffix (7.0.5)
|
|
154
|
+
racc (1.8.1)
|
|
155
|
+
rack (3.2.7)
|
|
156
|
+
rack-session (2.1.2)
|
|
157
|
+
base64 (>= 0.1.0)
|
|
158
|
+
rack (>= 3.0.0)
|
|
159
|
+
rack-test (2.2.0)
|
|
119
160
|
rack (>= 1.3)
|
|
120
|
-
|
|
121
|
-
|
|
161
|
+
rackup (2.3.1)
|
|
162
|
+
rack (>= 3)
|
|
163
|
+
rails-dom-testing (2.3.0)
|
|
164
|
+
activesupport (>= 5.0.0)
|
|
165
|
+
minitest
|
|
122
166
|
nokogiri (>= 1.6)
|
|
123
|
-
rails-html-sanitizer (1.
|
|
124
|
-
loofah (~> 2.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
167
|
+
rails-html-sanitizer (1.7.1)
|
|
168
|
+
loofah (~> 2.25, >= 2.25.2)
|
|
169
|
+
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)
|
|
170
|
+
railties (8.1.3.1)
|
|
171
|
+
actionpack (= 8.1.3.1)
|
|
172
|
+
activesupport (= 8.1.3.1)
|
|
173
|
+
irb (~> 1.13)
|
|
174
|
+
rackup (>= 1.0.0)
|
|
129
175
|
rake (>= 12.2)
|
|
130
|
-
thor (~> 1.0)
|
|
131
|
-
|
|
176
|
+
thor (~> 1.0, >= 1.2.2)
|
|
177
|
+
tsort (>= 0.2)
|
|
178
|
+
zeitwerk (~> 2.6)
|
|
132
179
|
rainbow (3.1.1)
|
|
133
|
-
rake (13.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
180
|
+
rake (13.4.2)
|
|
181
|
+
rbs (4.2.0)
|
|
182
|
+
logger
|
|
183
|
+
prism (>= 1.6.0)
|
|
184
|
+
tsort
|
|
185
|
+
rdoc (8.0.0)
|
|
186
|
+
erb
|
|
187
|
+
prism (>= 1.6.0)
|
|
188
|
+
rbs (>= 4.0.0)
|
|
189
|
+
tsort
|
|
190
|
+
regexp_parser (2.12.0)
|
|
191
|
+
reline (0.7.0)
|
|
192
|
+
io-console (~> 0.5)
|
|
193
|
+
responders (3.2.1)
|
|
194
|
+
actionpack (>= 7.0)
|
|
195
|
+
railties (>= 7.0)
|
|
196
|
+
rexml (3.4.4)
|
|
197
|
+
rspec (3.13.2)
|
|
198
|
+
rspec-core (~> 3.13.0)
|
|
199
|
+
rspec-expectations (~> 3.13.0)
|
|
200
|
+
rspec-mocks (~> 3.13.0)
|
|
201
|
+
rspec-core (3.13.6)
|
|
202
|
+
rspec-support (~> 3.13.0)
|
|
203
|
+
rspec-expectations (3.13.5)
|
|
146
204
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
147
|
-
rspec-support (~> 3.
|
|
148
|
-
rspec-mocks (3.
|
|
205
|
+
rspec-support (~> 3.13.0)
|
|
206
|
+
rspec-mocks (3.13.8)
|
|
149
207
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
150
|
-
rspec-support (~> 3.
|
|
151
|
-
rspec-rails (
|
|
152
|
-
actionpack (>=
|
|
153
|
-
activesupport (>=
|
|
154
|
-
railties (>=
|
|
155
|
-
rspec-core (
|
|
156
|
-
rspec-expectations (
|
|
157
|
-
rspec-mocks (
|
|
158
|
-
rspec-support (
|
|
159
|
-
rspec-support (3.
|
|
160
|
-
rubocop (1.
|
|
208
|
+
rspec-support (~> 3.13.0)
|
|
209
|
+
rspec-rails (8.0.4)
|
|
210
|
+
actionpack (>= 7.2)
|
|
211
|
+
activesupport (>= 7.2)
|
|
212
|
+
railties (>= 7.2)
|
|
213
|
+
rspec-core (>= 3.13.0, < 5.0.0)
|
|
214
|
+
rspec-expectations (>= 3.13.0, < 5.0.0)
|
|
215
|
+
rspec-mocks (>= 3.13.0, < 5.0.0)
|
|
216
|
+
rspec-support (>= 3.13.0, < 5.0.0)
|
|
217
|
+
rspec-support (3.13.7)
|
|
218
|
+
rubocop (1.88.2)
|
|
161
219
|
json (~> 2.3)
|
|
162
|
-
|
|
163
|
-
|
|
220
|
+
language_server-protocol (~> 3.17.0.2)
|
|
221
|
+
lint_roller (~> 1.1.0)
|
|
222
|
+
parallel (>= 1.10)
|
|
223
|
+
parser (>= 3.3.0.2)
|
|
164
224
|
rainbow (>= 2.2.2, < 4.0)
|
|
165
|
-
regexp_parser (>=
|
|
166
|
-
|
|
167
|
-
rubocop-ast (>= 1.28.0, < 2.0)
|
|
225
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
226
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
168
227
|
ruby-progressbar (~> 1.7)
|
|
169
|
-
unicode-display_width (>= 2.4.0, <
|
|
170
|
-
rubocop-ast (1.
|
|
171
|
-
parser (>= 3.
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
228
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
229
|
+
rubocop-ast (1.50.0)
|
|
230
|
+
parser (>= 3.3.7.2)
|
|
231
|
+
prism (~> 1.7)
|
|
232
|
+
rubocop-performance (1.26.1)
|
|
233
|
+
lint_roller (~> 1.1)
|
|
234
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
235
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
175
236
|
ruby-progressbar (1.13.0)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
sqlite3 (
|
|
183
|
-
|
|
184
|
-
sqlite3 (
|
|
185
|
-
sqlite3 (
|
|
186
|
-
|
|
187
|
-
standard (1.28.2)
|
|
237
|
+
securerandom (0.4.1)
|
|
238
|
+
simplecov (1.2.0)
|
|
239
|
+
sqlite3 (2.9.6-aarch64-linux-gnu)
|
|
240
|
+
sqlite3 (2.9.6-aarch64-linux-musl)
|
|
241
|
+
sqlite3 (2.9.6-arm-linux-gnu)
|
|
242
|
+
sqlite3 (2.9.6-arm-linux-musl)
|
|
243
|
+
sqlite3 (2.9.6-arm64-darwin)
|
|
244
|
+
sqlite3 (2.9.6-x86_64-darwin)
|
|
245
|
+
sqlite3 (2.9.6-x86_64-linux-gnu)
|
|
246
|
+
sqlite3 (2.9.6-x86_64-linux-musl)
|
|
247
|
+
standard (1.56.0)
|
|
188
248
|
language_server-protocol (~> 3.17.0.2)
|
|
189
249
|
lint_roller (~> 1.0)
|
|
190
|
-
rubocop (~> 1.
|
|
250
|
+
rubocop (~> 1.88.0)
|
|
191
251
|
standard-custom (~> 1.0.0)
|
|
192
|
-
standard-performance (~> 1.
|
|
193
|
-
standard-custom (1.0.
|
|
194
|
-
lint_roller (~> 1.0)
|
|
195
|
-
standard-performance (1.0.1)
|
|
252
|
+
standard-performance (~> 1.8)
|
|
253
|
+
standard-custom (1.0.2)
|
|
196
254
|
lint_roller (~> 1.0)
|
|
197
|
-
rubocop
|
|
198
|
-
|
|
199
|
-
|
|
255
|
+
rubocop (~> 1.50)
|
|
256
|
+
standard-performance (1.9.0)
|
|
257
|
+
lint_roller (~> 1.1)
|
|
258
|
+
rubocop-performance (~> 1.26.0)
|
|
259
|
+
thor (1.5.0)
|
|
260
|
+
timeout (0.6.1)
|
|
261
|
+
tsort (0.2.0)
|
|
200
262
|
tzinfo (2.0.6)
|
|
201
263
|
concurrent-ruby (~> 1.0)
|
|
202
|
-
unicode-display_width (2.
|
|
203
|
-
|
|
264
|
+
unicode-display_width (3.2.0)
|
|
265
|
+
unicode-emoji (~> 4.1)
|
|
266
|
+
unicode-emoji (4.2.0)
|
|
267
|
+
uri (1.1.1)
|
|
268
|
+
useragent (0.16.11)
|
|
269
|
+
vcr (6.4.0)
|
|
204
270
|
warden (1.2.9)
|
|
205
271
|
rack (>= 2.0.9)
|
|
206
|
-
webmock (3.
|
|
272
|
+
webmock (3.26.4)
|
|
207
273
|
addressable (>= 2.8.0)
|
|
208
274
|
crack (>= 0.3.2)
|
|
209
275
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
210
|
-
zeitwerk (2.
|
|
276
|
+
zeitwerk (2.8.3)
|
|
211
277
|
|
|
212
278
|
PLATFORMS
|
|
213
|
-
aarch64-linux
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
x86_64-darwin
|
|
219
|
-
x86_64-
|
|
279
|
+
aarch64-linux-gnu
|
|
280
|
+
aarch64-linux-musl
|
|
281
|
+
arm-linux-gnu
|
|
282
|
+
arm-linux-musl
|
|
283
|
+
arm64-darwin
|
|
284
|
+
x86_64-darwin
|
|
285
|
+
x86_64-linux-gnu
|
|
286
|
+
x86_64-linux-musl
|
|
220
287
|
|
|
221
288
|
DEPENDENCIES
|
|
222
289
|
actionmailer
|
|
223
290
|
activerecord
|
|
224
|
-
appraisal (~> 2.3.0)
|
|
225
291
|
byebug
|
|
292
|
+
castle-rb!
|
|
226
293
|
castle_devise!
|
|
227
|
-
|
|
294
|
+
devise (~> 5.0)
|
|
295
|
+
railties (~> 8.1)
|
|
228
296
|
rake
|
|
229
297
|
rspec
|
|
230
298
|
rspec-rails
|
|
231
299
|
simplecov
|
|
232
|
-
sqlite3
|
|
300
|
+
sqlite3 (~> 2.1)
|
|
233
301
|
standard
|
|
234
302
|
vcr
|
|
235
303
|
webmock
|
|
236
304
|
|
|
237
305
|
BUNDLED WITH
|
|
238
|
-
2.
|
|
306
|
+
2.7.2
|
data/README.md
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
[](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).
|
|
@@ -24,12 +20,12 @@ Include `castle_devise` in your Gemfile:
|
|
|
24
20
|
gem 'castle_devise'
|
|
25
21
|
```
|
|
26
22
|
|
|
27
|
-
Create `config/initializers/castle_devise.rb` and fill in your API secret and
|
|
23
|
+
Create `config/initializers/castle_devise.rb` and fill in your API secret and publishable key from the [Castle Dashboard](https://dashboard.castle.io/settings/general)
|
|
28
24
|
|
|
29
25
|
```ruby
|
|
30
26
|
CastleDevise.configure do |config|
|
|
31
27
|
config.api_secret = ENV.fetch('CASTLE_API_SECRET')
|
|
32
|
-
config.
|
|
28
|
+
config.publishable_key = ENV.fetch('CASTLE_PK')
|
|
33
29
|
|
|
34
30
|
# When monitoring mode is enabled, CastleDevise sends
|
|
35
31
|
# requests to Castle but it doesn't act on the "deny" verdicts.
|
|
@@ -64,14 +60,20 @@ en:
|
|
|
64
60
|
|
|
65
61
|
(See [devise.en.yml in our specs](spec/dummy_app/config/locales/devise.en.yml#L40))
|
|
66
62
|
|
|
67
|
-
####
|
|
63
|
+
#### Browser SDK
|
|
68
64
|
|
|
69
|
-
|
|
65
|
+
Install [`@castleio/castle-js`](https://docs.castle.io/docs/sdk-browser) and serve the npm `dist` directory at `/vendor/castle-js` (keep `castle.umd.js` and the worker files together):
|
|
70
66
|
|
|
71
67
|
```ruby
|
|
72
68
|
<%= castle_javascript_tag %>
|
|
73
69
|
```
|
|
74
70
|
|
|
71
|
+
That loads `/vendor/castle-js/castle.umd.js` and seeds `window.Castle` before the script runs (3.x UMD is named `@castleio/castle-js`). Pass `src:` for a different UMD URL:
|
|
72
|
+
|
|
73
|
+
```ruby
|
|
74
|
+
<%= castle_javascript_tag(src: "/assets/castle.umd.js") %>
|
|
75
|
+
```
|
|
76
|
+
|
|
75
77
|
Add the following tag to the the `<form>` tag in both `devise/registrations/new.html.erb` and `devise/sessions/new.html.erb` (if you haven't generated them yet, run `rails generate devise:views`):
|
|
76
78
|
|
|
77
79
|
```ruby
|
|
@@ -80,26 +82,9 @@ Add the following tag to the the `<form>` tag in both `devise/registrations/new.
|
|
|
80
82
|
<% end %>
|
|
81
83
|
```
|
|
82
84
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
#### Further steps if you're using Webpacker
|
|
87
|
-
|
|
88
|
-
Add `@castleio/castle-js` to your package.json file:
|
|
85
|
+
`castle_on_form_submit` uses 2.x `injectTokenOnSubmit` when present, and 2.x/3.x `createRequestToken` otherwise.
|
|
89
86
|
|
|
90
|
-
|
|
91
|
-
yarn add @castleio/castle-js
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
configure castle in your application pack:
|
|
95
|
-
|
|
96
|
-
```javascript
|
|
97
|
-
import * as Castle from '@castleio/castle-js'
|
|
98
|
-
|
|
99
|
-
Castle.configure(YOUR_APPLICATION_ID);
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
for advanced configuration follow [the readme](https://www.npmjs.com/package/@castleio/castle-js#configuration)
|
|
87
|
+
You're set! Now verify that everything works by logging in to your application as any user. You should be able to see that User on the [Castle Users Page](https://dashboard.castle.io/users)
|
|
103
88
|
|
|
104
89
|
## How-Tos
|
|
105
90
|
|
|
@@ -217,6 +202,7 @@ end
|
|
|
217
202
|
### Setup
|
|
218
203
|
|
|
219
204
|
```bash
|
|
205
|
+
mise install
|
|
220
206
|
bundle install
|
|
221
207
|
```
|
|
222
208
|
|
|
@@ -225,9 +211,11 @@ bundle install
|
|
|
225
211
|
Most of the specs should pass just by running the following command:
|
|
226
212
|
|
|
227
213
|
```bash
|
|
228
|
-
|
|
214
|
+
mise run test
|
|
229
215
|
```
|
|
230
216
|
|
|
217
|
+
or `bundle exec rake`.
|
|
218
|
+
|
|
231
219
|
We also have a few VCR tests that will periodically rebuild the cassettes just to make sure that the integration with Castle API is working.
|
|
232
220
|
For those, you need to run your specs with a proper Castle API Secret:
|
|
233
221
|
|
data/bin/console
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
4
|
require "bundler/setup"
|
|
5
|
-
require "
|
|
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.
|
data/castle_devise.gemspec
CHANGED
|
@@ -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.
|
|
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 = ["
|
|
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", ">=
|
|
31
|
-
spec.add_dependency "castle-rb", ">= 7.2", "<
|
|
32
|
-
spec.add_dependency "devise", ">= 4.3.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
|
data/gemfiles/rails_6.0.gemfile
CHANGED
|
@@ -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 "
|
|
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: "../"
|
data/gemfiles/rails_6.1.gemfile
CHANGED
|
@@ -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 "
|
|
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: "../"
|