Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 05CE0200C1D for ; Thu, 16 Feb 2017 11:58:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 047C0160B61; Thu, 16 Feb 2017 10:58:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 50D79160B57 for ; Thu, 16 Feb 2017 11:58:35 +0100 (CET) Received: (qmail 73875 invoked by uid 500); 16 Feb 2017 10:58:34 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 73858 invoked by uid 99); 16 Feb 2017 10:58:34 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Feb 2017 10:58:34 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 0F8EA1C017B; Thu, 16 Feb 2017 10:58:33 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============7220488807221707783==" MIME-Version: 1.0 Subject: Re: Review Request 56618: Updated common Mesos code to use 'AuthenticationContext'. From: Alexander Rojas To: Alexander Rojas , Adam B , Vinod Kone , Till Toenshoff , Jan Schlicht Cc: Greg Mann , mesos Date: Thu, 16 Feb 2017 10:58:33 -0000 Message-ID: <20170216105833.13057.862@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Alexander Rojas X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/56618/ X-Sender: Alexander Rojas References: <20170214151222.13057.53008@reviews.apache.org> In-Reply-To: <20170214151222.13057.53008@reviews.apache.org> Reply-To: Alexander Rojas X-ReviewRequest-Repository: mesos archived-at: Thu, 16 Feb 2017 10:58:36 -0000 --===============7220488807221707783== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Feb. 14, 2017, 4:12 p.m., Jan Schlicht wrote: > > src/common/http.hpp, line 133 > > > > > > How about using an `Option` 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? We discussed this, and the semantics of a default created `authorization::Subject` are different from that of a non setted subject, therefore this is a bad idea. However, there may be a related bug already inside Mesos authorizer for not paying attention to the different semantics. We still need to build a test for it. - Alexander ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/56618/#review165511 ----------------------------------------------------------- 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 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 > > --===============7220488807221707783==--