Authentication required for capacity report

Bug #1362615 reported by Daniele Pizzolli
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Released
Critical
Kamil Sambor
5.1.x
Fix Released
Critical
Przemyslaw Kaminski

Bug Description

Using fuel-community-5.1-11-2014-08-28_05-19-34.iso I was able
to install openstack.

The only strange thing is the response "Authentication required" at url
http://10.20.0.2:8000/api/capacity/csv after clicking 'Download
report' in the capacity tab.

The Diagnostic Snapshot is attached.

Revision history for this message
Daniele Pizzolli (daniele-pizzolli) wrote :
Revision history for this message
Kamil Sambor (ksambor) wrote :

Request to /api/capacity/csv is sent without X-Auth-Token

Changed in fuel:
assignee: nobody → Fuel Python Team (fuel-python)
status: New → Confirmed
Changed in fuel:
importance: Undecided → High
milestone: none → 5.1
Revision history for this message
Ihor Kalnytskyi (ikalnytskyi) wrote :

Ok, we need to remove this hard-coded link

    https://github.com/stackforge/fuel-web/blob/master/nailgun/static/templates/capacity/page.html#L106

and handle this requests in JS part with X-Auth-Token header.

Changed in fuel:
assignee: Fuel Python Team (fuel-python) → Fuel UI Team (fuel-ui)
status: Confirmed → Triaged
Revision history for this message
Vitaly Kramskikh (vkramskikh) wrote :

Well, the solution is not obvoius here. There are a few options:
1) Disable auth for that particular url (my favorite option as there is almost HCF)
2) Make generation asyncronous, just like we do it with diagnostic shapshot
3) Use https://github.com/eligrey/FileSaver.js/ . I don't like this option as it won't work for IE<10
4) Also accept tokens as get parameters

Revision history for this message
Vitaly Kramskikh (vkramskikh) wrote :

5) Also accept tokens as a cookie - this will also allow us to query api manually in browser

Revision history for this message
Vitaly Kramskikh (vkramskikh) wrote :

Let's go with option #1

Changed in fuel:
assignee: Fuel UI Team (fuel-ui) → Fuel Python Team (fuel-python)
Revision history for this message
Mike Scherbakov (mihgen) wrote :

Don't forget to create a bug then for 5.1.1 addressing this in a better way.

Revision history for this message
Mike Scherbakov (mihgen) wrote :

And, Daniele, thanks for the bug report!

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/117795

Revision history for this message
Mike Scherbakov (mihgen) wrote :

This is actually critical bug, as according to description, it totally blocks important feature, which is required for commercial installations.

Mike Scherbakov (mihgen)
no longer affects: fuel
no longer affects: fuel/5.1.x
Changed in fuel:
milestone: none → 5.1
assignee: nobody → Kamil Sambor (ksambor)
importance: Undecided → Critical
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/117795
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=f37b981161e6dabf212af4d7be9ef9f6a0de20af
Submitter: Jenkins
Branch: master

commit f37b981161e6dabf212af4d7be9ef9f6a0de20af
Author: Kamil Sambor <email address hidden>
Date: Fri Aug 29 15:57:33 2014 +0200

    Added capacity/log endpoint to public urls

    * added new test class
    * added tests
    * added capacity/log to public urls

    Change-Id: I3cdb8a3654d9da6e318bb3fa8ed8186c55b72aa7
    Closes-Bug: #1362615

Changed in fuel:
status: In Progress → Fix Committed
Revision history for this message
Anastasia Palkina (apalkina) wrote :

Verified on ISO #11

"build_id": "2014-09-17_21-40-34", "ostf_sha": "64cb59c681658a7a55cc2c09d079072a41beb346", "build_number": "11", "auth_required": true, "api": "1.0", "nailgun_sha": "eb8f2b358ea4bb7eb0b2a0075e7ad3d3a905db0d", "production": "docker", "fuelmain_sha": "8ef433e939425eabd1034c0b70e90bdf888b69fd", "astute_sha": "f5fbd89d1e0e1f22ef9ab2af26da5ffbfbf24b13", "feature_groups": ["mirantis"], "release": "5.1", "release_versions": {"2014.1.1-5.1": {"VERSION": {"build_id": "2014-09-17_21-40-34", "ostf_sha": "64cb59c681658a7a55cc2c09d079072a41beb346", "build_number": "11", "api": "1.0", "nailgun_sha": "eb8f2b358ea4bb7eb0b2a0075e7ad3d3a905db0d", "production": "docker", "fuelmain_sha": "8ef433e939425eabd1034c0b70e90bdf888b69fd", "astute_sha": "f5fbd89d1e0e1f22ef9ab2af26da5ffbfbf24b13", "feature_groups": ["mirantis"], "release": "5.1", "fuellib_sha": "d9b16846e54f76c8ebe7764d2b5b8231d6b25079"}}}, "fuellib_sha": "d9b16846e54f76c8ebe7764d2b5b8231d6b25079"

Changed in fuel:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

Fix proposed to branch: master
Review: https://review.openstack.org/127223

Revision history for this message
Przemyslaw Kaminski (pkaminski) wrote :

Here are the commits related to this bug:

