Skip to content

Commit

Permalink
Use strict Base64 encoding to fix base64 encoding/netty issue (#59)
Browse files Browse the repository at this point in the history
* Update check-es-node-status.rb

* Update check-es-circuit-breakers.rb

* Update check-es-cluster-status.rb

* Update metrics-es-node.rb

* Update check-es-heap.rb

* Update check-es-file-descriptors.rb

* Update metrics-es-cluster.rb

* Update metrics-es-node-graphite.rb

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md
  • Loading branch information
msblum authored and majormoses committed May 8, 2017
1 parent f736c05 commit 12f1808
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)

## [Unreleased]
### Fixed
- Use strict Base64 encoding to fix base64 encoding/netty issue (@msblum)

## [1.2.0] - 2017-05-03
### Fixed
- metrics-es-cluster.rb: Check to see if cluster key exists in transient_settings before trying to use it. (@RAR)
Expand Down
2 changes: 1 addition & 1 deletion bin/check-es-circuit-breakers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ESCircuitBreaker < Sensu::Plugin::Check::CLI
def get_es_resource(resource)
headers = {}
if config[:user] && config[:password]
auth = 'Basic ' + Base64.encode64("#{config[:user]}:#{config[:password]}").chomp
auth = 'Basic ' + Base64.strict_encode64("#{config[:user]}:#{config[:password]}").chomp
headers = { 'Authorization' => auth }
end

Expand Down
2 changes: 1 addition & 1 deletion bin/check-es-cluster-status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class ESClusterStatus < Sensu::Plugin::Check::CLI
def get_es_resource(resource)
headers = {}
if config[:user] && config[:password]
auth = 'Basic ' + Base64.encode64("#{config[:user]}:#{config[:password]}").chomp
auth = 'Basic ' + Base64.strict_encode64("#{config[:user]}:#{config[:password]}").chomp
headers = { 'Authorization' => auth }
end

Expand Down
2 changes: 1 addition & 1 deletion bin/check-es-file-descriptors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ESFileDescriptors < Sensu::Plugin::Check::CLI
def get_es_resource(resource)
headers = {}
if config[:user] && config[:password]
auth = 'Basic ' + Base64.encode64("#{config[:user]}:#{config[:password]}").chomp
auth = 'Basic ' + Base64.strict_encode64("#{config[:user]}:#{config[:password]}").chomp
headers = { 'Authorization' => auth }
end

Expand Down
2 changes: 1 addition & 1 deletion bin/check-es-heap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def acquire_es_version
def acquire_es_resource(resource)
headers = {}
if config[:user] && config[:password]
auth = 'Basic ' + Base64.encode64("#{config[:user]}:#{config[:password]}").chomp
auth = 'Basic ' + Base64.strict_encode64("#{config[:user]}:#{config[:password]}").chomp
headers = { 'Authorization' => auth }
end

Expand Down
2 changes: 1 addition & 1 deletion bin/check-es-node-status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ESNodeStatus < Sensu::Plugin::Check::CLI
def get_es_resource(resource)
headers = {}
if config[:user] && config[:password]
auth = 'Basic ' + Base64.encode64("#{config[:user]}:#{config[:password]}").chomp
auth = 'Basic ' + Base64.strict_encode64("#{config[:user]}:#{config[:password]}").chomp
headers = { 'Authorization' => auth }
end

Expand Down
2 changes: 1 addition & 1 deletion bin/metrics-es-cluster.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def acquire_es_version
def get_es_resource(resource)
headers = {}
if config[:user] && config[:password]
auth = 'Basic ' + Base64.encode64("#{config[:user]}:#{config[:password]}").chomp
auth = 'Basic ' + Base64.strict_encode64("#{config[:user]}:#{config[:password]}").chomp
headers = { 'Authorization' => auth }
end

Expand Down
2 changes: 1 addition & 1 deletion bin/metrics-es-node-graphite.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class ESNodeGraphiteMetrics < Sensu::Plugin::Metric::CLI::Graphite
def get_es_resource(resource)
headers = {}
if config[:user] && config[:password]
auth = 'Basic ' + Base64.encode64("#{config[:user]}:#{config[:password]}").chomp
auth = 'Basic ' + Base64.strict_encode64("#{config[:user]}:#{config[:password]}").chomp
headers = { 'Authorization' => auth }
end

Expand Down
2 changes: 1 addition & 1 deletion bin/metrics-es-node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def acquire_es_version
def get_es_resource(resource)
headers = {}
if config[:user] && config[:password]
auth = 'Basic ' + Base64.encode64("#{config[:user]}:#{config[:password]}").chomp
auth = 'Basic ' + Base64.strict_encode64("#{config[:user]}:#{config[:password]}").chomp
headers = { 'Authorization' => auth }
end

Expand Down

0 comments on commit 12f1808

Please sign in to comment.