> On Feb. 13, 2017, 11:41 a.m., Alexander Rojas wrote: > > 3rdparty/libprocess/src/authenticator_manager.cpp > > Lines 102-128 (patched) > > <https://reviews.apache.org/r/56474/diff/2/?file=1630603#file1630603line102> > > > > Not so sure about all the continues and the handling of different cases > > here. How about doing something like first processing the `unauthorized` > > items and then the `forbidden` ones, i.e. > > > > ```c++ > > foreach (const AuthenticationResult& result, results) { > > if (result.unauthorized.isNone()) { > > continue; > > } > > > > // ... Code to merge unauthorized. > > } > > > > if (unauthorized.isSome()) { > > return unauthorized; > > } > > > > > > foreach (const AuthenticationResult& result, results) { > > if (result.forbidden.isNone()) { > > continue; > > } > > > > // ... Code to merge forbidden. > > } > > > > if (forbidden.isSome()) { > > return forbidden; > > } > > > > return None(); > > ```
Thanks for this suggestion; code looks much better now! - Greg ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/56474/#review165304 ----------------------------------------------------------- On March 9, 2017, 11:43 p.m., Greg Mann wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/56474/ > ----------------------------------------------------------- > > (Updated March 9, 2017, 11:43 p.m.) > > > Review request for mesos, Alexander Rojas, Jan Schlicht, Till Toenshoff, and > Vinod Kone. > > > Bugs: MESOS-7004 > https://issues.apache.org/jira/browse/MESOS-7004 > > > Repository: mesos > > > Description > ------- > > This patch adds a new default authenticator, the > `CombinedAuthenticator`, which can load multiple authenticators. > It calls installed authenticators serially, returning the first > successful result. When no results are successful, it returns a > single result obtained by merging all unsuccessful results. > > > Diffs > ----- > > include/mesos/authentication/http/combined_authenticator.hpp PRE-CREATION > src/Makefile.am bb917c5d1b36f5106a74914fa3a864038a95e8bb > src/authentication/http/combined_authenticator.cpp PRE-CREATION > > > Diff: https://reviews.apache.org/r/56474/diff/3/ > > > Testing > ------- > > Testing information can be found in the subsequent patch in this chain. > > > Thanks, > > Greg Mann > >