Skip to content

Commit 3dc3860

Browse files
committed
removing omniauth CSRF validation, not neccessary since we validate using JWT
1 parent 77307f6 commit 3dc3860

4 files changed

Lines changed: 42 additions & 60 deletions

File tree

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ gem 'jwt', '~> 2.4'
1414
gem 'mutex_m'
1515
gem 'omniauth', '~> 2.1'
1616
gem 'omniauth-cas', '~> 3.0'
17-
gem 'omniauth-rails_csrf_protection', '~> 1.0'
1817
gem 'pg', '~> 1.4'
1918
gem 'pg_search', '~> 2.3'
2019
gem 'puma', '~> 7.2'

Gemfile.lock

Lines changed: 37 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ GEM
7272
securerandom (>= 0.3)
7373
tzinfo (~> 2.0, >= 2.0.5)
7474
uri (>= 0.13.1)
75-
addressable (2.8.9)
75+
addressable (2.9.0)
7676
public_suffix (>= 2.0.2, < 8.0)
7777
amazing_print (1.8.1)
7878
ast (2.4.3)
@@ -97,19 +97,19 @@ GEM
9797
berkeley_library-logging (~> 0.3)
9898
rest-client (~> 2.1)
9999
typesafe_enum (~> 0.3)
100-
bigdecimal (4.1.0)
101-
brakeman (7.1.0)
100+
bigdecimal (4.1.2)
101+
brakeman (8.0.4)
102102
racc
103103
builder (3.3.0)
104-
bundle-audit (0.1.0)
104+
bundle-audit (0.2.0)
105105
bundler-audit
106106
bundler-audit (0.9.3)
107107
bundler (>= 1.2.0)
108108
thor (~> 1.0)
109109
colorize (1.1.0)
110110
concurrent-ruby (1.3.6)
111111
connection_pool (3.0.2)
112-
crack (1.0.0)
112+
crack (1.0.1)
113113
bigdecimal
114114
rexml
115115
crass (1.0.6)
@@ -122,37 +122,34 @@ GEM
122122
docile (1.4.1)
123123
domain_name (0.6.20240107)
124124
drb (2.2.3)
125-
erb (6.0.2)
125+
erb (6.0.4)
126126
erubi (1.13.1)
127-
factory_bot (6.5.5)
127+
factory_bot (6.6.0)
128128
activesupport (>= 6.1.0)
129-
factory_bot_rails (6.5.0)
129+
factory_bot_rails (6.5.1)
130130
factory_bot (~> 6.5)
131131
railties (>= 6.1.0)
132-
ffi (1.17.2)
133-
ffi (1.17.2-aarch64-linux-gnu)
134-
ffi (1.17.2-arm64-darwin)
135-
ffi (1.17.2-x86_64-linux-gnu)
132+
ffi (1.17.4-aarch64-linux-gnu)
136133
globalid (1.3.0)
137134
activesupport (>= 6.1)
138135
hashdiff (1.0.1)
139136
hashie (5.1.0)
140137
logger
141138
http-accept (1.7.0)
142-
http-cookie (1.1.0)
139+
http-cookie (1.1.6)
143140
domain_name (~> 0.5)
144141
i18n (1.14.8)
145142
concurrent-ruby (~> 1.0)
146143
image_processing (1.14.0)
147144
mini_magick (>= 4.9.5, < 6)
148145
ruby-vips (>= 2.0.17, < 3)
149146
io-console (0.8.2)
150-
irb (1.17.0)
147+
irb (1.18.0)
151148
pp (>= 0.6.0)
152149
prism (>= 1.3.0)
153150
rdoc (>= 4.0.0)
154151
reline (>= 0.4.2)
155-
json (2.19.2)
152+
json (2.19.5)
156153
jsonapi-serializer (2.2.0)
157154
activesupport (>= 4.2)
158155
jsonapi.rb (2.1.1)
@@ -177,23 +174,22 @@ GEM
177174
net-imap
178175
net-pop
179176
net-smtp
180-
marc (1.3.0)
177+
marc (1.4.0)
181178
nokogiri (~> 1.0)
182179
rexml
183180
marcel (1.1.0)
184181
mime-types (3.7.0)
185182
logger
186183
mime-types-data (~> 3.2025, >= 3.2025.0507)
187-
mime-types-data (3.2026.0317)
184+
mime-types-data (3.2026.0414)
188185
mini_magick (5.3.1)
189186
logger
190187
mini_mime (1.1.5)
191-
mini_portile2 (2.8.9)
192-
minitest (6.0.2)
188+
minitest (6.0.6)
193189
drb (~> 2.0)
194190
prism (~> 1.5)
195191
mutex_m (0.3.0)
196-
net-imap (0.6.3)
192+
net-imap (0.6.4)
197193
date
198194
net-protocol
199195
net-pop (0.1.2)
@@ -204,16 +200,9 @@ GEM
204200
net-protocol
205201
netrc (0.11.0)
206202
nio4r (2.7.5)
207-
nokogiri (1.19.2)
208-
mini_portile2 (~> 2.8.2)
203+
nokogiri (1.19.3-aarch64-linux-gnu)
209204
racc (~> 1.4)
210-
nokogiri (1.19.2-aarch64-linux-gnu)
211-
racc (~> 1.4)
212-
nokogiri (1.19.2-arm64-darwin)
213-
racc (~> 1.4)
214-
nokogiri (1.19.2-x86_64-linux-gnu)
215-
racc (~> 1.4)
216-
oj (3.16.16)
205+
oj (3.17.0)
217206
bigdecimal (>= 3.0)
218207
ostruct (>= 0.2)
219208
omniauth (2.1.4)
@@ -225,21 +214,15 @@ GEM
225214
addressable (~> 2.8)
226215
nokogiri (~> 1.12)
227216
omniauth (~> 2.1)
228-
omniauth-rails_csrf_protection (1.0.2)
229-
actionpack (>= 4.2)
230-
omniauth (~> 2.0)
231217
ostruct (0.6.3)
232218
ougai (2.0.0)
233219
oj (~> 3.10)
234-
parallel (1.27.0)
235-
parser (3.3.10.2)
220+
parallel (2.1.0)
221+
parser (3.3.11.1)
236222
ast (~> 2.4.1)
237223
racc
238224
parslet (2.0.0)
239-
pg (1.6.1)
240-
pg (1.6.1-aarch64-linux)
241-
pg (1.6.1-arm64-darwin)
242-
pg (1.6.1-x86_64-linux)
225+
pg (1.6.3-aarch64-linux)
243226
pg_search (2.3.7)
244227
activerecord (>= 6.1)
245228
activesupport (>= 6.1)
@@ -256,14 +239,15 @@ GEM
256239
puma-plugin-delayed_stop (0.1.2)
257240
puma (>= 5.0, < 8)
258241
racc (1.8.1)
259-
rack (3.2.5)
260-
rack-cors (2.0.2)
261-
rack (>= 2.0.0)
242+
rack (3.2.6)
243+
rack-cors (3.0.0)
244+
logger
245+
rack (>= 3.0.14)
262246
rack-protection (4.2.1)
263247
base64 (>= 0.1.0)
264248
logger (>= 1.6.0)
265249
rack (>= 3.0.0, < 4)
266-
rack-session (2.1.1)
250+
rack-session (2.1.2)
267251
base64 (>= 0.1.0)
268252
rack (>= 3.0.0)
269253
rack-test (2.2.0)
@@ -305,16 +289,16 @@ GEM
305289
tsort (>= 0.2)
306290
zeitwerk (~> 2.6)
307291
rainbow (3.1.1)
308-
rake (13.3.1)
309-
ransack (4.4.0)
310-
activerecord (>= 7.1)
311-
activesupport (>= 7.1)
292+
rake (13.4.2)
293+
ransack (4.4.1)
294+
activerecord (>= 7.2)
295+
activesupport (>= 7.2)
312296
i18n
313297
rdoc (7.2.0)
314298
erb
315299
psych (>= 4.0.0)
316300
tsort
317-
regexp_parser (2.11.3)
301+
regexp_parser (2.12.0)
318302
reline (0.6.3)
319303
io-console (~> 0.5)
320304
request_store (1.7.0)
@@ -325,7 +309,7 @@ GEM
325309
mime-types (>= 1.16, < 4.0)
326310
netrc (~> 0.8)
327311
rexml (3.4.4)
328-
rspec (3.13.1)
312+
rspec (3.13.2)
329313
rspec-core (~> 3.13.0)
330314
rspec-expectations (~> 3.13.0)
331315
rspec-mocks (~> 3.13.0)
@@ -348,11 +332,11 @@ GEM
348332
rspec-support (3.13.7)
349333
rspec_junit_formatter (0.6.0)
350334
rspec-core (>= 2, < 4, != 2.12.0)
351-
rubocop (1.86.0)
335+
rubocop (1.86.1)
352336
json (~> 2.3)
353337
language_server-protocol (~> 3.17.0.2)
354338
lint_roller (~> 1.1.0)
355-
parallel (~> 1.10)
339+
parallel (>= 1.10)
356340
parser (>= 3.3.0.2)
357341
rainbow (>= 2.2.2, < 4.0)
358342
regexp_parser (>= 2.9.3, < 3.0)
@@ -362,7 +346,7 @@ GEM
362346
rubocop-ast (1.49.1)
363347
parser (>= 3.3.7.2)
364348
prism (~> 1.7)
365-
rubocop-rails (2.34.3)
349+
rubocop-rails (2.35.0)
366350
activesupport (>= 4.2.0)
367351
lint_roller (~> 1.1)
368352
rack (>= 1.1)
@@ -380,7 +364,7 @@ GEM
380364
parslet (~> 2.0)
381365
typesafe_enum (~> 0.3)
382366
ruby-progressbar (1.13.0)
383-
ruby-vips (2.2.4)
367+
ruby-vips (2.3.0)
384368
ffi (~> 1.12)
385369
logger
386370
securerandom (0.4.1)
@@ -404,7 +388,7 @@ GEM
404388
unicode-emoji (4.2.0)
405389
uri (1.1.1)
406390
useragent (0.16.11)
407-
webmock (3.25.1)
391+
webmock (3.26.2)
408392
addressable (>= 2.8.0)
409393
crack (>= 0.3.2)
410394
hashdiff (>= 0.4.0, < 2.0.0)
@@ -417,10 +401,6 @@ GEM
417401

