Return-Path: X-Original-To: apmail-zookeeper-dev-archive@www.apache.org Delivered-To: apmail-zookeeper-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 99125DF75 for ; Wed, 1 Aug 2012 21:19:35 +0000 (UTC) Received: (qmail 54533 invoked by uid 500); 1 Aug 2012 21:19:35 -0000 Delivered-To: apmail-zookeeper-dev-archive@zookeeper.apache.org Received: (qmail 54512 invoked by uid 500); 1 Aug 2012 21:19:35 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 54495 invoked by uid 99); 1 Aug 2012 21:19:35 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2012 21:19:35 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 585B41C1924; Wed, 1 Aug 2012 21:19:34 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============1069564542759695033==" MIME-Version: 1.0 Subject: Re: Review Request: Allow server-side SASL login with JAAS configuration to be programmatically set (rather than only by reading JAAS configuration file) From: "Eugene Koontz" To: "Eugene Koontz" , "Patrick Hunt" Cc: "Matteo Bertozzi" , "zookeeper" Date: Wed, 01 Aug 2012 21:19:34 -0000 Message-ID: <20120801211934.22302.85076@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Eugene Koontz" X-ReviewGroup: zookeeper X-ReviewRequest-URL: https://reviews.apache.org/r/6290/ X-Sender: "Eugene Koontz" References: <20120801183838.22302.29196@reviews.apache.org> In-Reply-To: <20120801183838.22302.29196@reviews.apache.org> Reply-To: "Eugene Koontz" --===============1069564542759695033== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable > On Aug. 1, 2012, 6:38 p.m., Patrick Hunt wrote: > > /src/java/test/org/apache/zookeeper/test/SaslAuthDesignatedServerTest.j= ava, line 77 > > > > > > why is this sleep here? > = > Eugene Koontz wrote: > These sleep()s are present in other SASL-related tests (for example S= aslAuthTest) as a work-around for ZOOKEEPER-1437: without the sleep()s, the= client may be denied permission because the SASL authentication process ha= s not completed yet. In the patch for ZOOKEEPER-1437, these sleeps are remo= ved, and thus could be removed also here, too. > = > Patrick Hunt wrote: > Ah. Thanks Eugene. However given we know this is a SASL connection ca= n't we just look for the KeeperState.SaslAuthenticated to come to the watch= er? > = > Eugene Koontz wrote: > Sure, that should work. Perhaps I should file a new JIRA for removing= the various sleep()s in the existing tests (and mentioning this JIRA too),= and replace with watches? > = > Patrick Hunt wrote: > Sounds good. Although we should have a specific test that exercises t= his case for ZOOKEEPER-1437, such a test is included in 1437? The latest patch for ZOOKEEPER-1437 simply remove the sleep()s from the tes= ts but do not do not add any watches for the SaslAuthenticated event. So I = will add watches in a new patch for ZK-1437. - Eugene ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/6290/#review9703 ----------------------------------------------------------- On Aug. 1, 2012, 8:33 p.m., Matteo Bertozzi wrote: > = > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/6290/ > ----------------------------------------------------------- > = > (Updated Aug. 1, 2012, 8:33 p.m.) > = > = > Review request for zookeeper, Patrick Hunt and Eugene Koontz. > = > = > Description > ------- > = > Currently the CnxnFactory checks for "java.security.auth.login.config" to= decide whether or not enable SASL. > - zookeeper/server/NIOServerCnxnFactory.java = > - zookeeper/server/NettyServerCnxnFactory.java > - configure() checks for "java.security.auth.login.config" > - If present start the new Login("Server", SaslServerCallbackHandler(= conf)) > = > But since the SaslServerCallbackHandler does the right thing just checkin= g if getAppConfigurationEntry() is empty, we can allow SASL with JAAS confi= guration to be programmatically just checking weather or not a configuratio= n entry is present instead of "java.security.auth.login.config". > (Something quite similar was done for the SaslClient in ZOOKEEPER-1373) > = > = > This addresses bug ZOOKEEPER-1497. > https://issues.apache.org/jira/browse/ZOOKEEPER-1497 > = > = > Diffs > ----- > = > /src/java/main/org/apache/zookeeper/Environment.java 1368201 = > /src/java/main/org/apache/zookeeper/client/ZooKeeperSaslClient.java 136= 8201 = > /src/java/main/org/apache/zookeeper/server/NIOServerCnxnFactory.java 13= 68201 = > /src/java/main/org/apache/zookeeper/server/NettyServerCnxnFactory.java = 1368201 = > /src/java/main/org/apache/zookeeper/server/ServerCnxnFactory.java 13682= 01 = > /src/java/main/org/apache/zookeeper/server/ZooKeeperSaslServer.java 136= 8201 = > /src/java/main/org/apache/zookeeper/server/auth/SaslServerCallbackHandl= er.java 1368201 = > /src/java/test/org/apache/zookeeper/JaasConfiguration.java PRE-CREATION = > /src/java/test/org/apache/zookeeper/test/ClientBase.java 1368201 = > /src/java/test/org/apache/zookeeper/test/SaslAuthDesignatedServerTest.j= ava PRE-CREATION = > = > Diff: https://reviews.apache.org/r/6290/diff/ > = > = > Testing > ------- > = > New testcase added SaslAuthDesignatedServerTest to check if ZooKeeperSasl= Server.LOGIN_CONTEXT_NAME_KEY is used. > (A new JaasConfiguration class was added to wrap the jaas.conf) > = > +Manual testing for HBASE-4791 > = > = > Thanks, > = > Matteo Bertozzi > = > --===============1069564542759695033==--