mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
Make the Conduit auth error for an unrecognized public key a little more useful
Summary: Ref T13168. This is just a small quality-of-life fix: we can disclose which public key we're talking about because public keys are public. Test Plan: - Hit public key error (through my own bumbling / not reading or following instructions). Specifically, I haven't associated the key with a device in Almanac. - Before: vague error. - After: more specific error with enough key material that I could grep for it. Reviewers: amckinley Reviewed By: amckinley Subscribers: yelirekim Maniphest Tasks: T13168 Differential Revision: https://secure.phabricator.com/D19516
This commit is contained in:
parent
67283c7a45
commit
eb80a5ede1
1 changed files with 6 additions and 1 deletions
|
@ -211,9 +211,14 @@ final class PhabricatorConduitAPIController
|
|||
->withIsActive(true)
|
||||
->executeOne();
|
||||
if (!$stored_key) {
|
||||
$key_summary = id(new PhutilUTF8StringTruncator())
|
||||
->setMaximumBytes(64)
|
||||
->truncateString($raw_key);
|
||||
return array(
|
||||
'ERR-INVALID-AUTH',
|
||||
pht('No user or device is associated with that public key.'),
|
||||
pht(
|
||||
'No user or device is associated with the public key "%s".',
|
||||
$key_summary),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue