I am using the doorkeeper gem to use tokens to authenticate requests.
When I have doorkeeper_for configured as defined below, tokens are required, which is good and expected:
doorkeeper_for :all
When I set a conditional for doorkeeper_for to be the condition I actually want (allowing requests to local deployment endpoints without tokens)
doorkeeper_for :all, :unless => lambda { request.url =~ /http:\/\/(localhost|127.0.0.1|0.0.0.0):8080/
Or if I set this condition to any number of junk conditions:
doorkeeper_for :all, :if => lambda { true }
doorkeeper_for :all, :unless => lambda { true }
Then doorkeeper allows all requests to go through without tokens, which is bad and not expected.
Noting that I have a require 'doorkeeper' statement and that I've fiddled around with various include statements in my API controller such as include Doorkeeper::Helpers::Filter
This may have to do with a problem with Doorkeeper working with Grape, though again it is strange that it works just fine without the conditional. Any insight into why this is happening would be appreciated!