From ec5ce8c2444c18fd28b4f1c5b66fc0731429013a Mon Sep 17 00:00:00 2001 From: Jake Helbig Date: Wed, 30 Sep 2026 16:47:36 -0500 Subject: [PATCH] included domain option in configuration to reduce confusion when dealing with domain inclusion in usernames --- lib/passwordstate/client.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/passwordstate/client.rb b/lib/passwordstate/client.rb index cd6a5d8..fb2d835 100644 --- a/lib/passwordstate/client.rb +++ b/lib/passwordstate/client.rb @@ -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) @@ -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')