bullet_train-outgoing_webhooks 1.2.27 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68d98fba925e3acd68c9398bd0c4e3da64b5203f46ec73063cfc0ead7afefed7
4
- data.tar.gz: 85ac3398ca43a402ea366f240c2f8ed76506915c07a87010fb8af671d22a677c
3
+ metadata.gz: ce972d3861804cde7c035194d253b8f73c0848e4425575929b2be9a627d08099
4
+ data.tar.gz: d7f511395d325990c1b29bc04685c378aa44ea71b8a350f8c01ebd0157e9fc90
5
5
  SHA512:
6
- metadata.gz: 9216310333b361c58044b0c3ae24ddf59fc5e6c5620d85699f7af7f162338b642e35291cca45955ef8ddcbb779dea5b4bcdd4766749ce42e8d0659a14c64622a
7
- data.tar.gz: 1c5c4df291d58e547919e6acae32453c9aa6e8303c45ba0e5678e7439436fa7a95f8e96f14bcd63e202793a25859ab09545a96b09eaf6bf8e10fba60ef144afc
6
+ metadata.gz: 2ea6e1b9d619e63c1420c302bcccc0bf67a34d85e1078957370c5a2d23b004a7651507df2aff22698e061090c46146db922d98cbcff19e800412b0f0217dcb68
7
+ data.tar.gz: d279c41ead48060fc88678c565fd6fa5d0466f829e7e7f6bc7f7fc5306ac80dd9a1f4aa2202e4c4d850930fe1fd73d91049d75b5fc2e046ffe379f6c4145cebe
@@ -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.1"
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.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-27 00:00:00.000000000 Z
11
+ date: 2023-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -155,13 +155,13 @@ 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
164
- post_install_message:
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
+ post_install_message:
165
165
  rdoc_options: []
166
166
  require_paths:
167
167
  - lib
@@ -177,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
177
177
  version: '0'
178
178
  requirements: []
179
179
  rubygems_version: 3.4.10
180
- signing_key:
180
+ signing_key:
181
181
  specification_version: 4
182
182
  summary: Allow users of your Rails application to subscribe and receive webhooks when
183
183
  activity takes place in your application.