Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/passwordstate/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def initialize(url, options = {})
@server_url = URI(url)
@validate_certificate = true
@headers = DEFAULT_HEADERS
@auth_data = options.select { |k, _v| %i[apikey username password].include? k }
@auth_data = options.select { |k, _v| %i[apikey username password domain].include? k }
@api_type = options.fetch(:api_type) if options.key? :api_type
@open_timeout = options.fetch(:open_timeout, 5)
@timeout = options.fetch(:timeout, 15)
Expand Down Expand Up @@ -117,7 +117,7 @@ def request(method, api_path, query: nil, reason: nil, **options)
req_obj['content-type'] = 'application/json'
end

req_obj.ntlm_auth(auth_data[:username], auth_data[:password]) if api_type == :winapi
req_obj.ntlm_auth(auth_data[:username], auth_data[:password], auth_data[:domain]) if api_type == :winapi
headers.each { |h, v| req_obj[h] = v }
req_obj['APIKey'] = auth_data[:apikey] if api_type == :api
req_obj['Reason'] = reason if !reason.nil? && version?('>= 8.4.8449')
Expand Down