[ 
https://issues.apache.org/jira/browse/STORM-1129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14990361#comment-14990361
 ] 

ASF GitHub Bot commented on STORM-1129:
---------------------------------------

Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/854#discussion_r43935706
  
    --- Diff: storm-core/src/clj/backtype/storm/ui/core.clj ---
    @@ -851,141 +859,151 @@
         (populate-context! servlet-request)
         (assert-authorized-user "getClusterInfo")
         (json-response (all-topologies-summary) (:callback m)))
    -  (GET "/api/v1/topology/:id" [:as {:keys [cookies servlet-request 
scheme]} id & m]
    -    (populate-context! servlet-request)
    -    (assert-authorized-user "getTopology" (topology-config id))
    -    (let [user (get-user-name servlet-request)]
    -      (json-response (topology-page id (:window m) (check-include-sys? 
(:sys m)) user (= scheme :https)) (:callback m))))
    -  (GET "/api/v1/topology/:id/visualization-init" [:as {:keys [cookies 
servlet-request]} id & m]
    -    (populate-context! servlet-request)
    -    (assert-authorized-user "getTopology" (topology-config id))
    -    (json-response (build-visualization id (:window m) (check-include-sys? 
(:sys m))) (:callback m)))
    -  (GET "/api/v1/topology/:id/visualization" [:as {:keys [cookies 
servlet-request]} id & m]
    -    (populate-context! servlet-request)
    -    (assert-authorized-user "getTopology" (topology-config id))
    -    (json-response (mk-visualization-data id (:window m) 
(check-include-sys? (:sys m))) (:callback m)))
    -  (GET "/api/v1/topology/:id/component/:component" [:as {:keys [cookies 
servlet-request scheme]} id component & m]
    -    (populate-context! servlet-request)
    -    (assert-authorized-user "getTopology" (topology-config id))
    -    (let [user (get-user-name servlet-request)]
    -      (json-response
    -          (component-page id component (:window m) (check-include-sys? 
(:sys m)) user (= scheme :https))
    -          (:callback m))))
    -  (GET "/api/v1/topology/:id/logconfig" [:as {:keys [cookies 
servlet-request]} id & m]
    -    (populate-context! servlet-request)
    -    (assert-authorized-user "getTopology" (topology-config id))
    -       (json-response (log-config id) (:callback m)))
    -  (POST "/api/v1/topology/:id/activate" [:as {:keys [cookies 
servlet-request]} id & m]
    -    (populate-context! servlet-request)
    -    (assert-authorized-user "activate" (topology-config id))
    -    (thrift/with-configured-nimbus-connection nimbus
    -       (let [tplg (->> (doto
    -                        (GetInfoOptions.)
    -                        (.set_num_err_choice NumErrorsChoice/NONE))
    -                      (.getTopologyInfoWithOpts ^Nimbus$Client nimbus id))
    -            name (.get_name tplg)]
    -        (.activate nimbus name)
    -        (log-message "Activating topology '" name "'")))
    -    (json-response (topology-op-response id "activate") (m "callback")))
    -  (POST "/api/v1/topology/:id/deactivate" [:as {:keys [cookies 
servlet-request]} id & m]
    -    (populate-context! servlet-request)
    -    (assert-authorized-user "deactivate" (topology-config id))
    -    (thrift/with-configured-nimbus-connection nimbus
    +  (GET "/api/v1/topology/:name" [:as {:keys [cookies servlet-request 
scheme]} name & m]
    +    (let [id (get-id-from-name name)]
    +      (populate-context! servlet-request)
    --- End diff --
    
    We have to populate the context before ever talking to nimbus.  
`get-id-from-name` talks to nimbus and could potentially authenticate with the 
wrong user to nimbus.  This needs to be fixed everywhere.


> Storm should use topology name instead of ids for url in storm UI.
> ------------------------------------------------------------------
>
>                 Key: STORM-1129
>                 URL: https://issues.apache.org/jira/browse/STORM-1129
>             Project: Apache Storm
>          Issue Type: Bug
>          Components: storm-core
>            Reporter: Priyank Shah
>            Assignee: Priyank Shah
>
> Currently, in storm UI details about a topology can be viewed at a URL which 
> has a topology id as a query parameter. When a topology is updated and  
> redeployed a new id is assigned by storm and existing URL(and any bookmarks 
> relying on it) for the topology do not work since the id has changed. We 
> should change it so that topology name is used instead of id.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to