summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2015-12-10 10:30:12 +0000
committerThom May <thom@may.lt>2015-12-10 10:30:12 +0000
commit68f298faeec0f66e2bbd4e8ebfcb26ec1008b82e (patch)
tree1ca5b47126874296f889a577a2057149e8858016
parent73827f16f237e820ebbac5a6f707d82887ad0446 (diff)
parente88b8d345053ac8ebe1f273326178b7cc27b0845 (diff)
downloadchef-68f298faeec0f66e2bbd4e8ebfcb26ec1008b82e.tar.gz
Merge pull request #4248 from chef/tm/fix_reg_tests_2
expose HTTP options
-rw-r--r--lib/chef/http.rb2
-rw-r--r--spec/unit/api_client/registration_spec.rb3
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/http.rb b/lib/chef/http.rb
index 4f08dc90b2..9f1eeed55f 100644
--- a/lib/chef/http.rb
+++ b/lib/chef/http.rb
@@ -74,6 +74,7 @@ class Chef
attr_reader :sign_on_redirect
attr_reader :redirect_limit
+ attr_reader :options
attr_reader :middlewares
# Create a HTTP client object. The supplied +url+ is used as the base for
@@ -86,6 +87,7 @@ class Chef
@sign_on_redirect = true
@redirects_followed = 0
@redirect_limit = 10
+ @options = options
@middlewares = []
self.class.middlewares.each do |middleware_class|
diff --git a/spec/unit/api_client/registration_spec.rb b/spec/unit/api_client/registration_spec.rb
index 05d1793a4a..58d64990f3 100644
--- a/spec/unit/api_client/registration_spec.rb
+++ b/spec/unit/api_client/registration_spec.rb
@@ -94,6 +94,9 @@ describe Chef::ApiClient::Registration do
it "has an HTTP client configured with validator credentials" do
expect(registration.http_api).to be_a_kind_of(Chef::ServerAPI)
+ expect(registration.http_api.options[:client_name]).to eq("test-validator")
+ auth = registration.http_api.middlewares.select { |klass| klass.kind_of? Chef::HTTP::Authenticator }.first
+ expect(auth.client_name).to eq("test-validator")
end
describe "when creating/updating the client on the server" do