MCPcopy Create free account
hub / github.com/apache/mesos / authorize

Method authorize

src/master/master.cpp:3778–3806  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3776
3777
3778Future<bool> Master::authorize(
3779 const Option<Principal>& principal,
3780 ActionObject&& actionObject)
3781{
3782 if (authorizer.isNone()) {
3783 return true;
3784 }
3785
3786 const Option<authorization::Subject> subject = createSubject(principal);
3787
3788 authorization::Request request;
3789
3790 if (subject.isSome()) {
3791 *request.mutable_subject() = *subject;
3792 }
3793
3794 LOG(INFO) << "Authorizing"
3795 << (principal.isSome()
3796 ? " principal '" + stringify(*principal) + "'"
3797 : " ANY principal")
3798 << " to " << actionObject;
3799
3800 request.set_action(actionObject.action());
3801 if (actionObject.object().isSome()) {
3802 *request.mutable_object() = *(std::move(actionObject).object());
3803 }
3804
3805 return authorizer.get()->authorized(request);
3806}
3807
3808
3809Future<bool> Master::authorize(

Callers 6

_createVolumesMethod · 0.45
_destroyVolumesMethod · 0.45
growVolumeMethod · 0.45
shrinkVolumeMethod · 0.45
_reserveMethod · 0.45
_unreserveMethod · 0.45

Calls 11

createSubjectFunction · 0.85
collectAuthorizationsFunction · 0.85
actionMethod · 0.80
stringifyFunction · 0.50
isNoneMethod · 0.45
isSomeMethod · 0.45
authorizedMethod · 0.45
getMethod · 0.45
emptyMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected