mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-18 10:41:08 +01:00
Rename "PhabricatorPasswordHashInterface" to "PhabricatorAuthPasswordHashInterface"
Summary: Depends on D18911. Ref T13043. Improves consistency with other "PhabricatorAuthPassword..." classes. Test Plan: Unit tests, `grep`. Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13043 Differential Revision: https://secure.phabricator.com/D18916
This commit is contained in:
parent
d4b3cd5255
commit
bf2868c070
5 changed files with 12 additions and 12 deletions
|
@ -2094,6 +2094,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorAuthPasswordEditor' => 'applications/auth/editor/PhabricatorAuthPasswordEditor.php',
|
'PhabricatorAuthPasswordEditor' => 'applications/auth/editor/PhabricatorAuthPasswordEditor.php',
|
||||||
'PhabricatorAuthPasswordEngine' => 'applications/auth/engine/PhabricatorAuthPasswordEngine.php',
|
'PhabricatorAuthPasswordEngine' => 'applications/auth/engine/PhabricatorAuthPasswordEngine.php',
|
||||||
'PhabricatorAuthPasswordException' => 'applications/auth/password/PhabricatorAuthPasswordException.php',
|
'PhabricatorAuthPasswordException' => 'applications/auth/password/PhabricatorAuthPasswordException.php',
|
||||||
|
'PhabricatorAuthPasswordHashInterface' => 'applications/auth/password/PhabricatorAuthPasswordHashInterface.php',
|
||||||
'PhabricatorAuthPasswordPHIDType' => 'applications/auth/phid/PhabricatorAuthPasswordPHIDType.php',
|
'PhabricatorAuthPasswordPHIDType' => 'applications/auth/phid/PhabricatorAuthPasswordPHIDType.php',
|
||||||
'PhabricatorAuthPasswordQuery' => 'applications/auth/query/PhabricatorAuthPasswordQuery.php',
|
'PhabricatorAuthPasswordQuery' => 'applications/auth/query/PhabricatorAuthPasswordQuery.php',
|
||||||
'PhabricatorAuthPasswordResetTemporaryTokenType' => 'applications/auth/tokentype/PhabricatorAuthPasswordResetTemporaryTokenType.php',
|
'PhabricatorAuthPasswordResetTemporaryTokenType' => 'applications/auth/tokentype/PhabricatorAuthPasswordResetTemporaryTokenType.php',
|
||||||
|
@ -3496,7 +3497,6 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorPassphraseApplication' => 'applications/passphrase/application/PhabricatorPassphraseApplication.php',
|
'PhabricatorPassphraseApplication' => 'applications/passphrase/application/PhabricatorPassphraseApplication.php',
|
||||||
'PhabricatorPasswordAuthProvider' => 'applications/auth/provider/PhabricatorPasswordAuthProvider.php',
|
'PhabricatorPasswordAuthProvider' => 'applications/auth/provider/PhabricatorPasswordAuthProvider.php',
|
||||||
'PhabricatorPasswordDestructionEngineExtension' => 'applications/auth/extension/PhabricatorPasswordDestructionEngineExtension.php',
|
'PhabricatorPasswordDestructionEngineExtension' => 'applications/auth/extension/PhabricatorPasswordDestructionEngineExtension.php',
|
||||||
'PhabricatorPasswordHashInterface' => 'applications/auth/password/PhabricatorPasswordHashInterface.php',
|
|
||||||
'PhabricatorPasswordHasher' => 'infrastructure/util/password/PhabricatorPasswordHasher.php',
|
'PhabricatorPasswordHasher' => 'infrastructure/util/password/PhabricatorPasswordHasher.php',
|
||||||
'PhabricatorPasswordHasherTestCase' => 'infrastructure/util/password/__tests__/PhabricatorPasswordHasherTestCase.php',
|
'PhabricatorPasswordHasherTestCase' => 'infrastructure/util/password/__tests__/PhabricatorPasswordHasherTestCase.php',
|
||||||
'PhabricatorPasswordHasherUnavailableException' => 'infrastructure/util/password/PhabricatorPasswordHasherUnavailableException.php',
|
'PhabricatorPasswordHasherUnavailableException' => 'infrastructure/util/password/PhabricatorPasswordHasherUnavailableException.php',
|
||||||
|
@ -9997,7 +9997,7 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorFulltextInterface',
|
'PhabricatorFulltextInterface',
|
||||||
'PhabricatorFerretInterface',
|
'PhabricatorFerretInterface',
|
||||||
'PhabricatorConduitResultInterface',
|
'PhabricatorConduitResultInterface',
|
||||||
'PhabricatorPasswordHashInterface',
|
'PhabricatorAuthPasswordHashInterface',
|
||||||
),
|
),
|
||||||
'PhabricatorUserBadgesCacheType' => 'PhabricatorUserCacheType',
|
'PhabricatorUserBadgesCacheType' => 'PhabricatorUserCacheType',
|
||||||
'PhabricatorUserBlurbField' => 'PhabricatorUserCustomField',
|
'PhabricatorUserBlurbField' => 'PhabricatorUserCustomField',
|
||||||
|
|
|
@ -27,7 +27,7 @@ final class PhabricatorAuthPasswordEngine
|
||||||
return $this->contentSource;
|
return $this->contentSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setObject(PhabricatorPasswordHashInterface $object) {
|
public function setObject(PhabricatorAuthPasswordHashInterface $object) {
|
||||||
$this->object = $object;
|
$this->object = $object;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
interface PhabricatorPasswordHashInterface {
|
interface PhabricatorAuthPasswordHashInterface {
|
||||||
|
|
||||||
public function newPasswordDigest(
|
public function newPasswordDigest(
|
||||||
PhutilOpaqueEnvelope $envelope,
|
PhutilOpaqueEnvelope $envelope,
|
|
@ -21,7 +21,7 @@ final class PhabricatorAuthPassword
|
||||||
const PASSWORD_TYPE_TEST = 'test';
|
const PASSWORD_TYPE_TEST = 'test';
|
||||||
|
|
||||||
public static function initializeNewPassword(
|
public static function initializeNewPassword(
|
||||||
PhabricatorPasswordHashInterface $object,
|
PhabricatorAuthPasswordHashInterface $object,
|
||||||
$type) {
|
$type) {
|
||||||
|
|
||||||
return id(new self())
|
return id(new self())
|
||||||
|
@ -80,7 +80,7 @@ final class PhabricatorAuthPassword
|
||||||
|
|
||||||
public function upgradePasswordHasher(
|
public function upgradePasswordHasher(
|
||||||
PhutilOpaqueEnvelope $envelope,
|
PhutilOpaqueEnvelope $envelope,
|
||||||
PhabricatorPasswordHashInterface $object) {
|
PhabricatorAuthPasswordHashInterface $object) {
|
||||||
|
|
||||||
// Before we make changes, double check that this is really the correct
|
// Before we make changes, double check that this is really the correct
|
||||||
// password. It could be really bad if we "upgraded" a password and changed
|
// password. It could be really bad if we "upgraded" a password and changed
|
||||||
|
@ -98,7 +98,7 @@ final class PhabricatorAuthPassword
|
||||||
|
|
||||||
public function setPassword(
|
public function setPassword(
|
||||||
PhutilOpaqueEnvelope $password,
|
PhutilOpaqueEnvelope $password,
|
||||||
PhabricatorPasswordHashInterface $object) {
|
PhabricatorAuthPasswordHashInterface $object) {
|
||||||
|
|
||||||
$hasher = PhabricatorPasswordHasher::getBestHasher();
|
$hasher = PhabricatorPasswordHasher::getBestHasher();
|
||||||
return $this->setPasswordWithHasher($password, $object, $hasher);
|
return $this->setPasswordWithHasher($password, $object, $hasher);
|
||||||
|
@ -106,7 +106,7 @@ final class PhabricatorAuthPassword
|
||||||
|
|
||||||
public function setPasswordWithHasher(
|
public function setPasswordWithHasher(
|
||||||
PhutilOpaqueEnvelope $password,
|
PhutilOpaqueEnvelope $password,
|
||||||
PhabricatorPasswordHashInterface $object,
|
PhabricatorAuthPasswordHashInterface $object,
|
||||||
PhabricatorPasswordHasher $hasher) {
|
PhabricatorPasswordHasher $hasher) {
|
||||||
|
|
||||||
if (!strlen($password->openEnvelope())) {
|
if (!strlen($password->openEnvelope())) {
|
||||||
|
@ -130,7 +130,7 @@ final class PhabricatorAuthPassword
|
||||||
|
|
||||||
public function comparePassword(
|
public function comparePassword(
|
||||||
PhutilOpaqueEnvelope $password,
|
PhutilOpaqueEnvelope $password,
|
||||||
PhabricatorPasswordHashInterface $object) {
|
PhabricatorAuthPasswordHashInterface $object) {
|
||||||
|
|
||||||
$digest = $this->digestPassword($password, $object);
|
$digest = $this->digestPassword($password, $object);
|
||||||
$hash = $this->newPasswordEnvelope();
|
$hash = $this->newPasswordEnvelope();
|
||||||
|
@ -144,7 +144,7 @@ final class PhabricatorAuthPassword
|
||||||
|
|
||||||
private function digestPassword(
|
private function digestPassword(
|
||||||
PhutilOpaqueEnvelope $password,
|
PhutilOpaqueEnvelope $password,
|
||||||
PhabricatorPasswordHashInterface $object) {
|
PhabricatorAuthPasswordHashInterface $object) {
|
||||||
|
|
||||||
$object_phid = $object->getPHID();
|
$object_phid = $object->getPHID();
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ final class PhabricatorUser
|
||||||
PhabricatorFulltextInterface,
|
PhabricatorFulltextInterface,
|
||||||
PhabricatorFerretInterface,
|
PhabricatorFerretInterface,
|
||||||
PhabricatorConduitResultInterface,
|
PhabricatorConduitResultInterface,
|
||||||
PhabricatorPasswordHashInterface {
|
PhabricatorAuthPasswordHashInterface {
|
||||||
|
|
||||||
const SESSION_TABLE = 'phabricator_session';
|
const SESSION_TABLE = 'phabricator_session';
|
||||||
const NAMETOKEN_TABLE = 'user_nametoken';
|
const NAMETOKEN_TABLE = 'user_nametoken';
|
||||||
|
@ -1565,7 +1565,7 @@ final class PhabricatorUser
|
||||||
return $variables[$variable_key];
|
return $variables[$variable_key];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -( PhabricatorPasswordHashInterface )----------------------------------- */
|
/* -( PhabricatorAuthPasswordHashInterface )------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
public function newPasswordDigest(
|
public function newPasswordDigest(
|
||||||
|
|
Loading…
Reference in a new issue