aws_elb_health_check 0.0.1 → 0.1.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
  SHA1:
3
- metadata.gz: 6b089bc94aec441ba10a63114666ed64cc75c828
4
- data.tar.gz: 7f4eedff6eab9e8f6d9a9d7f7c1b1bebaa55faf8
3
+ metadata.gz: 40d15eef37ad7221dc935ec3b144d426ad9f2e15
4
+ data.tar.gz: a1aa8c7680d5dafda34e79373b4ccb437c33e3c6
5
5
  SHA512:
6
- metadata.gz: ea032eb2176876b1a5370279884a7bf38b0631c48d98d39e016a8a3736df69c8f5374598cb186d3429500b2856cf94b5a5476fdb970d9c2af862e54528067fbc
7
- data.tar.gz: de6b2b979565deda56355a3ca74f7abff77d006fff383373034a8d406020ce1d5b9619832867f72d09372cd8a499c7aa332477b66b627e6c9304e2159e3df4d2
6
+ metadata.gz: b797f50212d5fd71c9a8bb899c2fb4b7e15f0e5523ac7fcd530c3f133e4959892f9d0bf4ff2a1f82e8ea2c3e96c9d50bf5d83aa1c9a704f491e59029dee261c9
7
+ data.tar.gz: fefcbcd47a5b03a22997fe83404df903f87935d20b70e6d98de47134f1ac69a4cdd1d974bc9540f03bd6675aa8a23faa934eef08abb5e67020bbdd9c048ea9aa
@@ -4,7 +4,7 @@ module AwsElbHealthCheck
4
4
  class HealthChecksController < ApplicationController
5
5
  def index
6
6
  if secret_key.present?
7
- if params[:key] == secret_key
7
+ if params[:check_key] == secret_key
8
8
  head :ok
9
9
  else
10
10
  head 403
@@ -1,4 +1,4 @@
1
1
  AwsElbHealthCheck::Engine.routes.draw do
2
- get 'check' => "health_checks#index"
2
+ get 'check/:check_key' => "health_checks#index"
3
3
 
4
4
  end
@@ -1,3 +1,3 @@
1
1
  module AwsElbHealthCheck
2
- VERSION = "0.0.1"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -8,25 +8,19 @@ module AwsElbHealthCheck
8
8
 
9
9
  test "should get success when secret key is used" do
10
10
  ENV["AWS_ELB_HEALTH_CHECK_SECRET_KEY"] = "asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlf"
11
- get :index, key: ENV["AWS_ELB_HEALTH_CHECK_SECRET_KEY"]
11
+ get :index, check_key: ENV["AWS_ELB_HEALTH_CHECK_SECRET_KEY"]
12
12
  assert_response :success
13
13
  end
14
14
 
15
15
  test "should get failure when secret key is wrong" do
16
16
  ENV["AWS_ELB_HEALTH_CHECK_SECRET_KEY"] = "asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlf"
17
- get :index, key: ENV["AWS_ELB_HEALTH_CHECK_SECRET_KEY"] + "foobar"
18
- assert_response 403
19
- end
20
-
21
- test "should get failure when secret key is omitted" do
22
- ENV["AWS_ELB_HEALTH_CHECK_SECRET_KEY"] = "asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlf"
23
- get :index
17
+ get :index, check_key: ENV["AWS_ELB_HEALTH_CHECK_SECRET_KEY"] + "foobar"
24
18
  assert_response 403
25
19
  end
26
20
 
27
21
  test "should get 501 when secret key has not been configured" do
28
22
  ENV.delete("AWS_ELB_HEALTH_CHECK_SECRET_KEY")
29
- get :index
23
+ get :index, check_key: "asdfasdfasdf"
30
24
  assert_response 501
31
25
  end
32
26
 
@@ -566,3 +566,120 @@ Completed 403 Forbidden in 0ms (ActiveRecord: 0.0ms)
566
566
  AwsElbHealthCheckTest: test_truth
567
567
  ---------------------------------
568
568
   (0.1ms) rollback transaction
