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

Method _flags

src/master/http.cpp:1456–1481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1454
1455
1456Future<Try<JSON::Object, Master::Http::FlagsError>> Master::Http::_flags(
1457 const Option<Principal>& principal) const
1458{
1459 if (master->authorizer.isNone()) {
1460 return __flags();
1461 }
1462
1463 authorization::Request authRequest;
1464 authRequest.set_action(authorization::VIEW_FLAGS);
1465
1466 Option<authorization::Subject> subject = createSubject(principal);
1467 if (subject.isSome()) {
1468 authRequest.mutable_subject()->CopyFrom(subject.get());
1469 }
1470
1471 return master->authorizer.get()->authorized(authRequest)
1472 .then(defer(
1473 master->self(),
1474 [this](bool authorized) -> Future<Try<JSON::Object, FlagsError>> {
1475 if (authorized) {
1476 return __flags();
1477 } else {
1478 return FlagsError(FlagsError::Type::UNAUTHORIZED);
1479 }
1480 }));
1481}
1482
1483
1484JSON::Object Master::Http::__flags() const

Callers

nothing calls this directly

Calls 10

createSubjectFunction · 0.85
deferFunction · 0.85
FlagsErrorClass · 0.85
CopyFromMethod · 0.80
isNoneMethod · 0.45
isSomeMethod · 0.45
getMethod · 0.45
thenMethod · 0.45
authorizedMethod · 0.45
selfMethod · 0.45

Tested by

no test coverage detected