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]

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

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.


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

def key
  @key
end

#signatureObject (readonly)

Returns the value of attribute signature.


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

def signature
  @signature
end

#timestampObject (readonly)

Returns the value of attribute timestamp.


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

def timestamp
  @timestamp
end

#tokenObject (readonly)

Returns the value of attribute token.


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

def token
  @token
end

Instance Method Details

#authenticated?Boolean

Returns:

  • (Boolean)
[View source]

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

def authenticated?
  signed? && recent?
end