Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add custom HTTP headers to metrics-http-json.rb #177

Merged

Conversation

mblaettler
Copy link
Contributor

@mblaettler mblaettler commented Mar 16, 2020

Added -H/--header flag to pass custom HTTP headers in metrics-http-json.rb.
This makes it possible to use authentication token or any other function based on HTTP headers.

Pull Request Checklist

Is this in reference to an existing issue?
#176

General

  • Update Changelog following the conventions laid out here

  • Update README with any necessary configuration snippets
    -> There was no entry about metrics-http-json.rb yet.

  • Binstubs are created if needed

  • RuboCop passes

  • Existing tests pass

Purpose

Currently it is not possible to pass custom HTTP headers to the request. This would be nice, because it would enable to use Authentication tokens or any other function based on HTTP headers.

Known Compatibility Issues

@mblaettler mblaettler force-pushed the feat/add-http-headers branch from 1e453c6 to c8ca5f1 Compare March 16, 2020 09:31
Copy link
Member

@majormoses majormoses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just a few minor touch ups.

bin/metrics-http-json.rb Outdated Show resolved Hide resolved
bin/metrics-http-json.rb Outdated Show resolved Hide resolved
bin/metrics-http-json.rb Outdated Show resolved Hide resolved
bin/metrics-http-json.rb Outdated Show resolved Hide resolved
@mblaettler mblaettler force-pushed the feat/add-http-headers branch from 8ab3d3d to bf18fc9 Compare March 19, 2020 06:57
Added -H/--header flag to pass custom HTTP headers in metrics-http-json.rb.
This makes it possible to use authentication token or any other function
based on HTTP headers.

Co-Authored-By: Ben Abrams <[email protected]>
@mblaettler mblaettler force-pushed the feat/add-http-headers branch from bf18fc9 to 128b6a4 Compare March 19, 2020 07:15
@mblaettler
Copy link
Contributor Author

I squashed your changes into my commit. There was also a change in Line 95&96 required.

In addition, I installed the plugin on our sensu instance to test it. It seems to work fine.

Copy link
Member

@majormoses majormoses left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@majormoses majormoses merged commit 983af30 into sensu-plugins:master Mar 20, 2020
@majormoses
Copy link
Member

I will try to get a release out tonight or tomorrow.

@mblaettler
Copy link
Contributor Author

I will try to get a release out tonight or tomorrow.

Thank you very much. Have a nice day and stay healthy. :-)

@majormoses
Copy link
Member

Sorry this slipped through I have cut a release and once CI passes it will be pushed to rubygems. I will check back later to make sure there are no hiccups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants