Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14736653
D12715.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D12715.diff
View Options
diff --git a/src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php b/src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php
--- a/src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php
+++ b/src/applications/passphrase/conduit/PassphraseQueryConduitAPIMethod.php
@@ -11,13 +11,17 @@
return pht('Query credentials.');
}
+ public function newQueryObject() {
+ return new PassphraseCredentialQuery();
+ }
+
protected function defineParamTypes() {
return array(
- 'ids' => 'optional list<int>',
- 'phids' => 'optional list<phid>',
- 'needSecrets' => 'optional bool',
- 'needPublicKeys' => 'optional bool',
- ) + $this->getPagerParamTypes();
+ 'ids' => 'optional list<int>',
+ 'phids' => 'optional list<phid>',
+ 'needSecrets' => 'optional bool',
+ 'needPublicKeys' => 'optional bool',
+ );
}
protected function defineReturnType() {
@@ -25,8 +29,7 @@
}
protected function execute(ConduitAPIRequest $request) {
- $query = id(new PassphraseCredentialQuery())
- ->setViewer($request->getUser());
+ $query = $this->newQueryForRequest($request);
if ($request->getValue('ids')) {
$query->withIDs($request->getValue('ids'));
@@ -58,14 +61,22 @@
$credential);
}
+ $material = array();
+
$secret = null;
if ($request->getValue('needSecrets')) {
if ($credential->getAllowConduit()) {
- $secret = $credential->getSecret()->openEnvelope();
+ $secret = $credential->getSecret();
+ if ($secret) {
+ $secret = $secret->openEnvelope();
+ } else {
+ $material['destroyed'] = pht(
+ 'The private material for this credential has been '.
+ 'destroyed.');
+ }
}
}
- $material = array();
switch ($credential->getCredentialType()) {
case PassphraseCredentialTypeSSHPrivateKeyFile::CREDENTIAL_TYPE:
if ($secret) {
@@ -93,8 +104,8 @@
if (!$credential->getAllowConduit()) {
$material['noAPIAccess'] = pht(
- 'This credential\'s private material '.
- 'is not accessible via API calls.');
+ 'This private material for this credential is not accessible via '.
+ 'API calls.');
}
$results[$credential->getPHID()] = array(
@@ -102,6 +113,7 @@
'phid' => $credential->getPHID(),
'type' => $credential->getCredentialType(),
'name' => $credential->getName(),
+ 'description' => $credential->getDescription(),
'uri' =>
PhabricatorEnv::getProductionURI('/'.$credential->getMonogram()),
'monogram' => $credential->getMonogram(),
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 19, 11:50 PM (20 h, 25 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7022076
Default Alt Text
D12715.diff (2 KB)
Attached To
Mode
D12715: Improve passphrase.query
Attached
Detach File
Event Timeline
Log In to Comment