Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-42712

Tab characters are considered unprintable in Secret details view

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.18.0
    • Management Console
    • None
    • Low
    • None
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      In the Secret details view, if one of the data properties from the Secret contains a tab character, it is considered "unpritable" and the content cannot be viewed in the console. This is not correct. Tab characters can be printed and should not prevent content from being viewed. 
      
      We have a dependency "istextorbinary" that will determine if a buffer contains binary. We should use it here.

      Version-Release number of selected component (if applicable)  4.18.0

      How reproducible:

          Always

      Steps to Reproduce:

          1. Download (this file)[https://gist.github.com/TheRealJon/eb1e2eaf80c923938072f8a997fed3cd/raw/04b7307d31a825ae686affd9da0c0914d490abd3/pull-secret-with-tabs.json]
          2. Run this command:
      oc create secret generic test -n default --from-file=.dockerconfigjson=<path-to-file-from-step-1> --type=kubernetes.io/dockerconfigjson
          3. In the console, navigate to Workloads -> Secrets and make sure that the "default" project is selected from the project dropdown.
          4. Select named "test"
          5. Scroll to the bottom to view the data content of the Secret

      Actual results:

          The "Save this file" option is shown, and user is unable to reveal the contents of the Secret

      Expected results:

          The "Save this file" option should not be shown, the obfuscated content should be rendered, and the reveal/hide button should show and hide the content from the pull secret.

       

      Additional info:

          There is logic in this view that prevents us from trying to render binary data by detecting "unprintable characters". The regex for this includes the Tab character, which is incorrect, since that character is printable.

            jhadvig@redhat.com Jakub Hadvig
            rh-ee-jonjacks Jon Jackson
            YaDan Pei YaDan Pei
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: