Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-10117

Add SSH key field validation in UserPreferences to ensure keys are correctly entered

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Description

      When adding SSH keys via addSshKeysFromStrings method in UserPreferences.ts, there was no verification that the keys were actually entered correctly into the form fields. This could lead to silent failures where the keys appeared to be added but were actually incomplete or corrupted.

      Solution

      Added validation after pasting each SSH key to verify the field values match the expected input:

      • After pasting private SSH key: read field value and compare with privateSshKey parameter
      • After pasting public SSH key: read field value and compare with publicSshKey parameter

      If validation fails, an error is thrown with a descriptive message. On success, a confirmation log message is written.

              sskoryk Serhii Skoryk
              sskoryk Serhii Skoryk
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: