rhc 1.35.1 → 1.35.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -61,8 +61,9 @@ module RHC
61
61
  :insecure => [nil, :boolean, "If true, certificate errors will be ignored.\nWARNING: This may allow others to eavesdrop on your communication with OpenShift."],
62
62
  :ssl_version => [nil, nil, 'The SSL protocol version to use when connecting to this server'],
63
63
  :ssl_client_cert_file => [nil, :path_to_file, 'A client certificate file for use with your server'],
64
- :ssl_client_key_file => [nil, :path_to_file, 'The corresponding key for the client certificate'],
64
+ :ssl_client_key_file => [nil, :path_to_file, 'The corresponding key for the client certificate'],
65
65
  :ssl_ca_file => [nil, :path_to_file, 'A file containing CA one or more certificates'],
66
+ :always_auth => [nil, :boolean, 'If true, the client will use an authenticated connection for all requests. Useful for certain client certificate configurations.'],
66
67
  }
67
68
 
68
69
  def self.options_to_config(options, args=OPTIONS.keys)
@@ -10,11 +10,12 @@ module RHC
10
10
  @server_api_versions = []
11
11
  debug "Client supports API versions #{preferred_api_versions.join(', ')}"
12
12
  @client_api_versions = preferred_api_versions
13
+ always_auth = RHC::Helpers.to_boolean(RHC::Config['always_auth'], false)
13
14
  @server_api_versions, @current_api_version, links = api_info({
14
15
  :url => client.url,
15
16
  :method => :get,
16
17
  :accept => :json,
17
- :no_auth => true,
18
+ :no_auth => !always_auth,
18
19
  })
19
20
  debug "Server supports API versions #{@server_api_versions.join(', ')}"
20
21
 
@@ -28,7 +29,7 @@ module RHC
28
29
  :method => :get,
29
30
  :accept => :json,
30
31
  :api_version => api_version_negotiated,
31
- :no_auth => true,
32
+ :no_auth => !always_auth,
32
33
  })
33
34
  end
34
35
  else
@@ -69,9 +69,10 @@ describe RHC::Config do
69
69
  'ssl_ca_file' => 'file2',
70
70
  'timeout' => '1',
71
71
  'use_authorization_tokens' => 'true',
72
+ 'always_auth' => 'false',
72
73
  }
73
74
  end
74
- 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} }
75
+ 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} }
75
76
  end
76
77
  end
77
78
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 153
4
+ hash: 157
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 35
9
- - 1
10
- version: 1.35.1
9
+ - 3
10
+ version: 1.35.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Red Hat
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2015-02-25 00:00:00 Z
18
+ date: 2015-04-10 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: net-ssh
@@ -31,6 +31,14 @@ dependencies:
31
31
  - 0
32
32
  - 11
33
33
  version: 2.0.11
34
+ - - <
35
+ - !ruby/object:Gem::Version
36
+ hash: 45
37
+ segments:
38
+ - 2
39
+ - 9
40
+ - 3
41
+ version: 2.9.3
34
42
  type: :runtime
35
43
  version_requirements: *id001
36
44
  - !ruby/object:Gem::Dependency
@@ -92,6 +100,14 @@ dependencies:
92
100
  - 4
93
101
  - 0
94
102
  version: "4.0"
103
+ - - <
104
+ - !ruby/object:Gem::Version
105
+ hash: 51
106
+ segments:
107
+ - 4
108
+ - 3
109
+ - 0
110
+ version: 4.3.0
95
111
  type: :runtime
96
112
  version_requirements: *id005
97
113
  - !ruby/object:Gem::Dependency