Uploaded image for project: 'Satellite'
  1. Satellite
  2. SAT-19748

Registry Service Accounts token is not accepted in "Upstream Authentication Token" of a docker repo in Satellite 6

XMLWordPrintable

    • Sprint 126, Sprint 127, Sprint 128, Sprint 129, Sprint 130, Sprint 131, Sprint 132, Sprint 133, Sprint 134, Sprint 135, Sprint 136, Sprint 137, Sprint 138, Sprint 139, Sprint 140, Sprint 141
    • Important
    • None

      Description of problem:

      One has the ability to create a Registry Service account and generate a token related to the same to further use them as shared credentials but the generated token could be quite long.

      While for a container\docker type repo, The "Upstream Password" field accepts that Token, The "Upstream Authentication Token" field rejects the same with error

      An error occurred saving the Repository: PG::StringDataRightTruncation: ERROR: value too long for type character varying(1024)

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

      Satellite 6.11 , 6.12 and 6.13 ( probably Satellite 6.10 as well )

      How reproducible:

      Easily and Always

      Steps to Reproduce:
      1. Create a new Satellite 6.x ( x being 11 12 or 13 )

      2. Import a manifest with some valid subs

      3. Go to https://access.redhat.com/terms-based-registry/#/accounts and create a new service account and token.

      4. Discovery "rhel8/toolbox" docker type repo using the exact same username and token from Satellite UI Content --> Products page and create the repo

      5. Sync the repo

      6. Edit the "Upstream Authorization" field and try to put the token inside ""Upstream Authentication Token" field -> Save

      7. Try to remove the token from there and put it in "Upstream Password" field and save

      8. Re-sync the repo.

      Actual results:

      Step 5: Sync Success ( as the token gets saved as password )

      Step 6: Error:

      An error occurred saving the Repository: PG::StringDataRightTruncation: ERROR: value too long for type character varying(1024)

      Step 7 and 8: Successfully saved and repo can be synced

      The reason seems to be this i.e. upstream_password column has a record type set to Text but upstream_authentication_token is of varchar(1024)

      1. echo "\d+ katello_root_repositories;" | su - postgres -c "psql foreman" | egrep "Column|upstream" | awk -F'|' ' {print $1,$2,$4}

        '
        Column Type Nullable
        docker_upstream_name character varying(255)
        upstream_username character varying(255)
        upstream_password text
        upstream_authentication_token character varying(1024)

      Expected results:

      A) As tokens are expected to be longer than normal passwords, set "upstream_authentication_token" type to "text" or increase the length for varchar

      B) If the token can be used in both upstream_password as well as upstream_authentication_token fields, Then just have one field present.

      Additional info:

      NA

        There are no Sub-Tasks for this issue.

            iballou@redhat.com Ian Ballou
            rhn-support-saydas Sayan Das
            Sam Bible Sam Bible
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: