mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Rojas <alexan...@mesosphere.io>
Subject Re: Review Request 47794: Added authorization support for mesos::internal::Files.
Date Fri, 27 May 2016 04:32:08 GMT


> On May 27, 2016, 3:45 a.m., Adam B wrote:
> > src/files/files.cpp, lines 305-317
> > <https://reviews.apache.org/r/47794/diff/3-4/?file=1395065#file1395065line305>
> >
> >     The loop body is quite simple, so I'd rather we duplicate it outside the loop
instead of special-casing the dirname "accumulator" logic.
> >     Wouldn't the following work just as well?
> >     ```
> >       if (authorizations.count(requestedPath) > 0) {
> >         return authorizations[requestedPath](principal);
> >       }
> >       while (Path(requestedPath).dirname() != requestedPath) {
> >         requestedPath = Path(requestedPath).dirname();
> >         if (authorizations.count(requestedPath) > 0) {
> >           return authorizations[requestedPath](principal);
> >         }
> >       }
> >     ```

I will still use the do/while, because it just looks weird that we check for a path and then
immidiatly change it, but I'm ok with the changes.


- Alexander


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/47794/#review135131
-----------------------------------------------------------


On May 26, 2016, 6:05 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, 6:05 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
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message