omniauth-chef 0.2.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.gitignore +1 -0
- data/lib/omniauth-chef.rb +0 -1
- data/lib/omniauth-chef/version.rb +1 -1
- data/lib/omniauth/strategies/chef.rb +10 -3
- data/omniauth-chef.gemspec +5 -6
- data/spec/omniauth/strategies/chef_spec.rb +9 -0
- metadata +34 -43
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
MzM4MzI4MTYzYzg0ZmVmMjU3ZjA5NzM4NDdmNzViZWMwNjM2NTFhMQ==
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2598a4b153d54f1fe207a2ad9c9703a0e8e68558120d28d523cd8f2b9aa65017
|
4
|
+
data.tar.gz: 4eddfaf9edd36bad38ec5097f02c931f7add9acc96b9f97e0046f18c3d9263ee
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
YmEzM2VhMzQ0ZjRmYzhlZDc3YzZjOTdhZjRkMjhkM2U0NWVjZjE0Zjk0NWNl
|
11
|
-
MjZmNzNiYTYyMGNkYjdiZmUzN2Y2ZDdmZTllNTczNmFlNjNkYjU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OWZlZTNkODBjMjlmYjE1NjFmZjhiNzEyMWI5ZDJjZjUzZTJiYjdlMDBjMDVh
|
14
|
-
NmMwODRjMjFlMDc1NjgzZjA1OTA0YjRlYzA0YjQ3ZTZkNTAzMDYwZjE0ZWIz
|
15
|
-
ZjcxMTBlMDcwMWYxNmVlMjQyZTM1MGEyYTNjYjAxY2YzZTFlM2Y=
|
6
|
+
metadata.gz: dfc95e35ae4a02ee6f6a46d91f2dabe13eff3dff423a2d35050f8b412781fd2d4933f05613b3264a06ae0808fc42dd861777ab3f0b43fa80795e125872d4af49
|
7
|
+
data.tar.gz: fb45ed24e9347dcc71eab6ad833a3258e138c5321ed856333c2ff66ac9edbace455b8d0fcf1513d628d91a43e3960132fd95fbfbebb635869a027ccd302b4b53
|
data/.gitignore
CHANGED
data/lib/omniauth-chef.rb
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
|
17
17
|
require 'chef'
|
18
|
+
require 'chef/config'
|
18
19
|
require 'omniauth'
|
19
20
|
|
20
21
|
module OmniAuth
|
@@ -23,6 +24,7 @@ module OmniAuth
|
|
23
24
|
include OmniAuth::Strategy
|
24
25
|
|
25
26
|
option :endpoint, 'https://api.opscode.piab'
|
27
|
+
option :ssl_verify_mode, :verify_peer
|
26
28
|
option :fields, [:name, :password]
|
27
29
|
option :headers, { }
|
28
30
|
option :organization, nil
|
@@ -30,6 +32,7 @@ module OmniAuth
|
|
30
32
|
option :source, 'web'
|
31
33
|
option :superuser, 'pivotal'
|
32
34
|
option :key_path, '../../../../config/webui_priv.pem'
|
35
|
+
option :key_data, nil
|
33
36
|
option :uid, :name
|
34
37
|
|
35
38
|
def callback_phase
|
@@ -80,7 +83,8 @@ module OmniAuth
|
|
80
83
|
end
|
81
84
|
|
82
85
|
def chef
|
83
|
-
::Chef::
|
86
|
+
::Chef::Config.ssl_verify_mode options.ssl_verify_mode.to_sym
|
87
|
+
::Chef::ServerAPI.new endpoint, parameters
|
84
88
|
end
|
85
89
|
|
86
90
|
def endpoint
|
@@ -92,7 +96,7 @@ module OmniAuth
|
|
92
96
|
end
|
93
97
|
|
94
98
|
def key
|
95
|
-
IO.read(File.expand_path(options.key_path, __FILE__)).strip
|
99
|
+
options.key_data || IO.read(File.expand_path(options.key_path, __FILE__)).strip
|
96
100
|
end
|
97
101
|
|
98
102
|
def organization
|
@@ -100,7 +104,10 @@ module OmniAuth
|
|
100
104
|
end
|
101
105
|
|
102
106
|
def parameters
|
103
|
-
{ headers: headers,
|
107
|
+
{ headers: headers,
|
108
|
+
client_name: options.superuser,
|
109
|
+
client_key: nil,
|
110
|
+
raw_key: key }
|
104
111
|
end
|
105
112
|
|
106
113
|
def password
|
data/omniauth-chef.gemspec
CHANGED
@@ -24,12 +24,11 @@ Gem::Specification.new do |spec|
|
|
24
24
|
|
25
25
|
spec.require_paths = %w(lib)
|
26
26
|
|
27
|
-
spec.add_development_dependency 'bundler', '~> 1.5'
|
28
27
|
spec.add_development_dependency 'guard-rspec', '~> 4.2'
|
29
|
-
spec.add_development_dependency 'rack-test', '~>
|
30
|
-
spec.add_development_dependency 'rake', '~>
|
31
|
-
spec.add_development_dependency 'rspec', '~>
|
28
|
+
spec.add_development_dependency 'rack-test', '~> 1'
|
29
|
+
spec.add_development_dependency 'rake', '~> 13'
|
30
|
+
spec.add_development_dependency 'rspec', '~> 3'
|
32
31
|
|
33
|
-
spec.add_runtime_dependency 'chef', '~>
|
34
|
-
spec.add_runtime_dependency 'omniauth', '~>
|
32
|
+
spec.add_runtime_dependency 'chef', '~> 17'
|
33
|
+
spec.add_runtime_dependency 'omniauth', '~> 2.0', '>= 2.0.4' # required for CVE-2015-9284
|
35
34
|
end
|
@@ -77,6 +77,15 @@ describe OmniAuth::Strategies::Chef do
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
+
describe 'option :key_data' do
|
81
|
+
context 'default: nil' do
|
82
|
+
it do
|
83
|
+
expect(subject.options.key_data).to eq(nil)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
|
80
89
|
describe 'option :uid' do
|
81
90
|
context ':name' do
|
82
91
|
it { expect(subject.options.uid).to eq(:name) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Casey
|
@@ -9,113 +9,105 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
-
- !ruby/object:Gem::Dependency
|
15
|
-
name: bundler
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
requirements:
|
18
|
-
- - ~>
|
19
|
-
- !ruby/object:Gem::Version
|
20
|
-
version: '1.5'
|
21
|
-
type: :development
|
22
|
-
prerelease: false
|
23
|
-
version_requirements: !ruby/object:Gem::Requirement
|
24
|
-
requirements:
|
25
|
-
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
version: '1.5'
|
28
14
|
- !ruby/object:Gem::Dependency
|
29
15
|
name: guard-rspec
|
30
16
|
requirement: !ruby/object:Gem::Requirement
|
31
17
|
requirements:
|
32
|
-
- - ~>
|
18
|
+
- - "~>"
|
33
19
|
- !ruby/object:Gem::Version
|
34
20
|
version: '4.2'
|
35
21
|
type: :development
|
36
22
|
prerelease: false
|
37
23
|
version_requirements: !ruby/object:Gem::Requirement
|
38
24
|
requirements:
|
39
|
-
- - ~>
|
25
|
+
- - "~>"
|
40
26
|
- !ruby/object:Gem::Version
|
41
27
|
version: '4.2'
|
42
28
|
- !ruby/object:Gem::Dependency
|
43
29
|
name: rack-test
|
44
30
|
requirement: !ruby/object:Gem::Requirement
|
45
31
|
requirements:
|
46
|
-
- - ~>
|
32
|
+
- - "~>"
|
47
33
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
34
|
+
version: '1'
|
49
35
|
type: :development
|
50
36
|
prerelease: false
|
51
37
|
version_requirements: !ruby/object:Gem::Requirement
|
52
38
|
requirements:
|
53
|
-
- - ~>
|
39
|
+
- - "~>"
|
54
40
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
41
|
+
version: '1'
|
56
42
|
- !ruby/object:Gem::Dependency
|
57
43
|
name: rake
|
58
44
|
requirement: !ruby/object:Gem::Requirement
|
59
45
|
requirements:
|
60
|
-
- - ~>
|
46
|
+
- - "~>"
|
61
47
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
48
|
+
version: '13'
|
63
49
|
type: :development
|
64
50
|
prerelease: false
|
65
51
|
version_requirements: !ruby/object:Gem::Requirement
|
66
52
|
requirements:
|
67
|
-
- - ~>
|
53
|
+
- - "~>"
|
68
54
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
55
|
+
version: '13'
|
70
56
|
- !ruby/object:Gem::Dependency
|
71
57
|
name: rspec
|
72
58
|
requirement: !ruby/object:Gem::Requirement
|
73
59
|
requirements:
|
74
|
-
- - ~>
|
60
|
+
- - "~>"
|
75
61
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
62
|
+
version: '3'
|
77
63
|
type: :development
|
78
64
|
prerelease: false
|
79
65
|
version_requirements: !ruby/object:Gem::Requirement
|
80
66
|
requirements:
|
81
|
-
- - ~>
|
67
|
+
- - "~>"
|
82
68
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
69
|
+
version: '3'
|
84
70
|
- !ruby/object:Gem::Dependency
|
85
71
|
name: chef
|
86
72
|
requirement: !ruby/object:Gem::Requirement
|
87
73
|
requirements:
|
88
|
-
- - ~>
|
74
|
+
- - "~>"
|
89
75
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
76
|
+
version: '17'
|
91
77
|
type: :runtime
|
92
78
|
prerelease: false
|
93
79
|
version_requirements: !ruby/object:Gem::Requirement
|
94
80
|
requirements:
|
95
|
-
- - ~>
|
81
|
+
- - "~>"
|
96
82
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
83
|
+
version: '17'
|
98
84
|
- !ruby/object:Gem::Dependency
|
99
85
|
name: omniauth
|
100
86
|
requirement: !ruby/object:Gem::Requirement
|
101
87
|
requirements:
|
102
|
-
- - ~>
|
88
|
+
- - "~>"
|
103
89
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
90
|
+
version: '2.0'
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 2.0.4
|
105
94
|
type: :runtime
|
106
95
|
prerelease: false
|
107
96
|
version_requirements: !ruby/object:Gem::Requirement
|
108
97
|
requirements:
|
109
|
-
- - ~>
|
98
|
+
- - "~>"
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '2.0'
|
101
|
+
- - ">="
|
110
102
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
103
|
+
version: 2.0.4
|
112
104
|
description: OmniAuth strategy for Chef
|
113
105
|
email: james@getchef.com a@getchef.com
|
114
106
|
executables: []
|
115
107
|
extensions: []
|
116
108
|
extra_rdoc_files: []
|
117
109
|
files:
|
118
|
-
- .gitignore
|
110
|
+
- ".gitignore"
|
119
111
|
- Gemfile
|
120
112
|
- Rakefile
|
121
113
|
- lib/omniauth-chef.rb
|
@@ -134,17 +126,16 @@ require_paths:
|
|
134
126
|
- lib
|
135
127
|
required_ruby_version: !ruby/object:Gem::Requirement
|
136
128
|
requirements:
|
137
|
-
- -
|
129
|
+
- - ">="
|
138
130
|
- !ruby/object:Gem::Version
|
139
131
|
version: '0'
|
140
132
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
133
|
requirements:
|
142
|
-
- -
|
134
|
+
- - ">="
|
143
135
|
- !ruby/object:Gem::Version
|
144
136
|
version: '0'
|
145
137
|
requirements: []
|
146
|
-
|
147
|
-
rubygems_version: 2.4.5
|
138
|
+
rubygems_version: 3.1.4
|
148
139
|
signing_key:
|
149
140
|
specification_version: 4
|
150
141
|
summary: OmniAuth strategy for Chef
|