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

#68 - limit requesting of detailed results per user #77

Conversation

michael-82
Copy link
Collaborator

  • add a second bucket to enforce a quota on the detailed obfuscated results endpoint
  • currently, returning a token back to the bucket when the actually received result was only a summary (due to whatever reason...result no longer available, too few sites responded, too few results received) is done in the afterCompletion method of the interceptor. This does however not allow modifying the headers any more. So a custom header is remaining in this case and the remaining requests variable might be 1 too low

- add a second token bucket for the detailed results endpoint
- put tokens back into the bucket if the detailed result was not returned (for whatever reason)
- put a token back into a users bucket if detailed obfuscated results were requested, but only a summary was returned (due to too few responding sites) or the result was gone
- change parameter for detailed obfuscated result limit time interval to seconds instead of minutes
- add integrationtest to check that limit
@michael-82
Copy link
Collaborator Author

The decision to put one token back in the interceptor after handling the request was made in discussion with @juliangruendner . I am pretty sure that there might be a better way of doing this, however, I did not find it, yet. So if you have any hints here, please let me/us know.

@juliangruendner juliangruendner marked this pull request as ready for review March 15, 2023 16:20
@juliangruendner juliangruendner merged commit 14a0059 into develop Mar 15, 2023
@michael-82 michael-82 deleted the feature/68-Limit-requesting-of-detailed-results-per-user branch March 16, 2023 06:12
@michael-82 michael-82 added this to the Release v3.0.0 milestone Mar 29, 2023
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.

2 participants