webhukhs 0.5.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.
Files changed (105) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +14 -0
  3. data/.rubocop.yml +9 -0
  4. data/.standard.yml +3 -0
  5. data/Appraisals +13 -0
  6. data/CHANGELOG.md +54 -0
  7. data/LICENSE +21 -0
  8. data/README.md +71 -0
  9. data/Rakefile +26 -0
  10. data/config/routes.rb +3 -0
  11. data/example/.gitattributes +7 -0
  12. data/example/.gitignore +29 -0
  13. data/example/.ruby-version +1 -0
  14. data/example/Gemfile +32 -0
  15. data/example/Gemfile.lock +228 -0
  16. data/example/README.md +24 -0
  17. data/example/Rakefile +8 -0
  18. data/example/app/assets/images/.keep +0 -0
  19. data/example/app/assets/stylesheets/application.css +1 -0
  20. data/example/app/controllers/application_controller.rb +4 -0
  21. data/example/app/controllers/concerns/.keep +0 -0
  22. data/example/app/helpers/application_helper.rb +4 -0
  23. data/example/app/models/application_record.rb +5 -0
  24. data/example/app/models/concerns/.keep +0 -0
  25. data/example/app/views/layouts/application.html.erb +15 -0
  26. data/example/app/webhooks/webhook_test_handler.rb +13 -0
  27. data/example/bin/bundle +109 -0
  28. data/example/bin/rails +4 -0
  29. data/example/bin/rake +4 -0
  30. data/example/bin/setup +33 -0
  31. data/example/config/application.rb +39 -0
  32. data/example/config/boot.rb +5 -0
  33. data/example/config/credentials.yml.enc +1 -0
  34. data/example/config/database.yml +25 -0
  35. data/example/config/environment.rb +7 -0
  36. data/example/config/environments/development.rb +61 -0
  37. data/example/config/environments/production.rb +71 -0
  38. data/example/config/environments/test.rb +52 -0
  39. data/example/config/initializers/assets.rb +14 -0
  40. data/example/config/initializers/content_security_policy.rb +27 -0
  41. data/example/config/initializers/filter_parameter_logging.rb +10 -0
  42. data/example/config/initializers/generators.rb +7 -0
  43. data/example/config/initializers/inflections.rb +18 -0
  44. data/example/config/initializers/permissions_policy.rb +13 -0
  45. data/example/config/initializers/webhukhs.rb +9 -0
  46. data/example/config/locales/en.yml +33 -0
  47. data/example/config/puma.rb +45 -0
  48. data/example/config/routes.rb +5 -0
  49. data/example/config.ru +8 -0
  50. data/example/db/migrate/20240523125859_create_webhukhs_tables.rb +22 -0
  51. data/example/db/schema.rb +24 -0
  52. data/example/db/seeds.rb +9 -0
  53. data/example/lib/assets/.keep +0 -0
  54. data/example/lib/tasks/.keep +0 -0
  55. data/example/log/.keep +0 -0
  56. data/example/public/404.html +67 -0
  57. data/example/public/422.html +67 -0
  58. data/example/public/500.html +66 -0
  59. data/example/public/apple-touch-icon-precomposed.png +0 -0
  60. data/example/public/apple-touch-icon.png +0 -0
  61. data/example/public/favicon.ico +0 -0
  62. data/example/public/robots.txt +1 -0
  63. data/example/test/controllers/.keep +0 -0
  64. data/example/test/fixtures/files/.keep +0 -0
  65. data/example/test/helpers/.keep +0 -0
  66. data/example/test/integration/.keep +0 -0
  67. data/example/test/models/.keep +0 -0
  68. data/example/test/test_helper.rb +15 -0
  69. data/example/tmp/.keep +0 -0
  70. data/example/tmp/pids/.keep +0 -0
  71. data/example/vendor/.keep +0 -0
  72. data/gemfiles/rails_7.1.gemfile +10 -0
  73. data/gemfiles/rails_7.1.gemfile.lock +412 -0
  74. data/gemfiles/rails_8.0.gemfile +10 -0
  75. data/gemfiles/rails_8.0.gemfile.lock +405 -0
  76. data/gemfiles/rails_8.1.gemfile +10 -0
  77. data/gemfiles/rails_8.1.gemfile.lock +405 -0
  78. data/handler-examples/customer_io_handler.rb +36 -0
  79. data/handler-examples/revolut_business_v1_handler.rb +29 -0
  80. data/handler-examples/revolut_business_v2_handler.rb +42 -0
  81. data/handler-examples/starling_payments_handler.rb +25 -0
  82. data/lib/tasks/webhukhs_tasks.rake +4 -0
  83. data/lib/webhukhs/base_handler.rb +100 -0
  84. data/lib/webhukhs/controllers/receive_webhooks_controller.rb +55 -0
  85. data/lib/webhukhs/engine.rb +24 -0
  86. data/lib/webhukhs/install_generator.rb +31 -0
  87. data/lib/webhukhs/jobs/processing_job.rb +33 -0
  88. data/lib/webhukhs/models/received_webhook.rb +99 -0
  89. data/lib/webhukhs/templates/add_headers_to_webhukhs_webhooks.rb.erb +5 -0
  90. data/lib/webhukhs/templates/create_webhukhs_tables.rb.erb +23 -0
  91. data/lib/webhukhs/templates/webhukhs.rb +40 -0
  92. data/lib/webhukhs/version.rb +5 -0
  93. data/lib/webhukhs.rb +23 -0
  94. data/test/test-webhook-handlers/.DS_Store +0 -0
  95. data/test/test-webhook-handlers/extract_id_handler.rb +5 -0
  96. data/test/test-webhook-handlers/failing_with_concealed_errors.rb +7 -0
  97. data/test/test-webhook-handlers/failing_with_exposed_errors.rb +7 -0
  98. data/test/test-webhook-handlers/inactive_handler.rb +5 -0
  99. data/test/test-webhook-handlers/invalid_handler.rb +5 -0
  100. data/test/test-webhook-handlers/private_handler.rb +3 -0
  101. data/test/test-webhook-handlers/webhook_test_handler.rb +13 -0
  102. data/test/test_app.rb +66 -0
  103. data/test/test_helper.rb +50 -0
  104. data/test/webhukhs_test.rb +203 -0
  105. metadata +247 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: a3649db576ac151f62fa71f5e929d9b62f9a7dcbbff4c9b831e67fc4141e6524
