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 +4 -4
 - data/app/controllers/api/v1/webhooks/outgoing/endpoints_controller.rb +1 -1
 - data/app/models/concerns/webhooks/outgoing/delivery_attempt_support.rb +8 -2
 - data/app/models/concerns/webhooks/outgoing/issuing_model.rb +1 -0
 - data/app/models/concerns/webhooks/outgoing/uri_filtering.rb +1 -1
 - data/lib/bullet_train/outgoing_webhooks/version.rb +1 -1
 - data/lib/bullet_train/outgoing_webhooks.rb +1 -0
 - metadata +6 -6
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 6e3d2a3c9b8da5cc130a0b5711dad59bef3dc92bc9e3a712be49c35239c11dec
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: c813f831e6f9da3a960a23289e1b3571dd6ebac1d851ff1a800e0f3c5073db3c
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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 
     | 
    
         
            -
                    : 
     | 
| 
      
 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 
     | 
    
         
            -
                 
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
      
 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  
     | 
| 
      
 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
         
     | 
| 
         @@ -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. 
     | 
| 
      
 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- 
     | 
| 
      
 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. 
     | 
| 
      
 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
         
     |