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 commented Oct 9, 2018

mgr/dashboard: Prettify some frontend files
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

tspmelo added some commits Jun 22, 2018

mgr/dashboard: Add support for URI encode
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
mgr/dashboard: Add decorator to skip parameter encoding
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

@tspmelo tspmelo force-pushed the tspmelo:wip-24907-mimic branch from b33ca5a to eda4df3 Oct 9, 2018

@ricardoasmarques ricardoasmarques added this to the mimic milestone Oct 10, 2018

@ricardoasmarques ricardoasmarques added backport and removed backport labels Oct 10, 2018

@smithfarm

This comment has been minimized.

Copy link
Contributor

smithfarm commented Oct 10, 2018

jenkins re-test this please

@smithfarm

This comment has been minimized.

Copy link
Contributor

smithfarm commented Oct 10, 2018

@tspmelo Why is this DNM?

@tspmelo

This comment has been minimized.

Copy link
Contributor

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

@LenzGr LenzGr requested review from rjfd , votdev and sebastian-philipp Oct 18, 2018

@@ -16,6 +16,12 @@
import threading
import types # pylint: disable=import-error

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

This comment has been minimized.

@sebastian-philipp

sebastian-philipp Oct 18, 2018

Member

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

Suggested change Beta
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

This comment has been minimized.

Copy link
Contributor

LenzGr commented Oct 19, 2018

Waiting for @rjfd to review/approve.

@rjfd

rjfd approved these changes Oct 25, 2018

Copy link
Contributor

rjfd left a comment

lgtm

@rjfd rjfd added needs-qa and removed DNM needs-review labels Oct 25, 2018

@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 Oct 25, 2018

@smithfarm smithfarm removed the request for review from LenzGr Oct 25, 2018

@LenzGr

LenzGr approved these changes Oct 25, 2018

Copy link
Contributor

LenzGr left a comment

LGTM, thanks

@yuriw

This comment has been minimized.

Copy link
Contributor

yuriw commented Oct 27, 2018

@yuriw yuriw merged commit e878004 into ceph:mimic Oct 30, 2018

4 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment