Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Merge pull request #674 from dobbymoodge/always-auth-BZ1187806
Browse files Browse the repository at this point in the history
Merged by openshift-bot
  • Loading branch information
OpenShift Bot committed Mar 13, 2015
2 parents 1d10a7f + d0f0e6a commit 5d6d908
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/rhc/config.rb
Expand Up @@ -61,8 +61,9 @@ class Config
:insecure => [nil, :boolean, "If true, certificate errors will be ignored.\nWARNING: This may allow others to eavesdrop on your communication with OpenShift."],
:ssl_version => [nil, nil, 'The SSL protocol version to use when connecting to this server'],
:ssl_client_cert_file => [nil, :path_to_file, 'A client certificate file for use with your server'],
:ssl_client_key_file => [nil, :path_to_file, 'The corresponding key for the client certificate'],
:ssl_client_key_file => [nil, :path_to_file, 'The corresponding key for the client certificate'],
:ssl_ca_file => [nil, :path_to_file, 'A file containing CA one or more certificates'],
:always_auth => [nil, :boolean, 'If true, the client will use an authenticated connection for all requests. Useful for certain client certificate configurations.'],
}

def self.options_to_config(options, args=OPTIONS.keys)
Expand Down
4 changes: 2 additions & 2 deletions lib/rhc/rest/api.rb
Expand Up @@ -14,7 +14,7 @@ def initialize(client, preferred_api_versions=[])
:url => client.url,
:method => :get,
:accept => :json,
:no_auth => true,
:no_auth => !RHC::Config['always_auth'],
})
debug "Server supports API versions #{@server_api_versions.join(', ')}"

Expand All @@ -28,7 +28,7 @@ def initialize(client, preferred_api_versions=[])
:method => :get,
:accept => :json,
:api_version => api_version_negotiated,
:no_auth => true,
:no_auth => !RHC::Config['always_auth'],
})
end
else
Expand Down
3 changes: 2 additions & 1 deletion spec/rhc/config_spec.rb
Expand Up @@ -69,9 +69,10 @@
'ssl_ca_file' => 'file2',
'timeout' => '1',
'use_authorization_tokens' => 'true',
'always_auth' => 'false',
}
end
its(:to_options){ should == {:insecure => true, :timeout => 1, :ssl_ca_file => 'file2', :ssl_client_cert_file => 'file1', :rhlogin => 'user', :password => 'pass', :server => 'test.com', :use_authorization_tokens => true} }
its(:to_options){ should == {:insecure => true, :timeout => 1, :ssl_ca_file => 'file2', :ssl_client_cert_file => 'file1', :rhlogin => 'user', :password => 'pass', :server => 'test.com', :use_authorization_tokens => true, :always_auth => false} }
end
end

Expand Down

0 comments on commit 5d6d908

Please sign in to comment.