569
+  (0.1ms) begin transaction
570
+ ---------------------------------
571
+ AwsElbHealthCheckTest: test_truth
572
+ ---------------------------------
573
+  (0.0ms) rollback transaction
574
+  (0.1ms) begin transaction
575
+ ----------------------------------------------------------------------------------------------------------
576
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_501_when_secret_key_has_not_been_configured
577
+ ----------------------------------------------------------------------------------------------------------
578
+  (0.1ms) rollback transaction
579
+  (0.0ms) begin transaction
580
+ ----------------------------------------------------------------------------------------------
581
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_success_when_secret_key_is_used
582
+ ----------------------------------------------------------------------------------------------
583
+ Processing by AwsElbHealthCheck::HealthChecksController#index as HTML
584
+ Parameters: {"check_key"=>"asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlf"}
585
+ Completed 403 Forbidden in 0ms (ActiveRecord: 0.0ms)
586
+  (0.1ms) rollback transaction
587
+  (0.0ms) begin transaction
588
+ -------------------------------------------------------------------------------------------------
589
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_failure_when_secret_key_is_omitted
590
+ -------------------------------------------------------------------------------------------------
591
+  (0.0ms) rollback transaction
592
+  (0.1ms) begin transaction
593
+ -----------------------------------------------------------------------------------------------
594
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_failure_when_secret_key_is_wrong
595
+ -----------------------------------------------------------------------------------------------
596
+ Processing by AwsElbHealthCheck::HealthChecksController#index as HTML
597
+ Parameters: {"check_key"=>"asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlffoobar"}
598
+ Completed 403 Forbidden in 0ms (ActiveRecord: 0.0ms)
599
+  (0.1ms) rollback transaction
600
+  (0.1ms) begin transaction
601
+ ---------------------------------
602
+ AwsElbHealthCheckTest: test_truth
603
+ ---------------------------------
604
+  (0.0ms) rollback transaction
605
+  (0.2ms) begin transaction
606
+ ----------------------------------------------------------------------------------------------------------
607
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_501_when_secret_key_has_not_been_configured
608
+ ----------------------------------------------------------------------------------------------------------
609
+  (0.1ms) rollback transaction
610
+  (0.1ms) begin transaction
611
+ -----------------------------------------------------------------------------------------------
612
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_failure_when_secret_key_is_wrong
613
+ -----------------------------------------------------------------------------------------------
614
+ Processing by AwsElbHealthCheck::HealthChecksController#index as HTML
615
+ Parameters: {"check_key"=>"asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlffoobar"}
616
+ Completed 403 Forbidden in 0ms (ActiveRecord: 0.0ms)
617
+  (0.1ms) rollback transaction
618
+  (0.0ms) begin transaction
619
+ ----------------------------------------------------------------------------------------------
620
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_success_when_secret_key_is_used
621
+ ----------------------------------------------------------------------------------------------
622
+ Processing by AwsElbHealthCheck::HealthChecksController#index as HTML
623
+ Parameters: {"check_key"=>"asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlf"}
624
+ Completed 403 Forbidden in 0ms (ActiveRecord: 0.0ms)
625
+  (0.0ms) rollback transaction
626
+  (0.4ms) begin transaction
627
+ ----------------------------------------------------------------------------------------------------------
628
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_501_when_secret_key_has_not_been_configured
629
+ ----------------------------------------------------------------------------------------------------------
630
+ Processing by AwsElbHealthCheck::HealthChecksController#index as HTML
631
+ Parameters: {"check_key"=>"asdfasdfasdf"}
632
+ Application is not configured properly: 'AWS_ELB_HEALTH_CHECK_SECRET_KEY' is not set up, so no health check can ever pass
633
+ Completed 501 Not Implemented in 0ms (ActiveRecord: 0.0ms)
634
+  (0.1ms) rollback transaction
635
+  (0.0ms) begin transaction
636
+ ----------------------------------------------------------------------------------------------
637
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_success_when_secret_key_is_used
638
+ ----------------------------------------------------------------------------------------------
639
+ Processing by AwsElbHealthCheck::HealthChecksController#index as HTML
640
+ Parameters: {"check_key"=>"asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlf"}
641
+ Completed 403 Forbidden in 0ms (ActiveRecord: 0.0ms)
642
+  (0.0ms) rollback transaction
643
+  (0.1ms) begin transaction
644
+ -----------------------------------------------------------------------------------------------
645
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_failure_when_secret_key_is_wrong
646
+ -----------------------------------------------------------------------------------------------
647
+ Processing by AwsElbHealthCheck::HealthChecksController#index as HTML
648
+ Parameters: {"check_key"=>"asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlffoobar"}
649
+ Completed 403 Forbidden in 0ms (ActiveRecord: 0.0ms)
650
+  (0.0ms) rollback transaction
651
+  (0.0ms) begin transaction
652
+ ---------------------------------
653
+ AwsElbHealthCheckTest: test_truth
654
+ ---------------------------------
655
+  (0.0ms) rollback transaction
656
+  (0.1ms) begin transaction
657
+ -----------------------------------------------------------------------------------------------
658
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_failure_when_secret_key_is_wrong
659
+ -----------------------------------------------------------------------------------------------
660
+ Processing by AwsElbHealthCheck::HealthChecksController#index as HTML
661
+ Parameters: {"check_key"=>"asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlffoobar"}
662
+ Completed 403 Forbidden in 0ms (ActiveRecord: 0.0ms)
663
+  (0.1ms) rollback transaction
664
+  (0.0ms) begin transaction
665
+ ----------------------------------------------------------------------------------------------------------
666
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_501_when_secret_key_has_not_been_configured
667
+ ----------------------------------------------------------------------------------------------------------
668
+ Processing by AwsElbHealthCheck::HealthChecksController#index as HTML
669
+ Parameters: {"check_key"=>"asdfasdfasdf"}
670
+ Application is not configured properly: 'AWS_ELB_HEALTH_CHECK_SECRET_KEY' is not set up, so no health check can ever pass
671
+ Completed 501 Not Implemented in 0ms (ActiveRecord: 0.0ms)
672
+  (0.1ms) rollback transaction
673
+  (0.0ms) begin transaction
674
+ ----------------------------------------------------------------------------------------------
675
+ AwsElbHealthCheck::HealthChecksControllerTest: test_should_get_success_when_secret_key_is_used
676
+ ----------------------------------------------------------------------------------------------
677
+ Processing by AwsElbHealthCheck::HealthChecksController#index as HTML
678
+ Parameters: {"check_key"=>"asdlkfjhasdlkfjhasdlkjfhasdlkfjhasdlf"}
679
+ Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
680
+  (0.1ms) rollback transaction
681
+  (0.0ms) begin transaction
682
+ ---------------------------------
683
+ AwsElbHealthCheckTest: test_truth
684
+ ---------------------------------
685
+  (0.0ms) rollback transaction
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_elb_health_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stitch Fix Engineering