commit 9a8d01ff1ac54bb9c3c737bdb9ff5c0a688f3013
Author: Przemyslaw Kaminski <email address hidden>
Date: Mon Oct 6 16:00:24 2014 +0200

    Add cookie-based authentication along with X-Auth-Token

    - added jquery.cookie as Bower dependency
    - fixed keystone.py middleware to process the cookie and inject X-Auth-Token
      into the request, X-Auth-Token still has priority though
    - fixed 401 response format to return iterable (list)
    - added test_auth_token for testing both authentication methods

    Change-Id: I01239c93b8f0d5da95424d44c96f6fb60ab378fd
    Implements: blueprint access-control-master-node-improvments

These 2 are yet unmerged to master:

https://review.openstack.org/#/c/127219/

commit 207580c58842166ef516b36e5917be251b7472ec
Author: Przemyslaw Kaminski <email address hidden>
Date: Thu Oct 9 14:28:46 2014 +0200

    Bring back X-Auth-Token by default

    It seems that requests are made to other places than API so this
    token is still required there (Health check for example with OSTF).

    Change-Id: I2f0e47a57b360abd04f2ca21fc013ccd34d84eec
    Closes-Bug: #1379000

https://review.openstack.org/127223

commit d721deb0268942692402a32a8b81f5e8dff9c7e2
Author: Przemyslaw Kaminski <email address hidden>
Date: Thu Oct 9 14:45:23 2014 +0200

    Remove capacity/csv from public URLs

    With the new cookie-based authentication this download link does
    not need anymore to be publicly accessible (the X-Auth-Token header
    was the reason to first make the link public).

    Change-Id: If72bb8fe764810c565fc08f960db3e19ddaf4fb9
    Closes-Bug: #1362615
    Related-Bug: #1379000

Revision history for this message
Przemyslaw Kaminski (pkaminski) wrote :

Oh, and 1 more commit related to this:

commit 1b8b0f92448c7d630eed0ff69146e7befc772fc2
Author: Przemyslaw Kaminski <email address hidden>
Date: Fri Oct 3 13:22:35 2014 +0200

    Revoke token from keystone after user logout

    Also, add test_login_logout.js

    Change-Id: Ibf1660624d3441c249b319fa69eb3775c9716b9c
    Closes-Bug: #1375622

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to fuel-web (stable/5.1)

Related fix proposed to branch: stable/5.1
Review: https://review.openstack.org/127234

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on fuel-web (stable/5.1)

Change abandoned by Przemyslaw Kaminski (<email address hidden>) on branch: stable/5.1
Review: https://review.openstack.org/127234

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/127223
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=7bd6b11e6808eebdcb12310c3a13d2e9583a8f44
Submitter: Jenkins
Branch: master

commit 7bd6b11e6808eebdcb12310c3a13d2e9583a8f44
Author: Przemyslaw Kaminski <email address hidden>
Date: Thu Oct 9 14:45:23 2014 +0200

    Remove capacity/csv from public URLs

    With the new cookie-based authentication this download link does
    not need anymore to be publicly accessible (the X-Auth-Token header
    was the reason to first make the link public).

    Change-Id: If72bb8fe764810c565fc08f960db3e19ddaf4fb9
    Closes-Bug: #1362615
    Related-Bug: #1379000

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (stable/5.1)

Fix proposed to branch: stable/5.1
Review: https://review.openstack.org/127500

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (stable/5.1)

Reviewed: https://review.openstack.org/127500
Committed: https://git.openstack.org/cgit/stackforge/fuel-web/commit/?id=88a94a11426d356540722593af1603e5089d442c
Submitter: Jenkins
Branch: stable/5.1

commit 88a94a11426d356540722593af1603e5089d442c
Author: Przemyslaw Kaminski <email address hidden>
Date: Thu Oct 9 14:45:23 2014 +0200

    Remove capacity/csv from public URLs

    With the new cookie-based authentication this download link does
    not need anymore to be publicly accessible (the X-Auth-Token header
    was the reason to first make the link public).

    Change-Id: If72bb8fe764810c565fc08f960db3e19ddaf4fb9
    Closes-Bug: #1362615
    Related-Bug: #1379000
    (cherry picked from commit 7bd6b11e6808eebdcb12310c3a13d2e9583a8f44)

Revision history for this message
Anastasia Palkina (apalkina) wrote :

Verified on ISO #17

"build_id": "2014-11-16_21-00-23", "ostf_sha": "64cb59c681658a7a55cc2c09d079072a41beb346", "build_number": "17", "auth_required": true, "api": "1.0", "nailgun_sha": "2fc6fc4261092a591779a8fb7e3fb1623c6abb85", "production": "docker", "fuelmain_sha": "b118fa4475833ce031ef189ce280772c676fa1c9", "astute_sha": "702af3db6f5bca92525bc8322d7d5d7675ec857e", "feature_groups": ["mirantis"], "release": "5.1.1", "release_versions": {"2014.1.3-5.1.1": {"VERSION": {"build_id": "2014-11-16_21-00-23", "ostf_sha": "64cb59c681658a7a55cc2c09d079072a41beb346", "build_number": "17", "api": "1.0", "nailgun_sha": "2fc6fc4261092a591779a8fb7e3fb1623c6abb85", "production": "docker", "fuelmain_sha": "b118fa4475833ce031ef189ce280772c676fa1c9", "astute_sha": "702af3db6f5bca92525bc8322d7d5d7675ec857e", "feature_groups": ["mirantis"], "release": "5.1.1", "fuellib_sha": "0d3909b9a291880af28dbe48b9c7d25215aa98ea"}}}, "fuellib_sha": "0d3909b9a291880af28dbe48b9c7d25215aa98ea"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.