TACC / Core-CMS-Custom

Customized Core CMS code and builds
5 stars 0 forks source link

hotfix/APCD-prod-validation-fix-for-added-entities #207

Closed sophia-massie closed 12 months ago

sophia-massie commented 12 months ago

Overview

The purpose of this hotfix is to update the prod branch so that the add remove buttons for the registration form work the same as staging. This will ensure that the scripts to validate characters in form input work as well.

Related

Changes

The checkForBlankInputs javascript was changed using whitelist methods to allow characters in input. At the same time, the script blacklists some explicit scripting character patterns. This is a front end change to prevent bad characters from making it to the server. The DB utils remove bad characters server side in apcd_database.py.

Testing

  1. Go to http://localhost:8000/register/request-to-submit/
  2. Fill out form and add an entity
  3. Try to input javascript.exe, anything in "quotes" or 'quotes" { hello.exe } thisshouldwork@test.com into any field into a entity name field and make sure invalid characters are removed
  4. On change. the field should be replaced with Try to input script script exe anything in quotes or quotes helloexe thisshouldworktestcom
    1. Fill out form and add a contact
  5. Try to input javascript.exe, anything in "quotes" or 'quotes" { hello.exe } thisshouldwork@test.com into any field into a contact name field and make sure invalid characters are removed

UI

User input:

Screenshot 2023-08-22 at 6 07 51 PM

On change, text is changed to:

Screenshot 2023-08-22 at 6 08 53 PM