Skip to content
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

HikakuConfig: add possibility to filter the endpoints with a custom predicate #44

Closed
wants to merge 1 commit into from
Closed

HikakuConfig: add possibility to filter the endpoints with a custom predicate #44

wants to merge 1 commit into from

Conversation

syjer
Copy link

@syjer syjer commented Jul 24, 2019

Hi, for a project I needed a little bit more flexibility for ignoring the endpoints paths.

The provided ignorePaths in HikakuConfig is restrictive as you need an exact match.

I've added a new endpointFilter predicate that the user can customize as he wants :)

I hope that you will find it useful :)

Thanks!

@cc-jhr
Copy link
Collaborator

cc-jhr commented Jul 24, 2019

Hey @syjer,

first of all thank you for creating a PR. This is exactly what we've been discussing in #26 and I was thinking about a solution for this today as well.
I like the solution using the predicate, because it gives a lot of freedom to declare custom rules. However I didn't like that it's a whitelist instead of a blacklist. I pulled your commit and played around with it. Please check the branch feature/configFilter

What I wanted to do was get rid of all the static pre-created rules. So I changed your endpointFilter to val filter: List<(Endpoint) -> Boolean> = emptyList(). Instead of declaring a rule which determines the endpoints that are to be included in the matching, I have a List of rules that exclude certain endpoints.

Please take a look and let me know what you think about that.

@syjer
Copy link
Author

syjer commented Jul 24, 2019

hi @cc-jhr , thank you for having a look at the PR :).

Had a look at the feature/configFilter and I like it. It does exactly what I need 👍 .

I guess I can close this PR?

@cc-jhr
Copy link
Collaborator

cc-jhr commented Jul 24, 2019

If you are fine with the changes I made, you can close this PR. Then I would merge the feature/configFilter branch.

@syjer
Copy link
Author

syjer commented Jul 24, 2019

@cc-jhr yes sure :) Thank you for the swift feedback. (closing the PR)

@syjer syjer closed this Jul 24, 2019
@cc-jhr
Copy link
Collaborator

cc-jhr commented Jul 24, 2019

@syjer thanks again for contributing to the project 👍

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.

None yet

2 participants