Module: Nokotime::Authentication

Included in:
Configuration, Connection
Defined in:
lib/nokotime/authentication.rb

Constant Summary collapse

AUTHENTICATION_TYPE =
[
  :noko_token
].freeze

Instance Method Summary collapse

Instance Method Details

#authorize_request(request) ⇒ Object



11
12
13
14
15
16
# File 'lib/nokotime/authentication.rb', line 11

def authorize_request(request)
  case auth_type
  when :noko_token
    request.headers["X-NokoToken"] = token
  end
end

#valid_auth?(type) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/nokotime/authentication.rb', line 7

def valid_auth?(type)
  AUTHENTICATION_TYPE.include? type
end