bosh-monitor 1.2671.0 → 1.2681.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 791956fdc8180c70ff4d723a4eba66aeb5563e57
4
- data.tar.gz: 197132c5bbb993ef4370dbc19cfe3a11597058ef
3
+ metadata.gz: efd7f59aa1217707b0e778857eaa6e501c7bfd91
4
+ data.tar.gz: 7836f292481fe3282ef5d61ce6f3fc6f4d7c381b
5
5
  SHA512:
6
- metadata.gz: dc662594e8dafae25ceb5d37a2f9b6e54e9473fba8feaea57e15f691f3165996e1e7003369317c38c8dddac8bf8cfef930f8655463617e22e29c001067a7a322
7
- data.tar.gz: 7572fb18db5b1d0f2338c7f18a041d3cfd866bc90248fc8e4febaa45796ad1e34e1efec792037493d685a0004c1ec00ddda5c5c931e8df946372bf7a49f56967
6
+ metadata.gz: aa5ab8bff1c45ebffa9705801e5dceda7eb547d975fc2c8d17690ef657449e932565f6561e3c68cf0c7c7995897da85313e274e076b441fa0dcaab4c1fa90a20
7
+ data.tar.gz: 1f965f07790e1d8d598262e3145335079eab762cc7c15c2d2802a203f228971cfaa5a8898282b7af191de6079b92ae7d8c6735998b42d38daaa9172d8dc1dfa5
@@ -8,11 +8,28 @@ module Bosh::Monitor
8
8
  set(:dump_errors, false)
9
9
  end
10
10
 
11
+ helpers do
12
+ def protected!
13
+ return if authorized?
14
+ headers['WWW-Authenticate'] = ''
15
+ halt 401, 'Unauthorized'
16
+ end
17
+
18
+ def authorized?
19
+ @auth ||= Rack::Auth::Basic::Request.new(request.env)
20
+ @auth.provided? and @auth.basic? and @auth.credentials and @auth.credentials == [Bhm.http_user, Bhm.http_password]
21
+ end
22
+ end
23
+
11
24
  get "/varz" do
25
+ protected!
12
26
  content_type(:json)
13
27
  Yajl::Encoder.encode(Bhm.varz, :terminator => "\n")
14
28
  end
15
29
 
30
+ get "/healthz" do
31
+ 200
32
+ end
16
33
  end
17
34
 
18
35
  end
@@ -85,9 +85,6 @@ module Bosh::Monitor
85
85
  @logger.info "HTTP server is starting on port #{Bhm.http_port}..."
86
86
  @http_server = Thin::Server.new("0.0.0.0", Bhm.http_port, :signals => false) do
87
87
  Thin::Logging.silent = true
88
- use Rack::Auth::Basic do |user, password|
89
- [ user, password ] == [ Bhm.http_user, Bhm.http_password ]
90
- end
91
88
  map "/" do
92
89
  run Bhm::ApiController.new
93
90
  end
@@ -1,5 +1,5 @@
1
1
  module Bosh
2
2
  module Monitor
3
- VERSION = '1.2671.0'
3
+ VERSION = '1.2681.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh-monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2671.0
4
+ version: 1.2681.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - VMware
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-31 00:00:00.000000000 Z
11
+ date: 2014-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: eventmachine
@@ -138,7 +138,7 @@ dependencies:
138
138
  version: 1.6.0
139
139
  description: |-
140
140
  BOSH Health Monitor
141
- 03191d
141
+ c8f6a2
142
142
  email: support@cloudfoundry.com
143
143
  executables:
144
144
  - bosh-monitor-console