Skip to content

Conversation

pavolloffay
Copy link
Member

The additional blocking methods will be used to block on request/RPC bodies

Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
* {@link FilterEvaluator} evaluates given request/RPC and the result is used to block further
* processing of the request.
*/
public interface FilterEvaluator {
Copy link
Member Author

Choose a reason for hiding this comment

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

@davexroth @jcchavezs please have a look at this API.

Copy link
Member Author

Choose a reason for hiding this comment

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

@davexroth could you please paste link to the Envoy filter interface?

@mohit-a21 could you please also have a look?

Copy link
Contributor

Choose a reason for hiding this comment

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

This interface will need to be used by multiple languages, some of which may not have operator overloading. Can you separate out the methods into evaluateHeaders and evaluateBody ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Will all languages follow the same API? I would say no, in each language we will have a different API. The impl will then forward calls to the webasm.

Signed-off-by: Pavol Loffay <[email protected]>
* @param headers are used for blocking evaluation.
* @return filter result
*/
FilterResult evaluate(Map<String, String> headers);
Copy link
Member Author

Choose a reason for hiding this comment

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

I think all the methods are missing the information whether the passed arguments are from request or response. We could have request/reponse combination for all of them or maybe pass enum to distinguish the request/response/db?

* @param body request body
* @return filter result
*/
FilterResult evaluate(String body);

Choose a reason for hiding this comment

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

In which case, blocking will happen based on the body only?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I think we will need:

  1. evaluate(headers)
  2. evaluate(body)
  3. evaluate(headers, body)

and have this for request and response since the evaluation might differ.

Signed-off-by: Pavol Loffay <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]>
@pavolloffay pavolloffay merged commit 9a21419 into main Nov 11, 2020
@pavolloffay pavolloffay deleted the filter branch November 11, 2020 10:17
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.

3 participants