Skip to content

Commit

Permalink
follow rack and remove support for digest auth
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeIGS committed Jul 8, 2024
1 parent 335adeb commit a381d7a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
1 change: 1 addition & 0 deletions lib/savon/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def basic_auth(*credentials)

# HTTP digest auth credentials.
def digest_auth(*credentials)
deprecate
@options[:digest_auth] = credentials.flatten
end

Expand Down
8 changes: 0 additions & 8 deletions lib/savon/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,13 @@ def configure_ssl

def configure_auth
basic_auth if @globals.include?(:basic_auth)
digest_auth if @globals.include?(:digest_auth)
ntlm_auth if @globals.include?(:ntlm)
end

def basic_auth
connection.request(:authorization, :basic, *@globals[:basic_auth])
end

def digest_auth
require 'faraday/digestauth'
connection.request :digest, *@globals[:digest_auth]
rescue LoadError
raise LoadError, 'Using Digest Auth requests `faraday-digestauth`'
end

def ntlm_auth
begin
require 'rubyntlm'
Expand Down
16 changes: 0 additions & 16 deletions spec/integration/support/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,6 @@ def self.respond_with(options = {})
}
end

map "/digest_auth" do
unprotected_app = lambda { |env|
IntegrationServer.respond_with :body => "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

map "/multipart" do
run lambda { |env|
boundary = 'mimepart_boundary'
Expand Down

0 comments on commit a381d7a

Please sign in to comment.