Class: PlanMyStuff::Webhooks::AwsController
- Inherits:
-
ActionController::API
- Object
- ActionController::API
- PlanMyStuff::Webhooks::AwsController
- Defined in:
- app/controllers/plan_my_stuff/webhooks/aws_controller.rb
Constant Summary collapse
- VALID_SNS_MESSAGE_TYPES =
%w[Notification SubscriptionConfirmation UnsubscribeConfirmation].freeze
Instance Method Summary collapse
-
#create ⇒ Object
POST /webhooks/aws.
Instance Method Details
#create ⇒ Object
POST /webhooks/aws
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'app/controllers/plan_my_stuff/webhooks/aws_controller.rb', line 11 def create config = PlanMyStuff.configuration = request.headers['x-amz-sns-message-type'].to_s unless == 'Notification' Rails.logger.info("[PlanMyStuff] SNS #{}: #{sns_params.to_unsafe_h.inspect}") head(:ok) return end unless config.process_aws_webhooks head(:ok) return end unless matching_service?(config.aws_service_identifier) head(:ok) return end case .dig(:detail, :event_name) when 'SERVICE_DEPLOYMENT_COMPLETED' handle_deployment_completed end head(:ok) end |