plan_my_stuff 0.5.0 → 0.5.1

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: a70108268136db83554f3bda05e5ab384b1d2c6f1d8d05f4554cef037eeee8a8
4
- data.tar.gz: 5c713eca795782628fab95c61c3d5876934d22b04e0c539e26d35369a376491b
3
+ metadata.gz: 37d945d43da806aa982200d92448e6d419a9adc2f7456b5b7b4ac0be7b1a11f2
4
+ data.tar.gz: 81ce6e1b7ae595a275bb1aa1f5023fc5a8f830f6d5e0315ebf2aa23b40272a01
5
5
  SHA512:
6
- metadata.gz: 253f04b4c10e8d1557d5915daa1a757d5678c717cd4b7b97d50450ed4e8417c05f044bbf97c235de17328a4fd3ee27f8a08bbaf1b874ce0dccd294760f370114
7
- data.tar.gz: 331d2a9b48418722eb3049099817e390095c07deb70e59670ead47cbf98555bb2c44e12b1cdc9824abd28fd6795c80fa8aac124ea5779dd9262323a7bc96c10a
6
+ metadata.gz: 5988a387e487ef49ec8791c7d4a0b3eac2a148c0349d59b1cae2e0a6db455bae1e364d577a9d42be611791af08368fa9c3ea7c1d4d8b7e4e24d518c0502fb680
7
+ data.tar.gz: 0e78e8bed60d993c9fa42dfcb6ba3d4d5a8e063ee103232a2b5302598156c720cbdea49b71e2556c0dd6f477a20f41bfbffc5ff546bab438c55e696d6fabc20f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.5.1
4
+
5
+ ### Fixed
6
+
7
+ - AWS webhook rejected SNS `SubscriptionConfirmation` and `UnsubscribeConfirmation` messages with 401; now signature-verified, logged, and acked with 200
8
+
3
9
  ## 0.5.0
4
10
 
5
11
  ### Added
@@ -3,13 +3,21 @@
3
3
  module PlanMyStuff
4
4
  module Webhooks
5
5
  class AwsController < ActionController::API
6
- VALID_SNS_MESSAGE_TYPES = %w[Notification].freeze
6
+ VALID_SNS_MESSAGE_TYPES = %w[Notification SubscriptionConfirmation UnsubscribeConfirmation].freeze
7
7
 
8
8
  before_action :verify_signature!
9
9
 
10
10
  # POST /webhooks/aws
11
11
  def create
12
12
  config = PlanMyStuff.configuration
13
+ message_type = request.headers['x-amz-sns-message-type'].to_s
14
+
15
+ unless message_type == 'Notification'
16
+ Rails.logger.info("[PlanMyStuff] SNS #{message_type}: #{sns_params.to_unsafe_h.inspect}")
17
+ head(:ok)
18
+
19
+ return
20
+ end
13
21
 
14
22
  unless config.process_aws_webhooks
15
23
  head(:ok)
@@ -4,7 +4,7 @@ module PlanMyStuff
4
4
  module VERSION
5
5
  MAJOR = 0
6
6
  MINOR = 5
7
- TINY = 0
7
+ TINY = 1
8
8
 
9
9
  # Set PRE to nil unless it's a pre-release (beta, rc, etc.)
10
10
  PRE = nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plan_my_stuff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brands Insurance