Class: 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.

[View source]

100
101
102
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 100

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.


98
99
100
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 98

def key
  @key
end

#signatureObject (readonly)

Returns the value of attribute signature.


98
99
100
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 98

def signature
  @signature
end

#timestampObject (readonly)

Returns the value of attribute timestamp.


98
99
100
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 98

def timestamp
  @timestamp
end

#tokenObject (readonly)

Returns the value of attribute token.


98
99
100
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 98

def token
  @token
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)
[View source]

104
105
106
# File 'app/controllers/action_mailbox/ingresses/mailgun/inbound_emails_controller.rb', line 104

def authenticated?
  signed? && recent?
end