bullet_train-outgoing_webhooks 1.2.27 → 1.3.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: 68d98fba925e3acd68c9398bd0c4e3da64b5203f46ec73063cfc0ead7afefed7
4
- data.tar.gz: 85ac3398ca43a402ea366f240c2f8ed76506915c07a87010fb8af671d22a677c
3
+ metadata.gz: 6e3d2a3c9b8da5cc130a0b5711dad59bef3dc92bc9e3a712be49c35239c11dec
4
+ data.tar.gz: c813f831e6f9da3a960a23289e1b3571dd6ebac1d851ff1a800e0f3c5073db3c
5
5
  SHA512:
6
- metadata.gz: 9216310333b361c58044b0c3ae24ddf59fc5e6c5620d85699f7af7f162338b642e35291cca45955ef8ddcbb779dea5b4bcdd4766749ce42e8d0659a14c64622a
7
- data.tar.gz: 1c5c4df291d58e547919e6acae32453c9aa6e8303c45ba0e5678e7439436fa7a95f8e96f14bcd63e202793a25859ab09545a96b09eaf6bf8e10fba60ef144afc
6
+ metadata.gz: 0b6aac5ac695caf89aaef20ee79a0d85e455526d787e81008a433990bbf1bbaed32f69cf3019f7949892b867f447ffe6fd2022388b0f3d83cc2461c133918763
7
+ data.tar.gz: 4c241459f68ed41ee365f7ec94a428035333924192fae61a9937477581967b9eb38aa63c91a68d9acf8e6037d3753858a67b283fa6d0e1bd439076d960f542b0
@@ -43,7 +43,7 @@ class Api::V1::Webhooks::Outgoing::EndpointsController < Api::V1::ApplicationCon
43
43
  *permitted_fields,
44
44
  :url,
45
45
  :name,
46
- :version,
46
+ :api_version,
47
47
  :scaffolding_absolutely_abstract_creative_concept_id,
48
48
  # 🚅 super scaffolding will insert new fields above this line.
49
49
  *permitted_arrays,
@@ -51,8 +51,14 @@ module Webhooks::Outgoing::DeliveryAttemptSupport
51
51
  end
52
52
 
53
53
  http = Net::HTTP.new(hostname, uri.port)
54
- http.use_ssl = true if uri.scheme == "https"
55
- request = Net::HTTP::Post.new(uri.path)
54
+ if uri.scheme == "https"
55
+ http.use_ssl = true
56
+ if BulletTrain::OutgoingWebhooks.http_verify_mode
57
+ # Developers might need to set this to `OpenSSL::SSL::VERIFY_NONE` in some cases.
58
+ http.verify_mode = BulletTrain::OutgoingWebhooks.http_verify_mode
59
+ end
60
+ end
61
+ request = Net::HTTP::Post.new(uri.request_uri)
56
62
  request.add_field("Host", uri.host)
57
63
  request.add_field("Content-Type", "application/json")
58
64
  request.body = delivery.event.payload.to_json
@@ -13,6 +13,7 @@ module Webhooks::Outgoing::IssuingModel
13
13
  false
14
14
  end
15
15
 
16
+ # TODO This should probably be called `outgoing_webhooks_parent` to avoid colliding with downstream `parent` methods.
16
17
  def parent
17
18
  return unless respond_to? BulletTrain::OutgoingWebhooks.parent_association
18
19
  send(BulletTrain::OutgoingWebhooks.parent_association)
@@ -81,7 +81,7 @@ module Webhooks::Outgoing::UriFiltering
81
81
  resource = authoritative_resolver.getresource(hostname, Resolv::DNS::Resource::IN::A)
82
82
  Rails.cache.write(cache_key, resource.address.to_s, expires_in: resource.ttl, race_condition_ttl: 5)
83
83
  resource.address.to_s
84
- rescue IPAddr::InvalidAddressError, ArgumentError # standard:disable Lint/ShadowedException
84
+ rescue ArgumentError
85
85
  Rails.cache.write(cache_key, "invalid", expires_in: 10.minutes, race_condition_ttl: 5)
86
86
  nil
87
87
  end
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module OutgoingWebhooks
3
- VERSION = "1.2.27"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
@@ -10,6 +10,7 @@ module BulletTrain
10
10
  mattr_accessor :parent_class, default: default_for(BulletTrain, :parent_class, "Team")
11
11
  mattr_accessor :base_class, default: default_for(BulletTrain, :base_class, "ApplicationRecord")
12
12
  mattr_accessor :advanced_hostname_security, default: false
13
+ mattr_accessor :http_verify_mode
13
14
 
14
15
  def self.parent_association
15
16
  parent_class.underscore.to_sym
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-outgoing_webhooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.27
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-27 00:00:00.000000000 Z
11
+ date: 2023-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -155,12 +155,12 @@ files:
155
155
  - lib/bullet_train/outgoing_webhooks/engine.rb
156
156
  - lib/bullet_train/outgoing_webhooks/version.rb
157
157
  - lib/tasks/bullet_train/outgoing_webhooks_tasks.rake
158
- homepage: https://github.com/bullet-train-co/bullet_train-outgoing_webhooks
158
+ homepage: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-outgoing_webhooks
159
159
  licenses:
160
160
  - MIT
161
161
  metadata:
162
- homepage_uri: https://github.com/bullet-train-co/bullet_train-outgoing_webhooks
163
- source_code_uri: https://github.com/bullet-train-co/bullet_train-outgoing_webhooks
162
+ homepage_uri: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-outgoing_webhooks
163
+ source_code_uri: https://github.com/bullet-train-co/bullet_train-core/tree/main/bullet_train-outgoing_webhooks
164
164
  post_install_message:
165
165
  rdoc_options: []
166
166
  require_paths:
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  - !ruby/object:Gem::Version
177
177
  version: '0'
178
178
  requirements: []
179
- rubygems_version: 3.4.10
179
+ rubygems_version: 3.3.7
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: Allow users of your Rails application to subscribe and receive webhooks when