Skip to content

Conversation

edurodriguesdias
Copy link

@edurodriguesdias edurodriguesdias commented Mar 21, 2024

Description

About OID, there are instances where we encounter mismatches in sanitizing URIs containing more than 24 characters. This issue results in only a portion of our path parameters being hidden (specifically, the first 24 characters), while the remainder remains visible.

Examples below:

image

Furthermore, the current regular expression for license plates does not limit the number of characters, leading to a mismatch when the initial path parameter satisfies the regular expression rule (3 letters, 1 digit, 1 letter, and 2 digits at the end).

image

What's changed?

  • For OID, I simply added a comma (,) after the regular expression quantifier. This modification allows for the capture of OIDs longer than 24 characters.
  • For the License Plate regex, I added a lookahead before the group to ensure that the group captures only 7 or 8 digits exactly or group contains 7 or 8 digits and ends with slash /.

Tests Evidence

  • After the changes, we observe that the is entire hidden.
    image

  • The license plate regular expression will no longer conflict with OID:

    • In the case of a real license plate:
      image
      image

    • When the beginning of the string captured looks like a license plate but has more than 7 or 8 characters, it will be treated as an OID.
      image
      image

  • Unit tests:
    image

Eduardo Dias added 2 commits March 20, 2024 02:25
- License plate is considered valid if it has 7 or 8 numbers
@edurodriguesdias edurodriguesdias changed the title Changed: Sanatize URI regular expressions (OID & License Plate) Changed: Sanitize URI regular expressions (OID & License Plate) Mar 21, 2024
@leocavalcante leocavalcante merged commit 29e0957 into opencodeco:main Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants