Changeset View
Changeset View
Standalone View
Standalone View
src/applications/passphrase/storage/PassphraseCredential.php
| Show All 19 Lines | final class PassphraseCredential extends PassphraseDAO | ||||
| protected $secretID; | protected $secretID; | ||||
| protected $isDestroyed; | protected $isDestroyed; | ||||
| protected $isLocked = 0; | protected $isLocked = 0; | ||||
| protected $allowConduit = 0; | protected $allowConduit = 0; | ||||
| protected $authorPHID; | protected $authorPHID; | ||||
| protected $spacePHID; | protected $spacePHID; | ||||
| private $secret = self::ATTACHABLE; | private $secret = self::ATTACHABLE; | ||||
| private $implementation = self::ATTACHABLE; | |||||
| public static function initializeNewCredential(PhabricatorUser $actor) { | public static function initializeNewCredential(PhabricatorUser $actor) { | ||||
| $app = id(new PhabricatorApplicationQuery()) | $app = id(new PhabricatorApplicationQuery()) | ||||
| ->setViewer($actor) | ->setViewer($actor) | ||||
| ->withClasses(array('PhabricatorPassphraseApplication')) | ->withClasses(array('PhabricatorPassphraseApplication')) | ||||
| ->executeOne(); | ->executeOne(); | ||||
| $view_policy = $app->getPolicy(PassphraseDefaultViewCapability::CAPABILITY); | $view_policy = $app->getPolicy(PassphraseDefaultViewCapability::CAPABILITY); | ||||
| ▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | public function getSecret() { | ||||
| return $this->assertAttached($this->secret); | return $this->assertAttached($this->secret); | ||||
| } | } | ||||
| public function getCredentialTypeImplementation() { | public function getCredentialTypeImplementation() { | ||||
| $type = $this->getCredentialType(); | $type = $this->getCredentialType(); | ||||
| return PassphraseCredentialType::getTypeByConstant($type); | return PassphraseCredentialType::getTypeByConstant($type); | ||||
| } | } | ||||
| public function attachImplementation(PassphraseCredentialType $impl) { | |||||
| $this->implementation = $impl; | |||||
| return $this; | |||||
| } | |||||
| public function getImplementation() { | |||||
| return $this->assertAttached($this->implementation); | |||||
| } | |||||
| /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | /* -( PhabricatorApplicationTransactionInterface )------------------------- */ | ||||
| public function getApplicationTransactionEditor() { | public function getApplicationTransactionEditor() { | ||||
| return new PassphraseCredentialTransactionEditor(); | return new PassphraseCredentialTransactionEditor(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines | |||||