Repository navigation
fix(registry): enforce safe username charset and add season rank lookup - #1507
Open
Ranjeet2063 wants to merge 1 commit into
Open
Ranjeet2063 wants to merge 1 commit into
Ranjeet2063 wants to merge 1 commit into
Conversation
- Enforce safe charset [a-zA-Z0-9_] on register to reject invisible unicode, zero-width spaces, and lookalikes - Implement get_season_rank(season, user) for per-season leaderboard ranking lookup - Fix broken upstream apply_to_top merge conflict - Add regression test suite for charset validation and season rank Closes ada-nwali#1454 Closes ada-nwali#1452
|
@Ranjeet2063 is attempting to deploy a commit to the Ada's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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 of Changes
This PR addresses two registry issues by strengthening username security and adding season-level rank lookup capabilities:
Safe Username Charset Enforcement (Usernames can contain invisible and lookalike characters #1454):
[a-zA-Z0-9_]inRegistryContract::registerbefore lowercasing normalization.\u{200b}), control bytes, spaces, and punctuation withRegistryError::InvalidUsername.Season Rank Lookup (Add season rank lookup and show it on the leaderboard #1452):
get_season_rank(env: Env, season: u32, user: Address) -> Result<u32, RegistryError>.SeasonTop(season)list for the caller and returns 1-based rank orUNRANKED(u32::MAX).RegistryError::NotRegisteredif the target address has not registered a profile.Leaderboard Maintenance & Bugfix:
apply_to_topandupdate_season_topto maintain deterministic tiebreaking (Leaderboard ties are resolved by insertion order, undocumented #368).Testing:
issue_1454_1452_testsverifying safe/invalid username charset rejection and multi-season rank lookups.cargo test -p automint-registry.Closes #1454
Closes #1452