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

Inherits:
Object
  • Object
show all
Defined in:
actionmailbox/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.



87
88
89
# File 'actionmailbox/app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 87

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.



85
86
87
# File 'actionmailbox/app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 85

def key
  @key
end

#signatureObject (readonly)

Returns the value of attribute signature.



85
86
87
# File 'actionmailbox/app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 85

def signature
  @signature
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



85
86
87
# File 'actionmailbox/app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 85

def timestamp
  @timestamp
end

#tokenObject (readonly)

Returns the value of attribute token.



85
86
87
# File 'actionmailbox/app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 85

def token
  @token
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)


91
92
93
# File 'actionmailbox/app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 91

def authenticated?
  signed? && recent?
end