Bug 1259513 - RFE: GET /docker/api/v2/registries/:id should return the username field
Summary: RFE: GET /docker/api/v2/registries/:id should return the username field
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Container Management
Version: 6.1.2
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: Unspecified
Assignee: Partha Aji
QA Contact: Elyézer Rezende
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-02 20:33 UTC by Og Maciel
Modified: 2019-06-13 21:25 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-19 15:56:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 11672 0 None None None 2016-04-22 15:48:02 UTC
Red Hat Product Errata RHBA-2015:2474 0 normal SHIPPED_LIVE Satellite 6.1.4 bug fix update 2015-11-19 20:45:48 UTC

Description Og Maciel 2015-09-02 20:33:53 UTC
Description of problem:

When you create a new docker registry, you can optionally provide a username and password. However, our API does not seem to return either of them (see further down for an example of the output generated when using hammer).

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

* Sat6.1.2-SNAP1

How reproducible:


Steps to Reproduce:
1. User either hammer cli to fetch information for a docker registry OR access /docker/api/v2/registries/:id directly
2.
3.

Actual results:

Notice how username and password are not returned

Expected results:

At least the username should be returned by the API call


Additional info:

hammer> docker registry update --id 2 --username='omaciel'
Docker registry updated
hammer> docker registry info --id 2
ID:         2
Name:       Red Hat Docker Registry
URL:        https://registry.access.redhat.com
Created at: 2015/09/02 19:28:33
Updated at: 2015/09/02 20:24:51

