----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/40347/#review108645 -----------------------------------------------------------
include/mesos/quota/quota.proto (lines 43 - 45) <https://reviews.apache.org/r/40347/#comment168103> Do you think `principal` should be required? Does it mean quota cannot be requested without providing `Authorization` header? I think you do so in `authorize()` below. I think it's also fine to prohibit setting quota without prinicipal, but let's be consitent and explicit about it. src/master/master.hpp (lines 899 - 900) <https://reviews.apache.org/r/40347/#comment168105> Do you need the whole `QuotaInfo` or optional `principal` and role would suffice? src/master/quota_handler.cpp (line 82) <https://reviews.apache.org/r/40347/#comment168099> Do we need `Credential` here or principal would suffice? src/master/quota_handler.cpp (lines 94 - 96) <https://reviews.apache.org/r/40347/#comment168100> I think this may be buggy: `principal` is required, however we do not ensure it is present here, means we may create a protbuf message, that we cannot deserialize. src/master/quota_handler.cpp (lines 236 - 240) <https://reviews.apache.org/r/40347/#comment168110> Can we re-write it using a lambda? This way you do not need to inject `authorized` into the continuation. ``` authorize(quotaInfo) .then(defer(master->self(), [=](bool authorized) -> Future<Response> { if (!authorized) { return Unauthorized("Mesos master"); } _set(quotaInfo); })); ``` src/master/quota_handler.cpp (lines 333 - 334) <https://reviews.apache.org/r/40347/#comment168111> Blank line? src/master/quota_handler.cpp (lines 338 - 339) <https://reviews.apache.org/r/40347/#comment168112> Blank line? src/master/quota_handler.cpp (lines 339 - 340) <https://reviews.apache.org/r/40347/#comment168113> Let's wrap variable and function names in backticks. Also, how about re-wording it a bit for brevity? Something like "`quotaInfo` is already validated, role is quaranteed to be present". - Alexander Rukletsov On Nov. 20, 2015, 10:03 a.m., Jan Schlicht wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/40347/ > ----------------------------------------------------------- > > (Updated Nov. 20, 2015, 10:03 a.m.) > > > Review request for mesos, Alexander Rukletsov, Alexander Rojas, Joris Van > Remoortere, and Till Toenshoff. > > > Bugs: MESOS-3862 > https://issues.apache.org/jira/browse/MESOS-3862 > > > Repository: mesos > > > Description > ------- > > Quota: Implemented quota request authorization. > > > Diffs > ----- > > include/mesos/quota/quota.proto 4e4d8ccc92e2bf9a8e5eae8488c0c952f82fdd6d > src/master/master.hpp 5e5a575dc7dd49324f3c837028df8a7f75cd1f80 > src/master/quota_handler.cpp 03cef4117c52da7599a2800060f65483ca33bc3f > > Diff: https://reviews.apache.org/r/40347/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Jan Schlicht > >