Repository navigation
Keep the cursor token and the filter values out of the exception messages. - #13
Merged
Merged
Conversation
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.
Summary
The message of
CursorIsInvalidcarried the whole cursor token, and the messages ofFilterValueNotAllowed,FilterExpressionIsInvalidandFilterShapeNotSupportedcarried the value or the expression the client typed. Theservices that consume the library answer these exceptions with a 422, and the message reaches the response body and the
log. A cursor token is the base64 of the ordering keys, so a listing sorted by name carries the name of a person inside
it, and a filter on a name, an e-mail or a phone carried that value, so personal data reached the response and the
log. The 2.5.0 release already stated that the message of
kindMismatchcarries no decoded value.The messages now keep the field and the kind, and drop the token and the typed value:
Cursor token is invalid and could not be decoded.Cursor token does not match the uuid kind for cursor key <id>.Value does not match the <kind> kind for filter field <field>.Value is not permitted for filter field <field>.Filter expression is invalid and could not be parsed.Filter shape is not supported.The exceptions that echo only a field name, an operator or a documented number stay as they were
(
FilterFieldNotAllowed,SortFieldNotAllowed,FilterOperatorNotAllowed,FilterColumnNotMapped,PageNumberOutOfRange,PageSizeOutOfRange,OffsetOutOfRange,TotalIsNegative). No signature changed: the token andthe values stay in the factories as parameters, and only the message stopped using them.
Public API: backward compatible, since only the text of the messages changes, so the release is
2.6.1. A consumerwhose tests compare the exact message of an invalid cursor must drop the token from the expected text.
Related issue
None.
Checklist
message: a cursor sorted by name, a value that breaks its kind, a malformed value, and a disjunction of personal
values.
cursor message never carries the token.
make reviewpasses.make testspasses. 403 tests, lines 100% (973/973), MSI 100% (767 of 767 killed).