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: [SECURESIGN-687] endpoint sanitization #112

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Conversation

kahboom
Copy link
Collaborator

@kahboom kahboom commented Jul 23, 2024

This PR fixes an issue (SECURESIGN-687) with the Rekor endpoint configuration in the Settings modal, where pressing Enter would trigger a page refresh, skipping validation and not persisting the value.

Changes:

  • Add validation function to check for invalid characters, string length, and protocol
  • Remove check for tld and dot in endpoint
  • Add form submission handler with preventDefault() to prevent default form submission behavior
  • Add an onSubmit attribute to the Form component to handle the form submission event
  • Add handle submit button to allow the form to be submitted with enter key
  • Update tests to reflect new changes
  • Fix an issue with Cypress type checking being overridden by Jest type checking

The video below shows the form now properly being validated and/or submitted on pressing the Enter key.

2024-07-23

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.

Project coverage is 65.04%. Comparing base (d80daa3) to head (29fb678).

Files Patch % Lines
src/modules/components/Settings.tsx 76.92% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
+ Coverage   65.00%   65.04%   +0.03%     
==========================================
  Files          14       14              
  Lines        1583     1599      +16     
  Branches       58       58              
==========================================
+ Hits         1029     1040      +11     
- Misses        553      558       +5     
  Partials        1        1              

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

Copy link
Member

@lance lance left a comment

Choose a reason for hiding this comment

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

/lgtm

@kahboom kahboom merged commit 393b21f into main Jul 23, 2024
26 checks passed
@kahboom kahboom deleted the 687-sanitize-url branch July 23, 2024 13:13
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