Bug 2064793

Summary: Remotes should have username and password cleared out if a user sets them to be blank
Product: Red Hat Satellite Reporter: Ian Ballou <iballou>
Component: RepositoriesAssignee: Ian Ballou <iballou>
Status: CLOSED ERRATA QA Contact: Cole Higgins <chiggins>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.10.0CC: ehelms
Target Milestone: 6.11.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-05 14:34:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ian Ballou 2022-03-16 14:51:53 UTC
Currently, we do not update the username or password in Pulp if they are blank: https://github.com/Katello/katello/blob/master/app/services/katello/pulp3/repository.rb#L417

This seems to be related to the following community thread and maybe have worked around the related Pulp bug: https://community.theforeman.org/t/pulprpmclient-apierror-http-500-during-sync-repository/27480/14

Comment 1 Ian Ballou 2022-03-16 14:51:56 UTC
Created from redmine issue https://projects.theforeman.org/issues/34619

Comment 2 Ian Ballou 2022-03-16 14:51:58 UTC
Upstream bug assigned to iballou

Comment 4 Bryan Kearney 2022-03-21 20:05:19 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34619 has been resolved.

Comment 7 Ian Ballou 2022-06-08 18:23:12 UTC
Testing steps:


1) Update a repo's username and password
2) Check the username and password in from the DB:

```
vagrant@centos8-katello-devel ~/katello $ sudo -i -u postgres
postgres@centos8-katello-devel ~ $ psql
psql (12.9)
Type "help" for help.

postgres=# \c pulpcore 
You are now connected to database "pulpcore" as user "postgres".
pulpcore=#  select pulp_id, name, url, username, password, length(username) from core_remote;
...
```

Note: the username and password will appear as gibberish.

3) Clear out the username and password on the repo
4) Sync the repo
5) The username and password should now be empty in postgres

Comment 11 errata-xmlrpc 2022-07-05 14:34:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Satellite 6.11 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5498