Remove obsolete code from gateway watchers #4270
Merged
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.
This
:monitor
event that we are adding to the response in every gateway watcher is not used anywhere. We are only looking for:block
events in the method callers and ignoring the rest.What does this PR do?
Removes dead code in gateway watchers for different integrations.
Motivation:
Simplifying AppSec code.
Change log entry
None.
Additional Notes:
Here you can check how the response from
Gateway#watch
is being used:https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/appsec/contrib/rack/request_middleware.rb#L80-L81
https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/appsec/contrib/rack/request_middleware.rb#L111-L112
https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/appsec/contrib/rails/patcher.rb#L87-L88
https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/appsec/contrib/rack/request_body_middleware.rb#L33-L34
https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/appsec/contrib/sinatra/patcher.rb#L70-L71
https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/appsec/contrib/sinatra/patcher.rb#L111-L112
https://github.com/DataDog/dd-trace-rb/blob/master/lib/datadog/appsec/contrib/graphql/appsec_trace.rb#L24-L25
How to test the change?
CI should be green, and manual testing in app-generator.