summaryrefslogtreecommitdiff
path: root/spec/support/artifice/endpoint_basic_authentication.rb
blob: 0cfba89184b862a551671b77c440822bedb902f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
require File.expand_path("../endpoint", __FILE__)

Artifice.deactivate

class EndpointBasicAuthentication < Endpoint
  before do
    unless env["HTTP_AUTHORIZATION"]
      halt 401, "Authentication info not supplied"
    end
  end
end

Artifice.activate_with(EndpointBasicAuthentication)