-
Notifications
You must be signed in to change notification settings - Fork 806
Aws es signing #353
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
Closed
JackFazackerley
wants to merge
3
commits into
prometheus-community:master
from
JackFazackerley:aws-es-signing
Closed
Aws es signing #353
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module github.com/justwatchcom/elasticsearch_exporter | ||
|
||
go 1.13 | ||
|
||
require ( | ||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect | ||
github.com/aws/aws-sdk-go v1.31.3 | ||
github.com/blang/semver v3.5.2-0.20180723201105-3c1074078d32+incompatible | ||
github.com/go-kit/kit v0.10.0 | ||
github.com/golang/protobuf v1.4.2 // indirect | ||
github.com/imdario/mergo v0.3.9 | ||
github.com/prometheus/client_golang v1.6.0 | ||
github.com/prometheus/common v0.10.0 | ||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2 // indirect | ||
golang.org/x/sys v0.0.0-20200523222454-059865788121 // indirect | ||
gopkg.in/alecthomas/kingpin.v2 v2.2.6 | ||
gopkg.in/yaml.v2 v2.3.0 // indirect | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package roundtripper | ||
|
||
import ( | ||
"net/http" | ||
"time" | ||
|
||
"github.com/aws/aws-sdk-go/aws/credentials" | ||
v4 "github.com/aws/aws-sdk-go/aws/signer/v4" | ||
) | ||
|
||
const ( | ||
service = "es" | ||
) | ||
|
||
type AWSSigningTransport struct { | ||
DefaultTransport *http.Transport | ||
Credentials *credentials.Credentials | ||
Region string | ||
} | ||
|
||
// RoundTrip implementation | ||
func (a AWSSigningTransport) RoundTrip(req *http.Request) (*http.Response, error) { | ||
signer := v4.NewSigner(a.Credentials) | ||
|
||
// body is nil as we never send data to Elastic, just get | ||
if _, err := signer.Sign(req, nil, service, a.Region, time.Now()); err != nil { | ||
return nil, err | ||
} | ||
|
||
return a.DefaultTransport.RoundTrip(req) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes are needed for IRSA (IAM roles for service accounts) to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JackFazackerley could you accept these changes so we can at least get this PR in a working state? Thanks!