fix: restrict change log api - #354
Merged
Merged
Conversation
Contributor
|
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The public
change_logendpoint (allow_guest=True) returned more data than the other public endpoints, and it was expensive to call without authentication.Problems
water_bodyendpoint returns only Water Bodies that are active and displayed in the fishing guide. The change log did not apply these filters. It returned the names of hidden Water Bodies and the new value of every changed field, including fields that are not public, for examplenumber,is_property_water_body,blacklisted_fish_speciesorcurrent_information_expires_on. The Firebase notifications use the same formatting, so they had the same problem.from_datetimereads and formats the full Version history of all tracked DocTypes.addedorchangedkeys. A request that includes them failed with aTypeError.Changes
water_body,fish_speciesandlegalendpoints return. An event without public changes is dropped.is_activeordisplay_in_fishing_guideis reported as "Created" (the Water Body is now public) or "Deleted" (the Water Body is now hidden), so that clients can add or remove it.change_logallows 30 requests per minute for each IP address.docs/api.mddescribes the new behavior.Notes for clients
Tests
landa/water_body_management/test_change_log.pycovers public, hidden and re-published Water Bodies.