hammer> exit
[root@ibm-x3250m4-05 ~]# hammer -u admin -p changeme -d docker registry info --id 2
[ INFO 2015-09-02 16:25:06 Init] Initialization of Hammer CLI (0.1.4.12) has started...
[DEBUG 2015-09-02 16:25:06 Init] Running at ruby 2.0.0-p598
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli_config.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_bootdisk.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_discovery.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/foreman_docker.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/gutterball.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/import.yml has been loaded
[ INFO 2015-09-02 16:25:06 Init] Configuration from the file /etc/hammer/cli.modules.d/katello.yml has been loaded
[DEBUG 2015-09-02 16:25:06 Connection] Registered: foreman
[DEBUG 2015-09-02 16:25:06 API] Global headers: {
        :content_type => "application/json",
              :accept => "application/json;version=2",
    "Accept-Language" => "en"
}
[ INFO 2015-09-02 16:25:06 Modules] Extension module hammer_cli_foreman (0.1.4.14) loaded
[ INFO 2015-09-02 16:25:06 Modules] Extension module hammer_cli_foreman_bootdisk (0.1.2.7) loaded
[ INFO 2015-09-02 16:25:06 Modules] Extension module hammer_cli_foreman_discovery (0.0.1.10) loaded
[ INFO 2015-09-02 16:25:07 HammerCLI::MainCommand] subcommand organization (HammerCLIForeman::Organization) was removed.
[ INFO 2015-09-02 16:25:07 HammerCLI::MainCommand] subcommand organization (HammerCLIKatello::Organization) was created.
[ INFO 2015-09-02 16:25:07 Modules] Extension module hammer_cli_gutterball (0.0.1.3) loaded
[ INFO 2015-09-02 16:25:07 Modules] Extension module hammer_cli_import (0.10.20) loaded
[ INFO 2015-09-02 16:25:07 Modules] Extension module hammer_cli_katello (0.0.7.17) loaded
[DEBUG 2015-09-02 16:25:07 Init] Using locale 'en'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer-cli' loaded from '/usr/share/gems/gems/hammer_cli-0.1.4.12/locale'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer-cli@system' loaded from '/usr/share/locale'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer-cli-foreman' loaded from '/usr/share/gems/gems/hammer_cli_foreman-0.1.4.14/locale'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer-cli-foreman@system' loaded from '/usr/share/locale'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer_cli_foreman_docker' loaded from '/usr/share/gems/gems/hammer_cli_foreman_docker-0.0.3.9/locale'
[DEBUG 2015-09-02 16:25:07 Init] 'mo' files for locale domain 'hammer-cli-katello' loaded from '/usr/share/gems/gems/hammer_cli_katello-0.0.7.17/locale'
[ INFO 2015-09-02 16:25:07 HammerCLI::MainCommand] Called with options: {"option_debug"=>true, "option_username"=>"admin", "option_password"=>"***"}
[ INFO 2015-09-02 16:25:07 HammerCLIForemanDocker::DockerCommand] Called with options: {}
[ INFO 2015-09-02 16:25:07 HammerCLIForemanDocker::DockerRegistryCommand] Called with options: {}
[ INFO 2015-09-02 16:25:07 HammerCLIForemanDocker::DockerRegistryCommand::InfoCommand] Called with options: {"option_id"=>"2"}
[ INFO 2015-09-02 16:25:07 API] GET /docker/api/v2/registries/2
[DEBUG 2015-09-02 16:25:07 API] Params: {}
[DEBUG 2015-09-02 16:25:07 API] Headers: {
    :params => {}
}
[DEBUG 2015-09-02 16:25:07 API] Response: {
               "id" => 2,
             "name" => "Red Hat Docker Registry",
              "url" => "https://registry.access.redhat.com",
      "description" => nil,
       "created_at" => "2015-09-02T19:28:33Z",
       "updated_at" => "2015-09-02T20:24:51Z",
        "locations" => [],
    "organizations" => []
}
[DEBUG 2015-09-02 16:25:07 API] Response headers: {
                   :date => "Wed, 02 Sep 2015 20:25:07 GMT",
                 :server => "Apache/2.4.6 (Red Hat Enterprise Linux)",
        :foreman_version => "1.7.2",
    :foreman_api_version => "2",
        :x_ua_compatible => "IE=Edge,chrome=1",
          :cache_control => "must-revalidate, private, max-age=0",
           :x_request_id => "a0fedd63901dfcfed505917ca8ef51bb",
              :x_runtime => "0.054340",
           :x_rack_cache => "miss",
           :x_powered_by => "Phusion Passenger 4.0.18",
             :set_cookie => [
        [0] "_session_id=BAh7B0kiD3Nlc3Npb25faWQGOgZFRkkiJWNkOTU0ZTRjYjU4ODMyYThjOTc2NmRiMWQwM2M4OWUwBjsAVEkiC2xvY2FsZQY7AEYiB2Vu--67efdbc1c468785e0e4945ace6a6a83ba3907dab; path=/; secure; HttpOnly"
    ],
                   :etag => "\"71f8a3f3f2b750eab907421469b85345\"",
                 :status => "200 OK",
      :transfer_encoding => "chunked",
           :content_type => "application/json; charset=utf-8"
}
ID:         2
Name:       Red Hat Docker Registry
URL:        https://registry.access.redhat.com
Created at: 2015/09/02 19:28:33
Updated at: 2015/09/02 20:24:51

Comment 1 Partha Aji 2015-09-02 20:37:30 UTC
Created redmine issue http://projects.theforeman.org/issues/11672 from this bug

Comment 2 Bryan Kearney 2015-09-02 22:04:34 UTC
Upstream bug assigned to paji

Comment 3 Bryan Kearney 2015-09-02 22:04:35 UTC
Upstream bug component is Container Management

Comment 4 Bryan Kearney 2015-09-02 22:04:36 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/11672 has been closed
-------------
Partha Aji
Applied in changeset commit:foreman-docker|cf318d7fd58b7ed0f8ada54ab5f00b2a2a46ae9d.

Comment 6 Elyézer Rezende 2015-11-04 18:53:29 UTC
Verified on: Satellite-6.1.0-RHEL-7-20151030.2

Steps to verify:

1. Created a registry thru the UI
2. Ran `hammer -u admin -p password -d docker registry info --id 1` and checked the API results.

The API is now returning the username field and value, but the CLI output is not showing it. CLI side will be handled by a new issue if some already exist for this.

Comment 10 errata-xmlrpc 2015-11-19 15:56:57 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, 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/RHBA-2015:2474


Note You need to log in before you can comment on or make changes to this bug.