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 74E62200D51 for ; Thu, 23 Nov 2017 06:27:47 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 73716160C0F; Thu, 23 Nov 2017 05:27:47 +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 BAA70160BFD for ; Thu, 23 Nov 2017 06:27:46 +0100 (CET) Received: (qmail 19920 invoked by uid 500); 23 Nov 2017 05:27:45 -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 19909 invoked by uid 99); 23 Nov 2017 05:27:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Nov 2017 05:27:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C61781805C4; Thu, 23 Nov 2017 05:27:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.451 X-Spam-Level: **** X-Spam-Status: No, score=4.451 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, KAM_LOTSOFHASH=0.25, NML_ADSP_CUSTOM_MED=1.2, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 8ETSmJCkyJGf; Thu, 23 Nov 2017 05:27:43 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 8334761E0C; Thu, 23 Nov 2017 05:27:42 +0000 (UTC) Received: from reviews.apache.org (unknown [10.41.0.12]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CFE4FE0237; Thu, 23 Nov 2017 05:27:41 +0000 (UTC) Received: from reviews-vm2.apache.org (localhost [IPv6:::1]) by reviews.apache.org (ASF Mail Server at reviews-vm2.apache.org) with ESMTP id C9A88C40158; Thu, 23 Nov 2017 05:27:41 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============7461391204900782936==" MIME-Version: 1.0 Subject: Re: Review Request 62762: Added `LocalResourceProvider::principal()` for authentication. From: Jie Yu To: Jie Yu , Alexander Rojas , Joseph Wu , Greg Mann Cc: Chun-Hung Hsiao , mesos Date: Thu, 23 Nov 2017 05:27:41 -0000 Message-ID: <20171123052741.55922.16753@reviews-vm2.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Jie Yu X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/62762/ X-Sender: Jie Yu References: <20171122031010.49374.96987@reviews-vm2.apache.org> In-Reply-To: <20171122031010.49374.96987@reviews-vm2.apache.org> Reply-To: Jie Yu X-ReviewRequest-Repository: mesos archived-at: Thu, 23 Nov 2017 05:27:47 -0000 --===============7461391204900782936== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/62762/#review191779 ----------------------------------------------------------- src/resource_provider/local.cpp Lines 35-40 (patched) see my comments below, you probably do not need this struct anymore. src/resource_provider/local.cpp Lines 45 (patched) We try to avoid non-POD (plain old data) global variables because it'll cause issues during exit (see google style guide). So I'll make this a helper function. src/resource_provider/local.cpp Lines 49 (patched) Do we still need this? It looks to me that the current naming scheme makes it so that you don't have to customize it for each LRP? - Jie Yu On Nov. 22, 2017, 3:10 a.m., Chun-Hung Hsiao wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/62762/ > ----------------------------------------------------------- > > (Updated Nov. 22, 2017, 3:10 a.m.) > > > Review request for mesos, Alexander Rojas, Greg Mann, Jie Yu, and Joseph Wu. > > > Bugs: MESOS-8100 > https://issues.apache.org/jira/browse/MESOS-8100 > > > Repository: mesos > > > Description > ------- > > The `LocalResourceProvider::principal()` function takes a > `ResourceProviderInfo` and generates a principal with the following > claim: > > {"cid_prefix", ---} > > For example, for resource provider with type > 'org.apache.mesos.rp.local.storage' and name 'foo', the claim would be: > > {"cid_prefix", "org-apache-mesos-rp-local-storage-foo--"} > > In the future, we could add more claims for authorizing other > operations, such as authorization for Resource Provider API. > > > Diffs > ----- > > src/resource_provider/local.hpp ebaa07d03ad77d516066ee2d4b60864be0611b5f > src/resource_provider/local.cpp ad98f333c5668ca81de6e7ed3fc8f59323b151da > src/resource_provider/storage/provider.hpp 6de88c2329b358fcf48bc39ddda0132170991c3c > src/resource_provider/storage/provider.cpp 46224997430ac0c568904d80014166a6f059907f > > > Diff: https://reviews.apache.org/r/62762/diff/8/ > > > Testing > ------- > > make > > > Thanks, > > Chun-Hung Hsiao > > --===============7461391204900782936==--