Class: ActionMailbox::Ingresses::Mailgun::InboundEmailsController::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, timestamp:, token:, signature:) ⇒ Authenticator

Returns a new instance of Authenticator.



77
78
79
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 77

def initialize(key:, timestamp:, token:, signature:)
  @key, @timestamp, @token, @signature = key, Integer(timestamp), token, signature
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



75
76
77
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 75

def key
  @key
end

#signatureObject (readonly)

Returns the value of attribute signature.



75
76
77
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 75

def signature
  @signature
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



75
76
77
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 75

def timestamp
  @timestamp
end

#tokenObject (readonly)

Returns the value of attribute token.



75
76
77
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 75

def token
  @token
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


81
82
83
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 81

def authenticated?
  signed? && recent?
end