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(store): Validate release names #479

Merged
merged 2 commits into from
Feb 17, 2020
Merged

Conversation

jan-auer
Copy link
Member

Validates the release name according to this logic:

BAD_RELEASE_CHARS = "\n\f\t/"

def is_valid_version(value):
    return not (
        any(c in value for c in BAD_RELEASE_CHARS)
        or value in (".", "..")
        or not value
        or value.lower() == "latest"
    )

Notes:

  • The release field is annotated as nonempty = "true", which corresponds to not value.
  • The bad characters are validated with the regex: ^[^\r\n\f/]*\z

@jan-auer jan-auer requested review from mitsuhiko and a team February 17, 2020 10:54
@jan-auer jan-auer self-assigned this Feb 17, 2020
@jan-auer jan-auer merged commit 47d15ab into master Feb 17, 2020
@jan-auer jan-auer deleted the fix/release-normalization branch February 17, 2020 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants