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

Method authorizeUpdateQuota

src/master/quota_handler.cpp:1096–1119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1094
1095
1096Future<bool> Master::QuotaHandler::authorizeUpdateQuota(
1097 const Option<Principal>& principal,
1098 const QuotaInfo& quotaInfo) const
1099{
1100 if (master->authorizer.isNone()) {
1101 return true;
1102 }
1103
1104 LOG(INFO) << "Authorizing principal '"
1105 << (principal.isSome() ? stringify(principal.get()) : "ANY")
1106 << "' to update quota for role '" << quotaInfo.role() << "'";
1107
1108 authorization::Request request;
1109 request.set_action(authorization::UPDATE_QUOTA);
1110
1111 Option<authorization::Subject> subject = createSubject(principal);
1112 if (subject.isSome()) {
1113 request.mutable_subject()->CopyFrom(subject.get());
1114 }
1115
1116 request.mutable_object()->mutable_quota_info()->CopyFrom(quotaInfo);
1117
1118 return master->authorizer.get()->authorized(request);
1119}
1120
1121
1122Future<bool> Master::QuotaHandler::authorizeUpdateQuotaConfig(

Callers

nothing calls this directly

Calls 7

createSubjectFunction · 0.85
CopyFromMethod · 0.80
stringifyFunction · 0.50
isNoneMethod · 0.45
isSomeMethod · 0.45
getMethod · 0.45
authorizedMethod · 0.45

Tested by

no test coverage detected