----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/47794/#review135177 -----------------------------------------------------------
Ship it! Looks great! I could debate while vs. do/while, but the difference is negligible. src/files/files.cpp (lines 305 - 315) <https://reviews.apache.org/r/47794/#comment200194> A slight inefficiency in your algorithm occurs when requestedPath="/" and there are no authorizations for it. 305: if(authz["/"]) -> false, skip 310: reqPath = "/" (it is its own dirname) 312: if(authz["/"]) -> still false 315: while("/".dirname() != "/") -> false, exit If this were a while instead of a do/while, the loop condition would have prevented the double-evaluation on lines 305+312. But this is a minor optimization for a case which does not (and should not) occur in the Mesos code base, so I'm willing to allow the do/while if you feel it is more readable. - Adam B On May 26, 2016, 9:32 p.m., Alexander Rojas wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/47794/ > ----------------------------------------------------------- > > (Updated May 26, 2016, 9:32 p.m.) > > > Review request for mesos, Adam B, Benjamin Mahler, Joerg Schad, Michael Park, > and Vinod Kone. > > > Bugs: MESOS-5153 > https://issues.apache.org/jira/browse/MESOS-5153 > > > Repository: mesos > > > Description > ------- > > Adds an optional parameter to the `mesos::internal::Files::attach()` > method. The type of this parameter is a callable object which returns > a future to a boolean and takes as parameter an optional string > representing a principal name. > > The parameter is called, if set, whenever one of the routed endpoints > of the `Files` object is accessed through HTTP. If the callable object > returns a false boolean, then processing of the request is aborted > and a `403 Forbidden` response is returned. > > > Diffs > ----- > > src/files/files.hpp 90acb3406c46c164108deb559af71fb109a5773b > src/files/files.cpp e4b0ada00aabba6553810391f4015a896f8a69a5 > src/tests/files_tests.cpp 5d6620d13babaf0bb7f9c888bb1b4fa2228b6ccd > > Diff: https://reviews.apache.org/r/47794/diff/ > > > Testing > ------- > > On OSX: > `make check` > > > Thanks, > > Alexander Rojas > >
