Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mimic: mgr/dashboard: Add support for URI encode #24488

Merged
merged 3 commits into from Oct 30, 2018

Conversation

tspmelo
Copy link
Contributor

@tspmelo tspmelo commented Oct 9, 2018

Signed-off-by: Tiago Melo <tmelo@suse.com>
(cherry picked from commit 44ea474)

Conflicts:
  src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts
    Had to remove new codew related to permissions
  src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts
    Had to remove code for a new parameter
Tiago Melo and others added 2 commits October 9, 2018 15:21
Created a decorator and pipe to help encode special URI components in the
frontend.

Modified the backend request handler to decode all the string args.

fixes: http://tracker.ceph.com/issues/24621

Signed-off-by: Tiago Melo <tmelo@suse.com>
(cherry picked from commit f21d0da)

Conflicts:
  (all paths are relative to src/pybind/mgr/dashboard/)
  controllers/__init__.py
    Method where the new code was doesn't exist in mimic, has to put it
in another method
  frontend/src/app/ceph/block/rbd-list/rbd-list.component.html
  frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.html
  frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts
  frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.html
  frontend/src/app/shared/api/pool.service.ts
  frontend/src/app/shared/api/rbd.service.spec.ts
    file doesn't exist in mimic
  frontend/src/app/shared/api/rbd.service.ts
  frontend/src/app/shared/api/rgw-bucket.service.ts
  frontend/src/app/shared/api/rgw-daemon.service.ts
  frontend/src/app/shared/api/rgw-user.service.ts
By enconding all parameters of api services we were also encoding parameters
that were being sent in the body of the request.
Those parameters don't need to be enconded and the server never decodes them.

With this new decorator you can specify if you don't want a parameter to be
enconded.

This is a regression introduced in f21d0da.

Fixes: http://tracker.ceph.com/issues/26856

Signed-off-by: Tiago Melo <tmelo@suse.com>
(cherry picked from commit 45e645b)

Conflicts:
  src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.spec.ts
  src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts
@smithfarm
Copy link
Contributor

jenkins re-test this please

@smithfarm
Copy link
Contributor

@tspmelo Why is this DNM?

@tspmelo
Copy link
Contributor Author

tspmelo commented Oct 10, 2018

@smithfarm I was told that #24183 might be backported to mimic.
If that is the case, this PR would already be included and merging it would created conflicts.

The same applies to #24478.

@tspmelo tspmelo removed the DNM label Oct 18, 2018
@tspmelo tspmelo changed the title [WIP] mimic: mgr/dashboard: Add support for URI encode mimic: mgr/dashboard: Add support for URI encode Oct 18, 2018
@@ -16,6 +16,12 @@
import threading
import types # pylint: disable=import-error

if sys.version_info >= (3, 0):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny thing. #24626 contains a better way to import unquote

Suggested change
if sys.version_info >= (3, 0):
from six.moves.urllib.parse import unquote # pylint: disable=import-error

But I wouldn't change it in Mimic only.

@LenzGr LenzGr changed the title mimic: mgr/dashboard: Add support for URI encode [DNM] mimic: mgr/dashboard: Add support for URI encode Oct 19, 2018
@LenzGr LenzGr added the DNM label Oct 19, 2018
@LenzGr
Copy link
Contributor

LenzGr commented Oct 19, 2018

Waiting for @rjfd to review/approve.

Copy link
Contributor

@rjfd rjfd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@tspmelo tspmelo changed the title [DNM] mimic: mgr/dashboard: Add support for URI encode mimic: mgr/dashboard: Add support for URI encode Oct 25, 2018
@smithfarm smithfarm requested a review from LenzGr October 25, 2018 12:58
@smithfarm smithfarm removed the request for review from LenzGr October 25, 2018 12:59
Copy link
Contributor

@LenzGr LenzGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@yuriw
Copy link
Contributor

yuriw commented Oct 27, 2018

@yuriw yuriw merged commit e878004 into ceph:mimic Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants