bosh-director 1.2849.0 → 1.2852.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/bosh-director +3 -60
- data/lib/bosh/director.rb +2 -0
- data/lib/bosh/director/api/controllers/base_controller.rb +4 -2
- data/lib/bosh/director/api/controllers/info_controller.rb +1 -1
- data/lib/bosh/director/api/route_configuration.rb +52 -0
- data/lib/bosh/director/api/uaa_identity_provider.rb +11 -0
- data/lib/bosh/director/version.rb +1 -1
- metadata +23 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86bc089c44d0d0e6201618431ff094a315d78962
|
4
|
+
data.tar.gz: 289373e4cfb90cf3d807f7dd20fbcc16aef13de3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b22c8b1e8e3de1c7a036bcfc09fe3a88016942c84a23b47e9918cff0d5f66961ba810e65217c754379a5e8777301698bee689ba3eace316c845d23c9de6f93bf
|
7
|
+
data.tar.gz: 8ea28532cacae44e70583d9e6f885aa85fd97fa63533f33d5d27d41071d29f102fb198bc87d33e5390b638940156df5c466d2d0d9b456ac14c7ce1fc8621dc6d
|
data/bin/bosh-director
CHANGED
@@ -16,70 +16,13 @@ opts.parse!(ARGV.dup)
|
|
16
16
|
config_file ||= ::File.expand_path('../../config/bosh-director.yml', __FILE__)
|
17
17
|
config = Bosh::Director::Config.load_file(config_file)
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
compiled_package_group_manager = Bosh::Director::Api::CompiledPackageGroupManager.new
|
22
|
-
resource_manager = Bosh::Director::Api::ResourceManager.new(director_app.blobstores.blobstore)
|
23
|
-
# user_management_hash = config.hash['user_management']
|
24
|
-
identity_provider = #if user_management_hash && user_management_hash['provider'] == 'uaa'
|
25
|
-
# Bosh::Director::Api::UaaIdentityProvider.new
|
26
|
-
# else
|
27
|
-
Bosh::Director::Api::LocalIdentityProvider.new Bosh::Director::Api::UserManager.new
|
28
|
-
# end
|
19
|
+
route_configuration = Bosh::Director::Api::RouteConfiguration.new(config)
|
29
20
|
|
30
21
|
thin_server = Thin::Server.new('127.0.0.1', config.hash['port'], signals: false) do
|
31
22
|
use Rack::CommonLogger
|
32
23
|
|
33
|
-
|
34
|
-
run
|
35
|
-
end
|
36
|
-
|
37
|
-
map '/tasks' do
|
38
|
-
run Bosh::Director::Api::Controllers::TasksController.new identity_provider
|
39
|
-
end
|
40
|
-
|
41
|
-
map '/backups' do
|
42
|
-
run Bosh::Director::Api::Controllers::BackupsController.new identity_provider
|
43
|
-
end
|
44
|
-
|
45
|
-
map '/deployments' do
|
46
|
-
run Bosh::Director::Api::Controllers::DeploymentsController.new identity_provider
|
47
|
-
end
|
48
|
-
|
49
|
-
map '/packages' do
|
50
|
-
run Bosh::Director::Api::Controllers::PackagesController.new identity_provider
|
51
|
-
end
|
52
|
-
|
53
|
-
map '/releases' do
|
54
|
-
run Bosh::Director::Api::Controllers::ReleasesController.new identity_provider
|
55
|
-
end
|
56
|
-
|
57
|
-
map '/resources' do
|
58
|
-
run Bosh::Director::Api::Controllers::ResourcesController.new identity_provider, resource_manager
|
59
|
-
end
|
60
|
-
|
61
|
-
map '/resurrection' do
|
62
|
-
run Bosh::Director::Api::Controllers::ResurrectionController.new identity_provider
|
63
|
-
end
|
64
|
-
|
65
|
-
map '/stemcells' do
|
66
|
-
run Bosh::Director::Api::Controllers::StemcellsController.new identity_provider
|
67
|
-
end
|
68
|
-
|
69
|
-
map '/task' do
|
70
|
-
run Bosh::Director::Api::Controllers::TaskController.new identity_provider
|
71
|
-
end
|
72
|
-
|
73
|
-
map '/users' do
|
74
|
-
run Bosh::Director::Api::Controllers::UsersController.new identity_provider
|
75
|
-
end
|
76
|
-
|
77
|
-
map '/compiled_package_groups' do
|
78
|
-
run Bosh::Director::Api::Controllers::CompiledPackagesController.new identity_provider, compiled_package_group_manager
|
79
|
-
end
|
80
|
-
|
81
|
-
map '/locks' do
|
82
|
-
run Bosh::Director::Api::Controllers::LocksController.new identity_provider
|
24
|
+
route_configuration.controllers.each do |route, controller|
|
25
|
+
map(route) { run controller }
|
83
26
|
end
|
84
27
|
end
|
85
28
|
|
data/lib/bosh/director.rb
CHANGED
@@ -132,6 +132,7 @@ require 'bosh/director/models/helpers/model_helper'
|
|
132
132
|
require 'bosh/director/db_backup'
|
133
133
|
require 'bosh/director/blobstores'
|
134
134
|
require 'bosh/director/api/local_identity_provider'
|
135
|
+
require 'bosh/director/api/uaa_identity_provider'
|
135
136
|
require 'bosh/director/app'
|
136
137
|
|
137
138
|
module Bosh::Director
|
@@ -152,3 +153,4 @@ require 'bosh/director/api/controllers/task_controller'
|
|
152
153
|
require 'bosh/director/api/controllers/users_controller'
|
153
154
|
require 'bosh/director/api/controllers/compiled_packages_controller'
|
154
155
|
require 'bosh/director/api/controllers/locks_controller'
|
156
|
+
require 'bosh/director/api/route_configuration'
|
@@ -27,6 +27,8 @@ module Bosh::Director
|
|
27
27
|
mime_type :tgz, 'application/x-compressed'
|
28
28
|
mime_type :multipart, 'multipart/form-data'
|
29
29
|
|
30
|
+
attr_reader :identity_provider
|
31
|
+
|
30
32
|
def self.consumes(*types)
|
31
33
|
types = Set.new(types)
|
32
34
|
types.map! { |t| mime_type(t) }
|
@@ -39,7 +41,7 @@ module Bosh::Director
|
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
42
|
-
def
|
44
|
+
def requires_authentication?
|
43
45
|
true
|
44
46
|
end
|
45
47
|
|
@@ -48,7 +50,7 @@ module Bosh::Director
|
|
48
50
|
request.env.has_key?(key)
|
49
51
|
end
|
50
52
|
|
51
|
-
if auth_provided ||
|
53
|
+
if auth_provided || requires_authentication?
|
52
54
|
begin
|
53
55
|
@user = @identity_provider.corroborate_user(request.env)
|
54
56
|
rescue AuthenticationError => e
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module Bosh
|
2
|
+
module Director
|
3
|
+
module Api
|
4
|
+
class RouteConfiguration
|
5
|
+
def initialize(config)
|
6
|
+
@config = config
|
7
|
+
end
|
8
|
+
|
9
|
+
def controllers
|
10
|
+
director_app = Bosh::Director::App.new(@config)
|
11
|
+
controllers = {}
|
12
|
+
controllers['/info'] = Bosh::Director::Api::Controllers::InfoController.new identity_provider
|
13
|
+
controllers['/tasks'] = Bosh::Director::Api::Controllers::TasksController.new identity_provider
|
14
|
+
controllers['/backups'] = Bosh::Director::Api::Controllers::BackupsController.new identity_provider
|
15
|
+
controllers['/deployments'] = Bosh::Director::Api::Controllers::DeploymentsController.new identity_provider
|
16
|
+
controllers['/packages'] = Bosh::Director::Api::Controllers::PackagesController.new identity_provider
|
17
|
+
controllers['/releases'] = Bosh::Director::Api::Controllers::ReleasesController.new identity_provider
|
18
|
+
controllers['/resources'] = Bosh::Director::Api::Controllers::ResourcesController.new(
|
19
|
+
identity_provider,
|
20
|
+
Bosh::Director::Api::ResourceManager.new(director_app.blobstores.blobstore)
|
21
|
+
)
|
22
|
+
controllers['/resurrection'] = Bosh::Director::Api::Controllers::ResurrectionController.new identity_provider
|
23
|
+
controllers['/stemcells'] = Bosh::Director::Api::Controllers::StemcellsController.new identity_provider
|
24
|
+
controllers['/task'] = Bosh::Director::Api::Controllers::TaskController.new identity_provider
|
25
|
+
controllers['/users'] = Bosh::Director::Api::Controllers::UsersController.new identity_provider
|
26
|
+
controllers['/compiled_package_groups'] = Bosh::Director::Api::Controllers::CompiledPackagesController.new(
|
27
|
+
identity_provider,
|
28
|
+
Bosh::Director::Api::CompiledPackageGroupManager.new
|
29
|
+
)
|
30
|
+
controllers['/locks'] = Bosh::Director::Api::Controllers::LocksController.new identity_provider
|
31
|
+
controllers
|
32
|
+
end
|
33
|
+
|
34
|
+
private
|
35
|
+
|
36
|
+
def identity_provider
|
37
|
+
@identity_provider ||= begin
|
38
|
+
user_management = @config.hash['user_management']
|
39
|
+
|
40
|
+
if user_management && user_management['provider'] == 'uaa'
|
41
|
+
Bosh::Director::Api::UAAIdentityProvider.new
|
42
|
+
else
|
43
|
+
Bosh::Director::Api::LocalIdentityProvider.new Bosh::Director::Api::UserManager.new
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-director
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2852.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt-ruby
|
@@ -30,126 +30,126 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
33
|
+
version: 1.2852.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
40
|
+
version: 1.2852.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bosh-core
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.2852.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.2852.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bosh-director-core
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.
|
61
|
+
version: 1.2852.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.
|
68
|
+
version: 1.2852.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bosh_common
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1.
|
75
|
+
version: 1.2852.0
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1.
|
82
|
+
version: 1.2852.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bosh-template
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.
|
89
|
+
version: 1.2852.0
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.
|
96
|
+
version: 1.2852.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: bosh_cpi
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.2852.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.
|
110
|
+
version: 1.2852.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: bosh_openstack_cpi
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
117
|
+
version: 1.2852.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
124
|
+
version: 1.2852.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: bosh_aws_cpi
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.2852.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: 1.2852.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: bosh_vsphere_cpi
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - "~>"
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 1.
|
145
|
+
version: 1.2852.0
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 1.
|
152
|
+
version: 1.2852.0
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: bosh_vcloud_cpi
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -446,7 +446,7 @@ dependencies:
|
|
446
446
|
version: '0'
|
447
447
|
description: |-
|
448
448
|
BOSH Director
|
449
|
-
|
449
|
+
d8b022
|
450
450
|
email: support@cloudfoundry.com
|
451
451
|
executables:
|
452
452
|
- bosh-director
|
@@ -530,11 +530,13 @@ files:
|
|
530
530
|
- lib/bosh/director/api/release_manager.rb
|
531
531
|
- lib/bosh/director/api/resource_manager.rb
|
532
532
|
- lib/bosh/director/api/resurrector_manager.rb
|
533
|
+
- lib/bosh/director/api/route_configuration.rb
|
533
534
|
- lib/bosh/director/api/snapshot_manager.rb
|
534
535
|
- lib/bosh/director/api/stemcell_manager.rb
|
535
536
|
- lib/bosh/director/api/task_helper.rb
|
536
537
|
- lib/bosh/director/api/task_manager.rb
|
537
538
|
- lib/bosh/director/api/task_remover.rb
|
539
|
+
- lib/bosh/director/api/uaa_identity_provider.rb
|
538
540
|
- lib/bosh/director/api/user_manager.rb
|
539
541
|
- lib/bosh/director/api/vm_state_manager.rb
|
540
542
|
- lib/bosh/director/app.rb
|