module Nimbu::Request::Validations::Token
Constants
- TOKEN_REQUIRED
- TOKEN_REQUIRED_REGEXP
Public Instance Methods
validates_token_for(method, path)
click to toggle source
Ensures that required authentication token is present before request is sent.
# File lib/nimbu-api/request/validations/token.rb, line 20 def validates_token_for(method, path) return true unless TOKEN_REQUIRED.grep("#{method} #{path}").empty? token_required = false TOKEN_REQUIRED_REGEXP.each do |regex| if "#{method} #{path}" =~ regex token_required = true end end return token_required end