> On Feb. 16, 2017, 11:45 a.m., Alexander Rojas wrote: > > 3rdparty/libprocess/src/http.cpp, lines 87-109 > > <https://reviews.apache.org/r/56623/diff/1/?file=1632560#file1632560line87> > > > > Why not going the fancy way and use `jsonify()`?
Just add this function in the same namespace as the `AuthorizationContext`: ```c++ static void json(JSON::ObjectWriter* writer, const AuthorizationContext& context) { if (context.principal.isSome()) { writer->field("principal", context.principal.get()); } if (context.labels.isSome()) { writer->field("labels", context.labels.get()); } } ``` Then you can implement the output stream operator as: ```c++ std::ostream& operator<<( std::ostream& stream, const AuthenticationContext& context) { stream << jsonify(context); return streaml } ``` - Alexander ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/56623/#review165822 ----------------------------------------------------------- On Feb. 17, 2017, 6:31 a.m., Greg Mann wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/56623/ > ----------------------------------------------------------- > > (Updated Feb. 17, 2017, 6:31 a.m.) > > > Review request for mesos, Adam B, Alexander Rojas, Jan Schlicht, Till > Toenshoff, and Vinod Kone. > > > Bugs: MESOS-7003 > https://issues.apache.org/jira/browse/MESOS-7003 > > > Repository: mesos > > > Description > ------- > > This patch adds a new struct, `AuthenticationContext`, to > libprocess to represent an authenticated entity in the system. > The new type contains a `principal` and a map containing > arbitrary key-value pairs. > > > Diffs > ----- > > 3rdparty/libprocess/include/process/authenticator.hpp > e5489c6cb4adc8a822e7dd4515542618c36136f9 > 3rdparty/libprocess/include/process/http.hpp > 3a406963c1defc037d58971f2400e40855503fbb > 3rdparty/libprocess/include/process/process.hpp > ceedbe86ccba5c24bf1e9e7f032d7dbcf6acb0f3 > 3rdparty/libprocess/src/authenticator.cpp > cfedb6f7674e0f6690e77a633cdd1bd494c7d2c7 > 3rdparty/libprocess/src/authenticator_manager.cpp > a22acd026a001788dc39b8005a56577e33c6800b > 3rdparty/libprocess/src/http.cpp 0e37936eec5b2910e54d40788c26f98665cbe1f1 > 3rdparty/libprocess/src/process.cpp > 3ad485f9136cd9edf0a6db76ff1f475039236391 > > Diff: https://reviews.apache.org/r/56623/diff/ > > > Testing > ------- > > Testing information can be found at the end of this review chain. > > > Thanks, > > Greg Mann > >