Class: ClientAuth::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/client_auth/authenticator.rb

Constant Summary collapse

EXPIRATION =
10.minutes
DELIMITER =
':'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(request, public_key) ⇒ Authenticator

Returns a new instance of Authenticator.



6
7
8
9
# File 'lib/client_auth/authenticator.rb', line 6

def initialize(request, public_key)
  @request = request
  @public_key = public_key
end

Instance Method Details

#authenticate!Object



11
12
13
14
15
16
# File 'lib/client_auth/authenticator.rb', line 11

def authenticate!
  validate_client_name!
  validate_timestamp!
  validate_signature!
  true
end