8000 DOCK-2477: Accept pairs of internal hyphens/underscores in entry names by svonworl · Pull Request #5858 · dockstore/dockstore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

DOCK-2477: Accept pairs of internal hyphens/underscores in entry names #5858

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

Merged

Conversation

svonworl
Copy link
Contributor
@svonworl svonworl commented Apr 3, 2024

Description
This PR changes the webservice to allow two consecutive internal hyphens/underscores in Entry names. Runs of three or more hyphens or underscores are still rejected, because we probably don't want entry names like foo___________bar.

Whilst changing the responsible regular expression, I converted all of the quantifiers to be possessive, because there's no need for backtracking during matching. https://docs.oracle.com/javase/tutorial/essential/regex/quant.html
This will slightly improve performance and reduce the chance that the regexp could be used for a DOS attack.

The message that describes the requirements for an entry name (ENTRY_NAME_REGEX_MESSAGE) covers both the old and new criteria, so it doesn't need to change.

Review Instructions
Register a valid entry with a name that contains two consecutive internal hyphens/underscores, and confirm the entry was successfully registered.

Issue
https://ucsc-cgl.atlassian.net/browse/DOCK-2477
#5715

Security and Privacy

No concerns.

  • Security and Privacy assessed

e.g. Does this change...

  • Any user data we collect, or data location?
  • Access control, authentication or authorization?
  • Encryption features?

Please make sure that you've checked the following before submitting your pull request. Thanks!

  • Check that you pass the basic style checks and unit tests by running mvn clean install
  • Ensure that the PR targets the correct branch. Check the milestone or fix version of the ticket.
  • Follow the existing JPA patterns for queries, using named parameters, to avoid SQL injection
  • If you are changing dependencies, check the Snyk status check or the dashboard to ensure you are not introducing new high/critical vulnerabilities
  • Assume that inputs to the API can be malicious, and sanitize and/or check for Denial of Service type values, e.g., massive sizes
  • Do not serve user-uploaded binary images through the Dockstore API
  • Ensure that endpoints that only allow privileged access enforce that with the @RolesAllowed annotation
  • Do not create cookies, although this may change in the future
  • If this PR is for a user-facing feature, create and link a documentation ticket for this feature (usually in the same milestone as the linked issue). Style points if you create a documentation PR directly and link that instead.

@svonworl svonworl self-assigned this Apr 3, 2024
Copy link
codecov bot commented Apr 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.52%. Comparing base (45f08cf) to head (e59c814).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #5858   +/-   ##
==========================================
  Coverage      74.52%   74.52%           
  Complexity      5274     5274           
==========================================
  Files            369      369           
  Lines          19056    19056           
  Branches        2025     2025           
==========================================
  Hits           14202    14202           
  Misses          3893     3893           
  Partials         961      961           
Flag Coverage Δ
bitbuckettests 27.06% <ø> (ø)
integrationtests 58.55% <ø> (ø)
languageparsingtests 11.00% <ø> (ø)
localstacktests 21.57% <ø> (ø)
toolintegrationtests 30.41% <ø> (ø)
unit-tests_and_non-confidential-tests 28.89% <ø> (ø)
workflowintegrationtests 38.64% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@denis-yuen
Copy link
Member

Runs of three or more hyphens or underscores are still rejected

I feel like I know the next issue in this chain 😁

@svonworl svonworl merged commit a6313f1 into develop Apr 4, 2024
@svonworl svonworl deleted the feature/dock-2477/allow-double-underscores-and-hyphens branch April 4, 2024 16:40
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.

4 participants
0