Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/conduit/method/ConduitGetCapabilitiesConduitAPIMethod.php
12256 views
1
<?php
2
3
final class ConduitGetCapabilitiesConduitAPIMethod extends ConduitAPIMethod {
4
5
public function getAPIMethodName() {
6
return 'conduit.getcapabilities';
7
}
8
9
public function shouldRequireAuthentication() {
10
return false;
11
}
12
13
public function getMethodDescription() {
14
return pht(
15
'List capabilities, wire formats, and authentication protocols '.
16
'available on this server.');
17
}
18
19
protected function defineParamTypes() {
20
return array();
21
}
22
23
protected function defineReturnType() {
24
return 'dict<string, any>';
25
}
26
27
public function getRequiredScope() {
28
return self::SCOPE_ALWAYS;
29
}
30
31
protected function execute(ConduitAPIRequest $request) {
32
$authentication = array(
33
'token',
34
'asymmetric',
35
'session',
36
'sessionless',
37
);
38
39
$oauth_app = 'PhabricatorOAuthServerApplication';
40
if (PhabricatorApplication::isClassInstalled($oauth_app)) {
41
$authentication[] = 'oauth';
42
}
43
44
return array(
45
'authentication' => $authentication,
46
'signatures' => array(
47
'consign',
48
),
49
'input' => array(
50
'json',
51
'urlencoded',
52
),
53
'output' => array(
54
'json',
55
'human',
56
),
57
);
58
}
59
60
}
61
62