Repository navigation
Conversation
The username check used the range [A-z], which also matches the six characters between Z and a ([ \ ] ^ _ `), and did not allow hyphens. It accepted characters a username cannot contain and rejected valid usernames such as jane-doe. Linode usernames are letters, digits, hyphens and underscores, so match [A-Za-z0-9_-]+ instead. Fixes linode#734
lyelgate
requested review from
psnoch-akamai and
yec-akamai
and removed request for
a team
November 1, 2026 11:35
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.
📝 Description
What does this PR do and why is this change necessary?
Fixes #734.
test_list_stackscriptschecked the username column with([A-z]|[0-9])+. The rangeA-zalso includes the six characters betweenZanda([ \ ] ^ _ `), and the pattern doesn't allow hyphens. So it accepted characters a username can't contain and rejected valid usernames such asjane-doe, which would fail the test for an account whose public StackScripts belong to a hyphenated user.Per the API spec, usernames are 3 to 32 letters, digits, hyphens and underscores (
^[a-zA-Z0-9]((?![_-]{2,})[a-zA-Z0-9-_])+[a-zA-Z0-9]$). This PR matches[A-Za-z0-9_-]+instead. It's the onlyA-zrange in the repository.123,linode,True123,john_doe,True123,jane-doe,True123,ab^c,True✔️ How to Test
What are the steps to reproduce the issue or verify the changes?
The table above was checked with
re.fullmatchagainst both patterns.How do I run the relevant unit/integration tests?
This is an integration test, so it needs a Linode account. I verified the pattern itself as shown above.
blackandisortpass.