Differential D10527 Diff 25342 src/applications/oauthserver/storage/PhabricatorOAuthServerClient.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/oauthserver/storage/PhabricatorOAuthServerClient.php
Show All 24 Lines | public static function initializeNewClient(PhabricatorUser $actor) { | ||||
return id(new PhabricatorOAuthServerClient()) | return id(new PhabricatorOAuthServerClient()) | ||||
->setCreatorPHID($actor->getPHID()) | ->setCreatorPHID($actor->getPHID()) | ||||
->setSecret(Filesystem::readRandomCharacters(32)); | ->setSecret(Filesystem::readRandomCharacters(32)); | ||||
} | } | ||||
public function getConfiguration() { | public function getConfiguration() { | ||||
return array( | return array( | ||||
self::CONFIG_AUX_PHID => true, | self::CONFIG_AUX_PHID => true, | ||||
self::CONFIG_COLUMN_SCHEMA => array( | |||||
'name' => 'text255', | |||||
'secret' => 'text32', | |||||
'redirectURI' => 'text255', | |||||
), | |||||
self::CONFIG_KEY_SCHEMA => array( | |||||
'key_phid' => null, | |||||
'phid' => array( | |||||
'columns' => array('phid'), | |||||
'unique' => true, | |||||
), | |||||
'creatorPHID' => array( | |||||
'columns' => array('creatorPHID'), | |||||
), | |||||
), | |||||
) + parent::getConfiguration(); | ) + parent::getConfiguration(); | ||||
} | } | ||||
public function generatePHID() { | public function generatePHID() { | ||||
return PhabricatorPHID::generateNewPHID( | return PhabricatorPHID::generateNewPHID( | ||||
PhabricatorOAuthServerClientPHIDType::TYPECONST); | PhabricatorOAuthServerClientPHIDType::TYPECONST); | ||||
} | } | ||||
Show All 37 Lines |