Webhooks security fix

James Peret vor 8 Jahren
Ursprung
Commit
8d4d82bf80
2 geänderte Dateien mit 2 neuen Zeilen und 2 gelöschten Zeilen
  1. 1 1
      app/models/agents/mixpanel_agent.rb
  2. 1 1
      app/models/agents/webhook_agent.rb

+ 1 - 1
app/models/agents/mixpanel_agent.rb

@@ -48,7 +48,7 @@ module Agents
48 48
     MD
49 49
 
50 50
     def working?
51
-      event_created_within?(interpolated['expected_update_period_in_days']) && !recent_error_logs?
51
+      event_created_within?(options['expected_update_period_in_days']) && !recent_error_logs?
52 52
     end
53 53
 
54 54
     def validate_options

+ 1 - 1
app/models/agents/webhook_agent.rb

@@ -48,7 +48,7 @@ module Agents
48 48
     def receive_web_request(params, method, format)
49 49
       # check the secret
50 50
       secret = params.delete('secret')
51
-      return ["Not Authorized", 401] unless secret == interpolated['secret']
51
+      return ["Not Authorized", 401] unless secret == options['secret']
52 52
 
53 53
       # check the verbs
54 54
       verbs = (interpolated['verbs'] || 'post').split(/,/).map { |x| x.strip.downcase }.select { |x| x.present? }