Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip CSRF protection check on callback route #2

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,12 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Enabled: false

Bundler/OrderedGems:
Enabled: false

Bundler/DuplicatedGem:
Enabled: false

Metrics/BlockLength:
Exclude:
- 'spec/**/*.rb'
Expand Down
12 changes: 9 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ gem 'solidus', github: 'solidusio/solidus', branch: branch
# Provides basic authentication functionality for testing parts of your engine
gem 'solidus_auth_devise'

if branch < 'v2.0'
gem 'rails', '~> 4.2.7'
gem 'rails_test_params_backport', group: :test
if branch == 'master' || branch >= "v2.3"
gem 'rails', '~> 5.1.0' # HACK: broken bundler dependency resolution
gem "rails-controller-testing", group: :test
elsif branch >= "v2.0"
gem 'rails', '~> 5.0.3' # HACK: broken bundler dependency resolution
gem "rails-controller-testing", group: :test
else
gem "rails", '~> 4.2.0' # HACK: broken bundler dependency resolution
gem "rails_test_params_backport", group: :test
end

gemspec
3 changes: 3 additions & 0 deletions app/controllers/spree/paybright_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module Spree
class PaybrightController < Spree::BaseController
# We can't use CSRF protection on a route that's hit by an external service
skip_before_action :verify_authenticity_token, only: :callback, raise: false

# Server2server call that gets parameters about the results of the Paybright
# transaction.
def callback
Expand Down