418402
PLATFORMS
419403
aarch64-linux-gnu
420-
arm64-darwin-23
421-
ruby
422-
x86_64-linux
423-
x86_64-unknown
424404

425405
DEPENDENCIES
426406
berkeley_library-alma (~> 0.1.1)
@@ -440,7 +420,6 @@ DEPENDENCIES
440420
mutex_m
441421
omniauth (~> 2.1)
442422
omniauth-cas (~> 3.0)
443-
omniauth-rails_csrf_protection (~> 1.0)
444423
pg (~> 1.4)
445424
pg_search (~> 2.3)
446425
puma (~> 7.2)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Preview
2-
class ApplicationController < ActionController::Base; end
2+
class ApplicationController < ActionController::API; end
33
end

config/initializers/omniauth.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ def return_url
1818
# https://github.com/omniauth/omniauth/wiki/Resolving-CVE-2015-9284
1919
OmniAuth.config.allowed_request_methods = [:post]
2020

21+
# API-only app: disable OmniAuth request CSRF validator.
22+
# OmniAuth 2.x calls this object in request_phase; setting nil skips it.
23+
OmniAuth.config.request_validation_phase = nil
24+
2125
Rails.application.configure do
2226
cas_opts = {
2327
name: :calnet,

0 commit comments

Comments
 (0)