2014-12-15 20:14:53 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class ConduitGetCapabilitiesConduitAPIMethod extends ConduitAPIMethod {
|
|
|
|
|
|
|
|
public function getAPIMethodName() {
|
|
|
|
return 'conduit.getcapabilities';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function shouldRequireAuthentication() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getMethodDescription() {
|
|
|
|
return pht(
|
|
|
|
'List capabilities, wire formats, and authentication protocols '.
|
|
|
|
'available on this server.');
|
|
|
|
}
|
|
|
|
|
2015-04-13 00:59:07 +02:00
|
|
|
protected function defineParamTypes() {
|
2014-12-15 20:14:53 +01:00
|
|
|
return array();
|
|
|
|
}
|
|
|
|
|
2015-04-13 00:59:07 +02:00
|
|
|
protected function defineReturnType() {
|
2014-12-15 20:14:53 +01:00
|
|
|
return 'dict<string, any>';
|
|
|
|
}
|
|
|
|
|
2016-04-03 17:25:02 +02:00
|
|
|
public function getRequiredScope() {
|
|
|
|
return self::SCOPE_ALWAYS;
|
|
|
|
}
|
|
|
|
|
2014-12-15 20:14:53 +01:00
|
|
|
protected function execute(ConduitAPIRequest $request) {
|
|
|
|
$authentication = array(
|
|
|
|
'token',
|
|
|
|
'asymmetric',
|
|
|
|
'session',
|
|
|
|
'sessionless',
|
|
|
|
);
|
|
|
|
|
|
|
|
$oauth_app = 'PhabricatorOAuthServerApplication';
|
|
|
|
if (PhabricatorApplication::isClassInstalled($oauth_app)) {
|
|
|
|
$authentication[] = 'oauth';
|
|
|
|
}
|
|
|
|
|
|
|
|
return array(
|
|
|
|
'authentication' => $authentication,
|
|
|
|
'signatures' => array(
|
|
|
|
'consign',
|
|
|
|
),
|
|
|
|
'input' => array(
|
|
|
|
'json',
|
|
|
|
'urlencoded',
|
|
|
|
),
|
|
|
|
'output' => array(
|
|
|
|
'json',
|
|
|
|
'human',
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|