-
Notifications
You must be signed in to change notification settings - Fork 71
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 Support for Reject Handler with SmokescreenContext #232
Conversation
Pull Request Test Coverage Report for Build 11231455598Details
💛 - Coveralls |
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.
Looks good, just one comment.
pkg/smokescreen/smokescreen_test.go
Outdated
resp, err := client.Get("http://127.0.0.1") | ||
r.NoError(err) | ||
|
||
// The RejectResponseHandler should set our custom header |
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.
Is this supposed to be RejectResponseHandlerWithCtx
? (Same in all places in this test)
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.
Yes, will update this comment.
pkg/smokescreen/config.go
Outdated
// Custom handler to allow clients to modify reject responses | ||
RejectResponseHandlerWithCtx func(*SmokescreenContext, *http.Response) |
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.
Should we guard against configuring both this handler and the legacy one? If not, we'd need to document ordering of handler execution et all for consumers.
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.
Yes, it makes sense to only let users configure one of these handler since new one is the superset of legacy one.
I can mark legacy one as depreciated.
Description
Enhance Smokescreen to implement reject handler functionality. This handler will be invoked with the Smokescreen context when a connection failure occurs.
Testing Details
HTTP Connect Failure
Logs
HTTP Connect Success
Logs