4
+ data.tar.gz: 6d1fa28e296c7449e1c5a55b7f0758f043ff1b3c66098cd16c0e9a55db9d3f16
5
+ SHA512:
6
+ metadata.gz: 2c05c1b968a0ac107f3366e9d07903a460da24c1d835c9d60e94948e7cd46946d9f067c733433c18fc092a80c2bf0c1eabee4c6d161a6ec2779bc5ccc30214a9
7
+ data.tar.gz: 211a266f0ff4951265f2d568427c034010f9367c5a9a0cf653d767457fa9a57b2da0c45b98c2b534015a2e58900e8592d71342accfd247b888060f4f8e54f8c0
data/.editorconfig ADDED
@@ -0,0 +1,14 @@
1
+ # top-most EditorConfig file
2
+ root = true
3
+
4
+ # Unix-style newlines with a newline ending every file
5
+ # Two spaces for indenting
6
+ [*]
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ indent_style = space
10
+ indent_size = 2
11
+ charset = utf-8
12
+ trim_trailing_whitespace = true
13
+ max_line_length = 120
14
+
data/.rubocop.yml ADDED
@@ -0,0 +1,9 @@
1
+ require: standard
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 3.0
5
+
6
+ inherit_gem:
7
+ standard: config/base.yml
8
+ # Don't define any actual rubocop config here - this file is only used for
9
+ # proper editor support, and not used on CI, formatters, nor anywhere else.
data/.standard.yml ADDED
@@ -0,0 +1,3 @@
1
+ # For available configuration options, see:
2
+ # https://github.com/standardrb/standard
3
+ ruby_version: 3.0
data/Appraisals ADDED
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ appraise "rails-7.1" do
4
+ gem "rails", "~> 7.1.0"
5
+ end
6
+
7
+ appraise "rails-8.1" do
8
+ gem "rails", "~> 8.1"
9
+ end
10
+
11
+ appraise "rails-8.0" do
12
+ gem "rails", "~> 8.0"
13
+ end
data/CHANGELOG.md ADDED
@@ -0,0 +1,54 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ This format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+
6
+ ## Unreleased
7
+
8
+ ## 0.5.0
9
+
10
+ - Forked from [munster](https://github.com/cheddar-me/munster) and renamed to webhukhs
11
+ - Changed GitHub repository to https://github.com/skatkov/webhukhs
12
+ - Testing against rails 7.1, rails 8.0 and rails 8.1
13
+ - Ruby 3.4 used as a default testing target
14
+ - Replaced deprecated `ActiveSupport::Configurable` with `class_attribute`
15
+
16
+ ## 0.4.2
17
+
18
+ - When processing a webhook, print messages to the ActiveJob logger. This allows for quicker debugging if the app does not have an error tracking service set up
19
+
20
+ ## 0.4.1
21
+
22
+ - Webhook processor now requires `active_job/railtie`, instead of `active_job`. It requires GlobalID to work and that get's required only with railtie.
23
+ - Adding a state transition from `error` to `received`. Proccessing job will be enqueued automatic after this transition was executed.
24
+
25
+ ## 0.4.0
26
+
27
+ - Limit's size of request body, since otherwise there can be a large attack vector where random senders can spam the database with data and cause a denial of service. With background validation, this is one of few cases where we want to reject the payload without persisting it.
28
+ - Manage's `state` of `ReceivedWebhook` from background job itself. This frees up the handler to actually do the work associated with processing only. The job will manage the rest.
29
+ - Use's `valid?` in background job instead of the controller. Most common configuration issue is an incorrectly specified signing secret, or an incorrectly implemented input validation. When these happen, it is better to allow the webhook to be reprocessed
30
+ - Use's instance methods in handlers instead of class methods, as they are shorter to define. Assume a handler module supports `.new` - with a module using singleton methods it may return `self` from `new`.
31
+ - In config, allow handlers specified as strings. Module resolution in Rails happens after config gets loaded, because config may alter to Zeitwerk load paths. To allow config to get loaded and to allow handlers to be autoloaded using Zeitwerk, handler modules have to be resolved lazily. This also permits handlers to be reloadable, like any module under Rails' autoloading control.
32
+ - Simplify's the Rails app used in tests to be small and keep it in a single file
33
+ - If a handler is willing to expose errors to the caller, let Rails rescue the error and display an error page or do whatever else is configured for Rails globally.
34
+ - Store's request headers with received webhook to allow for async validation. Run `bin/rails g webhukhs:install` to add the required migration.
35
+
36
+ ## 0.3.1
37
+
38
+ - BaseHandler#expose_errors_to_sender? defaults to true now.
39
+
40
+ ## 0.3.0
41
+
42
+ - state_machine_enum library was moved into its own library/gem.
43
+ - Provide handled: true attribute for Rails.error.report method, because it is required in Rails 7.0.
44
+
45
+ ## 0.2.0
46
+
47
+ - Handler methods are now defined as instance methods for simplicity.
48
+ - Define service_id in initializer with active_handlers, instead of handler class.
49
+ - Use Ruby 3.0 as a base for standard/rubocop, format all code according to it.
50
+ - Use Rails common error reporter ( https://guides.rubyonrails.org/error_reporting.html )
51
+
52
+ ## 0.1.0
53
+
54
+ - Initial release
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Cheddar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # Webhukhs
2
+
3
+ Webhukhs is a Rails engine for processing webhooks from various services. Engine saves webhook in database first and later processes webhook in async process.
4
+
5
+ This is a fork of [cheddar-me/munster](https://github.com/cheddar-me/munster). Original project became unmaintained, so I continued it.
6
+ ## Installation
7
+
8
+ Install the gem and add to the application's Gemfile by executing:
9
+
10
+ $ bundle add webhukhs
11
+
12
+ If bundler is not being used to manage dependencies, install the gem by executing:
13
+
14
+ $ gem install webhukhs
15
+
16
+ ## Usage
17
+
18
+ Generate migrations and initializer file.
19
+
20
+ `bin/rails g webhukhs:install`
21
+
22
+ Mount webhukhs engine in your routes.
23
+
24
+ ```ruby
25
+ mount Webhukhs::Engine, at: "/webhooks"
26
+ ```
27
+
28
+ Define a class for your first handler (let's call it `ExampleHandler`) and inherit it from `Webhukhs::BaseHandler`. Place it somewhere where Rails autoloading can find it, and add it to your `webhukhs.rb` config file:
29
+
30
+ ```ruby
31
+ config.active_handlers = {
32
+ "example" => "ExampleHandler"
33
+ }
34
+ ```
35
+
36
+ ## Example handlers
37
+
38
+ We provide a number of webhook handlers which demonstrate certain features of Webhukhs. You will find them in `handler-examples`.
39
+
40
+ ## Requirements
41
+
42
+ This project depends on two dependencies:
43
+
44
+ - Ruby >= 3.0
45
+ - Rails >= 7.0
46
+
47
+ ## Error reporter
48
+
49
+ This gem uses [Rails common error reporter](https://guides.rubyonrails.org/error_reporting.html) to report any possible error to services like Honeybadger, Appsignal, Sentry and etc. Most of those services already support this common interface, if not - it's not that hard to add this support on your own.
50
+
51
+ It's possible to provide additional context for every error. e.g.
52
+
53
+ ```ruby
54
+ Webhukhs.configure do |config|
55
+ config.error_context = { appsignal: { namespace: "webhooks" } }
56
+ end
57
+ ```
58
+
59
+ ## Development
60
+
61
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
62
+
63
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
64
+
65
+ ## Contributing
66
+
67
+ Bug reports and pull requests are welcome on GitHub at https://github.com/skatkov/webhukhs.
68
+
69
+ ## License
70
+
71
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/setup"
4
+ require "rake/testtask"
5
+ require "bundler/gem_tasks"
6
+ require "standard/rake"
7
+
8
+ task :format do
9
+ `bundle exec standardrb --fix`
10
+ `bundle exec magic_frozen_string_literal .`
11
+ end
12
+
13
+ Rake::TestTask.new(:test) do |t|
14
+ t.libs << "test"
15
+ t.libs << "lib"
16
+
17
+ file_name = ARGV[1]
18
+
19
+ t.test_files = if file_name
20
+ [file_name]
21
+ else
22
+ FileList["test/**/*_test.rb"]
23
+ end
24
+ end
25
+
26
+ task default: [:test, :standard]
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ Webhukhs::Engine.routes.draw do
2
+ post "/:service_id", to: "receive_webhooks#create", namespace: "webhukhs"
3
+ end
@@ -0,0 +1,7 @@
1
+ # See https://git-scm.com/docs/gitattributes for more about git attribute files.
2
+
3
+ # Mark the database schema as having been generated.
4
+ db/schema.rb linguist-generated
5
+
6
+ # Mark any vendored files as having been vendored.
7
+ vendor/* linguist-vendored
@@ -0,0 +1,29 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-*
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ /tmp/*
17
+ !/log/.keep
18
+ !/tmp/.keep
19
+
20
+ # Ignore pidfiles, but keep the directory.
21
+ /tmp/pids/*
22
+ !/tmp/pids/
23
+ !/tmp/pids/.keep
24
+
25
+
26
+ /public/assets
27
+
28
+ # Ignore master key for decrypting credentials and more.
29
+ /config/master.key
@@ -0,0 +1 @@
1
+ ruby-3.2.2
data/example/Gemfile ADDED
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
5
+
6
+ ruby "3.2.2"
7
+
8
+ # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
9
+ gem "rails", ">= 7.0.8.1"
10
+
11
+ # The modern asset pipeline for Rails [https://github.com/rails/propshaft]
12
+ gem "propshaft"
13
+
14
+ # Use sqlite3 as the database for Active Record
15
+ gem "sqlite3", "~> 1.4"
16
+
17
+ # Use the Puma web server [https://github.com/puma/puma]
18
+ gem "puma", "~> 5.0"
19
+
20
+ # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
21
+ gem "tzinfo-data", platforms: %i[mingw mswin x64_mingw jruby]
22
+ gem "webhukhs", path: "../"
23
+
24
+ group :development, :test do
25
+ # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
26
+ gem "debug", platforms: %i[mri mingw x64_mingw]
27
+ end
28
+
29
+ group :development do
30
+ # Speed up commands on slow machines / big apps [https://github.com/rails/spring]
31
+ # gem "spring"
32
+ end
@@ -0,0 +1,228 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ munster (0.1.0)
5
+ rails (~> 7.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ actioncable (7.1.3.3)
11
+ actionpack (= 7.1.3.3)
12
+ activesupport (= 7.1.3.3)
13
+ nio4r (~> 2.0)
14
+ websocket-driver (>= 0.6.1)
15
+ zeitwerk (~> 2.6)
16
+ actionmailbox (7.1.3.3)
17
+ actionpack (= 7.1.3.3)
18
+ activejob (= 7.1.3.3)
19
+ activerecord (= 7.1.3.3)
20
+ activestorage (= 7.1.3.3)
21
+ activesupport (= 7.1.3.3)
22
+ mail (>= 2.7.1)
23
+ net-imap
24
+ net-pop
25
+ net-smtp
26
+ actionmailer (7.1.3.3)
27
+ actionpack (= 7.1.3.3)
28
+ actionview (= 7.1.3.3)
29
+ activejob (= 7.1.3.3)
30
+ activesupport (= 7.1.3.3)
31
+ mail (~> 2.5, >= 2.5.4)
32
+ net-imap
33
+ net-pop
34
+ net-smtp
35
+ rails-dom-testing (~> 2.2)
36
+ actionpack (7.1.3.3)
37
+ actionview (= 7.1.3.3)
38
+ activesupport (= 7.1.3.3)
39
+ nokogiri (>= 1.8.5)
40
+ racc
41
+ rack (>= 2.2.4)
42
+ rack-session (>= 1.0.1)
43
+ rack-test (>= 0.6.3)
44
+ rails-dom-testing (~> 2.2)
45
+ rails-html-sanitizer (~> 1.6)
46
+ actiontext (7.1.3.3)
47
+ actionpack (= 7.1.3.3)
48
+ activerecord (= 7.1.3.3)
49
+ activestorage (= 7.1.3.3)
50
+ activesupport (= 7.1.3.3)
51
+ globalid (>= 0.6.0)
52
+ nokogiri (>= 1.8.5)
53
+ actionview (7.1.3.3)
54
+ activesupport (= 7.1.3.3)
55
+ builder (~> 3.1)
56
+ erubi (~> 1.11)
57
+ rails-dom-testing (~> 2.2)
58
+ rails-html-sanitizer (~> 1.6)
59
+ activejob (7.1.3.3)
60
+ activesupport (= 7.1.3.3)
61
+ globalid (>= 0.3.6)
62
+ activemodel (7.1.3.3)
63
+ activesupport (= 7.1.3.3)
64
+ activerecord (7.1.3.3)
65
+ activemodel (= 7.1.3.3)
66
+ activesupport (= 7.1.3.3)
67
+ timeout (>= 0.4.0)
68
+ activestorage (7.1.3.3)
69
+ actionpack (= 7.1.3.3)
70
+ activejob (= 7.1.3.3)
71
+ activerecord (= 7.1.3.3)
72
+ activesupport (= 7.1.3.3)
73
+ marcel (~> 1.0)
74
+ activesupport (7.1.3.3)
75
+ base64
76
+ bigdecimal
77
+ concurrent-ruby (~> 1.0, >= 1.0.2)
78
+ connection_pool (>= 2.2.5)
79
+ drb
80
+ i18n (>= 1.6, < 2)
81
+ minitest (>= 5.1)
82
+ mutex_m
83
+ tzinfo (~> 2.0)
84
+ base64 (0.2.0)
85
+ bigdecimal (3.1.8)
86
+ builder (3.2.4)
87
+ concurrent-ruby (1.2.3)
88
+ connection_pool (2.4.1)
89
+ crass (1.0.6)
90
+ date (3.3.4)
91
+ debug (1.9.2)
92
+ irb (~> 1.10)
93
+ reline (>= 0.3.8)
94
+ drb (2.2.1)
95
+ erubi (1.12.0)
96
+ globalid (1.2.1)
97
+ activesupport (>= 6.1)
98
+ i18n (1.14.5)
99
+ concurrent-ruby (~> 1.0)
100
+ io-console (0.7.2)
101
+ irb (1.13.1)
102
+ rdoc (>= 4.0.0)
103
+ reline (>= 0.4.2)
104
+ loofah (2.22.0)
105
+ crass (~> 1.0.2)
106
+ nokogiri (>= 1.12.0)
107
+ mail (2.8.1)
108
+ mini_mime (>= 0.1.1)
109
+ net-imap
110
+ net-pop
111
+ net-smtp
112
+ marcel (1.0.4)
113
+ mini_mime (1.1.5)
114
+ minitest (5.22.3)
115
+ mutex_m (0.2.0)
116
+ net-imap (0.4.11)
117
+ date
118
+ net-protocol
119
+ net-pop (0.1.2)
120
+ net-protocol
121
+ net-protocol (0.2.2)
122
+ timeout
123
+ net-smtp (0.5.0)
124
+ net-protocol
125
+ nio4r (2.7.3)
126
+ nokogiri (1.16.5-aarch64-linux)
127
+ racc (~> 1.4)
128
+ nokogiri (1.16.5-arm-linux)
129
+ racc (~> 1.4)
130
+ nokogiri (1.16.5-arm64-darwin)
131
+ racc (~> 1.4)
132
+ nokogiri (1.16.5-x86-linux)
133
+ racc (~> 1.4)
134
+ nokogiri (1.16.5-x86_64-darwin)
135
+ racc (~> 1.4)
136
+ nokogiri (1.16.5-x86_64-linux)
137
+ racc (~> 1.4)
138
+ propshaft (0.8.0)
139
+ actionpack (>= 7.0.0)
140
+ activesupport (>= 7.0.0)
141
+ rack
142
+ railties (>= 7.0.0)
143
+ psych (5.1.2)
144
+ stringio
145
+ puma (5.6.8)
146
+ nio4r (~> 2.0)
147
+ racc (1.7.3)
148
+ rack (2.2.9)
149
+ rack-session (1.0.2)
150
+ rack (< 3)
151
+ rack-test (2.1.0)
152
+ rack (>= 1.3)
153
+ rackup (1.0.0)
154
+ rack (< 3)
155
+ webrick
156
+ rails (7.1.3.3)
157
+ actioncable (= 7.1.3.3)
158
+ actionmailbox (= 7.1.3.3)
159
+ actionmailer (= 7.1.3.3)
160
+ actionpack (= 7.1.3.3)
161
+ actiontext (= 7.1.3.3)
162
+ actionview (= 7.1.3.3)
163
+ activejob (= 7.1.3.3)
164
+ activemodel (= 7.1.3.3)
165
+ activerecord (= 7.1.3.3)
166
+ activestorage (= 7.1.3.3)
167
+ activesupport (= 7.1.3.3)
168
+ bundler (>= 1.15.0)
169
+ railties (= 7.1.3.3)
170
+ rails-dom-testing (2.2.0)
171
+ activesupport (>= 5.0.0)
172
+ minitest
173
+ nokogiri (>= 1.6)
174
+ rails-html-sanitizer (1.6.0)
175
+ loofah (~> 2.21)
176
+ nokogiri (~> 1.14)
177
+ railties (7.1.3.3)
178
+ actionpack (= 7.1.3.3)
179
+ activesupport (= 7.1.3.3)
180
+ irb
181
+ rackup (>= 1.0.0)
182
+ rake (>= 12.2)
183
+ thor (~> 1.0, >= 1.2.2)
184
+ zeitwerk (~> 2.6)
185
+ rake (13.2.1)
186
+ rdoc (6.6.3.1)
187
+ psych (>= 4.0.0)
188
+ reline (0.5.7)
189
+ io-console (~> 0.5)
190
+ sqlite3 (1.7.3-aarch64-linux)
191
+ sqlite3 (1.7.3-arm-linux)
192
+ sqlite3 (1.7.3-arm64-darwin)
193
+ sqlite3 (1.7.3-x86-linux)
194
+ sqlite3 (1.7.3-x86_64-darwin)
195
+ sqlite3 (1.7.3-x86_64-linux)
196
+ stringio (3.1.0)
197
+ thor (1.3.1)
198
+ timeout (0.4.1)
199
+ tzinfo (2.0.6)
200
+ concurrent-ruby (~> 1.0)
201
+ webrick (1.8.1)
202
+ websocket-driver (0.7.6)
203
+ websocket-extensions (>= 0.1.0)
204
+ websocket-extensions (0.1.5)
205
+ zeitwerk (2.6.14)
206
+
207
+ PLATFORMS
208
+ aarch64-linux
209
+ arm-linux
210
+ arm64-darwin
211
+ x86-linux
212
+ x86_64-darwin
213
+ x86_64-linux
214
+
215
+ DEPENDENCIES
216
+ debug
217
+ munster!
218
+ propshaft
219
+ puma (~> 5.0)
220
+ rails (>= 7.0.8.1)
221
+ sqlite3 (~> 1.4)
222
+ tzinfo-data
223
+
224
+ RUBY VERSION
225
+ ruby 3.2.2p53
226
+
227
+ BUNDLED WITH
228
+ 2.5.6
data/example/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
data/example/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
4
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
5
+
6
+ require_relative "config/application"
7
+
8
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1 @@
1
+ /* Application styles */
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationController < ActionController::Base
4
+ end
File without changes
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ module ApplicationHelper
4
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class ApplicationRecord < ActiveRecord::Base
4
+ primary_abstract_class
5
+ end
File without changes
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Example</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+
9
+ <%= stylesheet_link_tag "application" %>
10
+ </head>
11
+
12
+ <body>
13
+ <%= yield %>
14
+ </body>
15
+ </html>
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This handler accepts webhooks from our integration tests. This webhook gets dispatched
4
+ # if a banking provider test fails, indicating that the bank might be having an incident
5
+ class WebhookTestHandler < Webhukhs::BaseHandler
6
+ def valid?(request) = true
7
+
8
+ def process(webhook)
9
+ Rails.logger.info { webhook.request.params.fetch(:payment_id) }
10
+ end
11
+
12
+ def expose_errors_to_sender? = true
13
+ end