Skip to content

Commit

Permalink
skip digest authentication tests; implementation is removed in rack 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pcai committed Jul 6, 2024
1 parent d2144d9 commit 90e2ae1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
3 changes: 2 additions & 1 deletion spec/integration/curb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
expect(response.body).to eq("basic-auth")
end

it "supports digest authentication" do
# Rack::Auth::Digest is removed in Rack 3.1
xit "supports digest authentication" do
request = HTTPI::Request.new(@server.url + "digest-auth")
request.auth.digest("admin", "secret")

Expand Down
3 changes: 2 additions & 1 deletion spec/integration/httpclient_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
expect(response.body).to eq("basic-auth")
end

it "supports digest authentication" do
# Rack::Auth::Digest is removed in Rack 3.1
xit "supports digest authentication" do
request = HTTPI::Request.new(@server.url + "digest-auth")
request.auth.digest("admin", "secret")

Expand Down
13 changes: 2 additions & 11 deletions spec/integration/support/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,10 @@ def self.respond_with(body)
end

map "/digest-auth" do
unprotected_app = lambda { |env|
# Rack::Auth::Digest is removed in Rack 3.1
run lambda { |env|
IntegrationServer.respond_with "digest-auth"
}

realm = 'digest-realm'
app = Rack::Auth::Digest::MD5.new(unprotected_app) do |username|
username == 'admin' ? Digest::MD5.hexdigest("admin:#{realm}:secret") : nil
end
app.realm = realm
app.opaque = 'this-should-be-secret'
app.passwords_hashed = true

run app
end

end
Expand Down

0 comments on commit 90e2ae1

Please sign in to comment.