mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 05:20:56 +01:00
Allow linking to passphrase credential via remarkup
Summary: Fixes T5421, add linking to passphrase credentials Test Plan: Open task, add a comment of '{K1}' where K1 is a passphrase credential. Preview and actual comment should be link to credential with the content of credential. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: epriestley, Korvin Maniphest Tasks: T5421 Differential Revision: https://secure.phabricator.com/D9725
This commit is contained in:
parent
2d20dc89f7
commit
83cfbe7bb4
3 changed files with 27 additions and 0 deletions
|
@ -1089,6 +1089,7 @@ phutil_register_library_map(array(
|
||||||
'PassphraseDAO' => 'applications/passphrase/storage/PassphraseDAO.php',
|
'PassphraseDAO' => 'applications/passphrase/storage/PassphraseDAO.php',
|
||||||
'PassphrasePHIDTypeCredential' => 'applications/passphrase/phid/PassphrasePHIDTypeCredential.php',
|
'PassphrasePHIDTypeCredential' => 'applications/passphrase/phid/PassphrasePHIDTypeCredential.php',
|
||||||
'PassphrasePasswordKey' => 'applications/passphrase/keys/PassphrasePasswordKey.php',
|
'PassphrasePasswordKey' => 'applications/passphrase/keys/PassphrasePasswordKey.php',
|
||||||
|
'PassphraseRemarkupRule' => 'applications/passphrase/remarkup/PassphraseRemarkupRule.php',
|
||||||
'PassphraseSSHKey' => 'applications/passphrase/keys/PassphraseSSHKey.php',
|
'PassphraseSSHKey' => 'applications/passphrase/keys/PassphraseSSHKey.php',
|
||||||
'PassphraseSecret' => 'applications/passphrase/storage/PassphraseSecret.php',
|
'PassphraseSecret' => 'applications/passphrase/storage/PassphraseSecret.php',
|
||||||
'PasteCapabilityDefaultView' => 'applications/paste/capability/PasteCapabilityDefaultView.php',
|
'PasteCapabilityDefaultView' => 'applications/paste/capability/PasteCapabilityDefaultView.php',
|
||||||
|
@ -3868,6 +3869,7 @@ phutil_register_library_map(array(
|
||||||
'PassphraseDAO' => 'PhabricatorLiskDAO',
|
'PassphraseDAO' => 'PhabricatorLiskDAO',
|
||||||
'PassphrasePHIDTypeCredential' => 'PhabricatorPHIDType',
|
'PassphrasePHIDTypeCredential' => 'PhabricatorPHIDType',
|
||||||
'PassphrasePasswordKey' => 'PassphraseAbstractKey',
|
'PassphrasePasswordKey' => 'PassphraseAbstractKey',
|
||||||
|
'PassphraseRemarkupRule' => 'PhabricatorRemarkupRuleObject',
|
||||||
'PassphraseSSHKey' => 'PassphraseAbstractKey',
|
'PassphraseSSHKey' => 'PassphraseAbstractKey',
|
||||||
'PassphraseSecret' => 'PassphraseDAO',
|
'PassphraseSecret' => 'PassphraseDAO',
|
||||||
'PasteCapabilityDefaultView' => 'PhabricatorPolicyCapability',
|
'PasteCapabilityDefaultView' => 'PhabricatorPolicyCapability',
|
||||||
|
|
|
@ -45,4 +45,10 @@ final class PhabricatorApplicationPassphrase extends PhabricatorApplication {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getRemarkupRules() {
|
||||||
|
return array(
|
||||||
|
new PassphraseRemarkupRule(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
final class PassphraseRemarkupRule
|
||||||
|
extends PhabricatorRemarkupRuleObject {
|
||||||
|
|
||||||
|
protected function getObjectNamePrefix() {
|
||||||
|
return 'K';
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function loadObjects(array $ids) {
|
||||||
|
$viewer = $this->getEngine()->getConfig('viewer');
|
||||||
|
|
||||||
|
return id(new PassphraseCredentialQuery())
|
||||||
|
->setViewer($viewer)
|
||||||
|
->withIDs($ids)
|
||||||
|
->execute();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue