-
Notifications
You must be signed in to change notification settings - Fork 14
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
Move SigV4 config and middleware here #132
Conversation
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.
LGTM
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.
Seems good to consolidate!
// SigV4MiddlewareName the middleware name used by SigV4Middleware. | ||
const SigV4MiddlewareName = "sigv4" | ||
|
||
var newSigV4Func = New |
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.
So we have one middleware calling another middleware now... https://github.com/grafana/grafana-aws-sdk/blob/main/pkg/sigv4/sigv4.go#L80-L82
Does this second middeware do anything that the first middleware doesn't do? Maybe better logging and something like that? Or is this just the format that the prometheus datasource expects?
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.
yeah, this middleware is just a wrapper around the other middleware. Its goal is to do the transformation from httpclient.Options
-> sigv4.Options
. It could probably be refactored and only have one but it would imply changing the signature of that New
method (so a breaking change).
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.
lgtm
This PR does two things: