Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionServeController.php
Show First 20 Lines • Show All 646 Lines • ▼ Show 20 Lines | private function authenticateGitLFSUser( | ||||
// If we have the wrong username, don't bother checking if the token | // If we have the wrong username, don't bother checking if the token | ||||
// is right. | // is right. | ||||
if ($username !== DiffusionGitLFSTemporaryTokenType::HTTP_USERNAME) { | if ($username !== DiffusionGitLFSTemporaryTokenType::HTTP_USERNAME) { | ||||
return null; | return null; | ||||
} | } | ||||
$lfs_pass = $password->openEnvelope(); | $lfs_pass = $password->openEnvelope(); | ||||
$lfs_hash = PhabricatorHash::digest($lfs_pass); | $lfs_hash = PhabricatorHash::weakDigest($lfs_pass); | ||||
$token = id(new PhabricatorAuthTemporaryTokenQuery()) | $token = id(new PhabricatorAuthTemporaryTokenQuery()) | ||||
->setViewer(PhabricatorUser::getOmnipotentUser()) | ->setViewer(PhabricatorUser::getOmnipotentUser()) | ||||
->withTokenTypes(array(DiffusionGitLFSTemporaryTokenType::TOKENTYPE)) | ->withTokenTypes(array(DiffusionGitLFSTemporaryTokenType::TOKENTYPE)) | ||||
->withTokenCodes(array($lfs_hash)) | ->withTokenCodes(array($lfs_hash)) | ||||
->withExpired(false) | ->withExpired(false) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$token) { | if (!$token) { | ||||
▲ Show 20 Lines • Show All 570 Lines • Show Last 20 Lines |