mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Schlicht <...@mesosphere.io>
Subject Re: Review Request 56618: Updated common Mesos code to use 'AuthenticationContext'.
Date Tue, 14 Feb 2017 15:12:22 GMT

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



This look great already. But I'll need more time to deeply review this, e.g. I'll do another
round, this are the few things I found while quickly looking over the patch.


src/common/http.hpp (line 132)
<https://reviews.apache.org/r/56618/#comment237353>

    Why `const` when you're returning a value?



src/common/http.hpp (line 133)
<https://reviews.apache.org/r/56618/#comment237352>

    How about using an `Option<AuthenticationContext>` here and returning `Subject()`
in the case of `context.isNone()`?
    All calls to this functions in the following patch are either
    ```
    authorization::Subject subject = context.isSome()
      ? createAuthorizationSubject(context.get())
      : authorization::Subject();
    ```
    or
    ```
    if (context.isSome()) {
      request.mutable_subject()->CopyFrom(createAuthorizationSubject(context.get()));
    }
    ```
    At least the first form would look much simpler and concise when changing the function
signature this way:
    ```
    authorization::Subject subject = createAuthorizationSubject(context)
    ```
    What do you think?


- Jan Schlicht


On Feb. 14, 2017, 12:46 a.m., Greg Mann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/56618/
> -----------------------------------------------------------
> 
> (Updated Feb. 14, 2017, 12:46 a.m.)
> 
> 
> Review request for mesos, Adam B, Alexander Rojas, Jan Schlicht, Till Toenshoff, and
Vinod Kone.
> 
> 
> Bugs: MESOS-7003
>     https://issues.apache.org/jira/browse/MESOS-7003
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This patch updates common Mesos HTTP-related helpers,
> as well as the `authorization::Subject` protobuf
> message, to make use of the `AuthenticationContext`
> type instead of an `Option<string> principal`.
> 
> 
> Diffs
> -----
> 
>   include/mesos/authorizer/authorizer.proto 8b860a3e8e0b1c660a8fefc97f10f5acc0501920

>   src/common/http.hpp 3d5ab59ddc4dce4d791c1b439f5e1459d1a724a4 
>   src/common/http.cpp abfbf7248beb2d4068be06b7f5f829d7617f943e 
> 
> Diff: https://reviews.apache.org/r/56618/diff/
> 
> 
> Testing
> -------
> 
> Testing information can be found at the end of this review chain.
> 
> 
> Thanks,
> 
> Greg Mann
> 
>


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