mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinod Kone <vinodk...@gmail.com>
Subject Re: Review Request 49394: Added support for VIEW_FLAGS authorization action in HTTP API (V2).
Date Wed, 29 Jun 2016 20:53:45 GMT

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/49394/#review140047
-----------------------------------------------------------



looking good. minor comments.


src/master/http.cpp (line 1463)
<https://reviews.apache.org/r/49394/#comment205370>

    seems weird for `_flags()` to take Option<string> jsonp when it is not going to
be used by RPC handler. 
    
    why  not do jsonp logic here?
    
    ```
    return _flags(principal)
      .then([request](const Response& response) -> Response) {
        if (response.status != OK().status) {
          return response;
        }
        
        Try<JSON::Object> json = JSON::parse<JSON::Object>(response.body);
    
        if (json.isError()) {
          return InternalServerError(json.error());
        }
        
        return OK(json.get(), request.url.querty.get("jsonp"));
      }
    ```



src/master/http.cpp (line 1468)
<https://reviews.apache.org/r/49394/#comment205371>

    each parameter should be on a different line. but if you make the change above, this will
only take `principal`.



src/master/http.cpp (lines 1471 - 1490)
<https://reviews.apache.org/r/49394/#comment205372>

    no need for jsonp logic here.



src/master/http.cpp (lines 1521 - 1523)
<https://reviews.apache.org/r/49394/#comment205373>

    no need to defer because this is just a static lambda that doesn't use any master's internal
data.


- Vinod Kone


On June 29, 2016, 8:38 p.m., Alexander Rojas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/49394/
> -----------------------------------------------------------
> 
> (Updated June 29, 2016, 8:38 p.m.)
> 
> 
> Review request for mesos and Vinod Kone.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Adds a call to `authorizer::authorize()` where the HTTP API builds
> the response for a query of the command-line flags given to start
> the master.
> 
> 
> Diffs
> -----
> 
>   src/common/http.hpp 55bd0ac81af80c656a4a80766a3e4b21db9cf0cf 
>   src/master/http.cpp e5acdb8e0bbcd7a2b7e8a8bc7f4bbeaae2c4fea1 
>   src/master/master.hpp e2ab2110fe5a287ab16ac9ef4222fed633e02ebe 
> 
> Diff: https://reviews.apache.org/r/49394/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Alexander Rojas
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message