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

Docs for Red Hat signing-key retrieval should support redirects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.13, 4.12, 4.14, 4.15, 4.16, 4.17, 4.18
    • Documentation / Node
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • N/A
    • Release Note Not Required

      Description of problem

      Current docs recommend:

      $ curl -o pub.key https://access.redhat.com/security/data/fd431d51.txt
      

      But in 2024-09, that content was moved to a new location (with a 301 redirect), and the currently-doc'ed command (which does not allow redirects) will exit 0 (success) while downloading an empty file:

      $ curl -o pub.key https://access.redhat.com/security/data/fd431d51.txt
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      $ echo $?
      0
      $ wc -l pub.key 
      0 pub.key
      

      We should pivot to the new canonical location. And we should add the L/-location option to protect ourselves from future moves.

      $ man curl | grep -1 'moved to a different location'
             -L, --location
                    (HTTP) If the server reports that the requested page has moved to a different location (indicated with a Location: header and a 3XX response code), this option will make curl redo the request
                    on  the  new place. If used together with -i, --include or -I, --head, headers from all requested pages will be shown. When authentication is used, curl only sends its credentials to the ini‐
      

      Version-Release number of selected component

      All versions of the docs that are still supported; this is old doc source that's affected.

      How reproducible

      Every time.

      Steps to Reproduce

      Run the recommended curl.

      Actual results

      Empty pub.key.

      Expected results

      Populated pub.key.

      Additional info

      $ curl -isL https://access.redhat.com/security/data/fd431d51.txt | grep -i 'HTTP\|Location\|PUBLIC'
      HTTP/2 301 
      location: https://security.access.redhat.com/data/fd431d51.txt
      HTTP/1.1 200 OK
      -----BEGIN PGP PUBLIC KEY BLOCK-----
      -----END PGP PUBLIC KEY BLOCK-----
      

              trking W. Trevor King
              trking W. Trevor King
              Sunil Choudhary Sunil Choudhary
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: