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

fix: correctly validate package/realm path #1813

Merged
merged 4 commits into from
Apr 17, 2024

Conversation

harry-hov
Copy link
Contributor

@harry-hov harry-hov commented Mar 22, 2024

The regex pattern used for package/realm path validation is incorrect. Currently, it allows paths with special characters and empty path parts, commit f98e509 demonstrates that.

Subsequent commits fixes it.

BREAKING CHANGE:

  • Special characters are disallowed
  • Cannot have trailing slash(s)
  • Cannot have empty path part
  • Cannot have solely _[underscore(s)] in path
Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

@github-actions github-actions bot added the 📦 🌐 tendermint v2 Issues or PRs tm2 related label Mar 22, 2024
Copy link

codecov bot commented Mar 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.78%. Comparing base (7286ca7) to head (bfcb571).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1813   +/-   ##
=======================================
  Coverage   47.78%   47.78%           
=======================================
  Files         393      393           
  Lines       61660    61660           
=======================================
  Hits        29465    29465           
  Misses      29723    29723           
  Partials     2472     2472           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@harry-hov harry-hov marked this pull request as ready for review March 22, 2024 10:39
@harry-hov harry-hov requested a review from thehowl March 22, 2024 10:39
@zivkovicmilos
Copy link
Member

Reviewing now, please don't merge yet

Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for attempting to improve this part of the codebase 🙏

Please check my comments so we can resolve some issues

tm2/pkg/std/memfile_test.go Show resolved Hide resolved
tm2/pkg/std/memfile_test.go Outdated Show resolved Hide resolved
tm2/pkg/std/memfile.go Outdated Show resolved Hide resolved
tm2/pkg/std/memfile.go Outdated Show resolved Hide resolved
tm2/pkg/std/memfile.go Outdated Show resolved Hide resolved
@harry-hov
Copy link
Contributor Author

@zivkovicmilos Sorry for force pushing the branch. This solution is not related to the previous one. Please take another look. Thanks for the review.

@harry-hov harry-hov added breaking change Functionality that contains breaking changes hotfix labels Apr 10, 2024
Copy link
Member

@zivkovicmilos zivkovicmilos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for resolving the convos 🙏

@harry-hov harry-hov merged commit 0c2d51e into gnolang:master Apr 17, 2024
181 of 183 checks passed
omarsy pushed a commit to TERITORI/gno that referenced this pull request Apr 21, 2024
The regex pattern used for package/realm path validation is incorrect.
Currently, it allows paths with special characters and empty path parts,

Fixed it.

BREAKING CHANGE:
- Special characters are disallowed
- Cannot have trailing slash(s)
- Cannot have empty path part
- Cannot have solely `_`[underscore(s)] in path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Functionality that contains breaking changes 📦 🌐 tendermint v2 Issues or PRs tm2 related
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants