health_monitor_lb 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0008cd590689ec08663474c8191020007bbbba1246ea4a976c21eae58ab393df'
4
- data.tar.gz: c88511fd785bda3ca643f1edb5f06faaf6e41088db935d29fffe85757854943c
3
+ metadata.gz: 33a8a365928de710968a78865c71c6be2dd2157c47fd1017f931cbabcb2d8f8d
4
+ data.tar.gz: e17937a0336bb1bd79f29f90f6f88461046e2d1f9730830c4654cfd08912d3eb
5
5
  SHA512:
6
- metadata.gz: ce5528044b4d8d8cd8125ea550ecad3e74b9d6fb9a0cd72a186b7d73e04e82bcf6a51c6c2ce0d86fad4cc7e47825c506b5a37d469be584d37f5a8a4341ccdb91
7
- data.tar.gz: d4cdffd84fe43b064d04135b6f1b61232205f08f021b73e5dd00099eff81f2a4c5c0846519d2e227a47f944009a173bf49ffc5b93425ea3a674b0986342076fb
6
+ metadata.gz: 6a63c5da1569c815d301a7b4d9033c2a4a92ffa751a6b4cdf16fbe77f70932725330cda76151b8ac110110f6c5613dc4b7f8da7baf1635497743e7fffcdcbd3f
7
+ data.tar.gz: 476956f78d397b1625805be5a1f0cf68838de3a559559d5bbcb423d84d9cdaf47515a8d64a1166df11079e82e8da84a37938f1e65ed294c805f45c27c0d53154
@@ -3,6 +3,12 @@ module HealthMonitorLb
3
3
  before_action :check_api_token
4
4
 
5
5
  def check_api_token
6
+ class << request
7
+ def port
8
+ 80
9
+ end
10
+ end
11
+
6
12
  if ENV['HEALTH_MONITOR_API_TOKEN'].present? && (params['API_TOKEN'] != ENV['HEALTH_MONITOR_API_TOKEN'])
7
13
  render json: 'unauthorized', status: :unauthorized
8
14
  end
@@ -1,7 +1,5 @@
1
1
  module HealthMonitorLb
2
2
  class HealthController < ApplicationController
3
- before_action :disable_ssl, only: :disable_ssl_actions
4
-
5
3
  def index
6
4
  status = HealthCheckService.new.call
7
5
 
@@ -11,17 +9,5 @@ module HealthMonitorLb
11
9
 
12
10
  render json: status, status: :ok
13
11
  end
14
-
15
- def disable_ssl
16
- # This is a workaround for the issue with SSL termination in AWS ELB
17
- # where the health check URL is not accessible over HTTP.
18
- redirect_to request.url.gsub(/https/i, 'http') if request.ssl?
19
- end
20
-
21
- def disable_ssl_actions
22
- actions = []
23
- actions << :index unless ENV['ENABLE_HEALTH_CHECK_SSL']
24
- actions
25
- end
26
12
  end
27
13
  end
@@ -1,3 +1,3 @@
1
1
  module HealthMonitorLb
2
- VERSION = '1.2.1'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
@@ -209,3 +209,12 @@ Completed 200 OK in 112ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 385
209
209
  Processing by HealthMonitorLb::HealthController#index as HTML
210
210
  Parameters: {"API_TOKEN"=>"[FILTERED]"}
211
211
  Completed 200 OK in 106ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 185)
212
+ Processing by HealthMonitorLb::HealthController#index as HTML
213
+ Filter chain halted as :check_api_token rendered or redirected
214
+ Completed 401 Unauthorized in 0ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 295)
215
+ Processing by HealthMonitorLb::HealthController#index as HTML
216
+ Parameters: {"API_TOKEN"=>"[FILTERED]"}
217
+ Completed 200 OK in 117ms (Views: 0.2ms | ActiveRecord: 0.0ms | Allocations: 402)
218
+ Processing by HealthMonitorLb::HealthController#index as HTML
219
+ Parameters: {"API_TOKEN"=>"[FILTERED]"}
220
+ Completed 200 OK in 102ms (Views: 0.1ms | ActiveRecord: 0.0ms | Allocations: 202)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: health_monitor_lb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alan Hecht