OAuth - add concept of "trusted" clients that get auto redirects
Summary: Fixes T7153. Test Plan: used `bin/auth trust-oauth-client` and `bin/auth untrust-oauth-client` to set the bit and verify error states. registered via oauth with `bin/auth trust-oauth-client` set and I did not have the confirmation screen registered via oauth with `bin/auth untrust-oauth-client` set and I did have the confirmation screen Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T7153 Differential Revision: https://secure.phabricator.com/D11724
This commit is contained in:
@@ -182,6 +182,12 @@ final class PhabricatorOAuthServerAuthController
|
||||
'state' => $state,
|
||||
));
|
||||
|
||||
if ($client->getIsTrusted()) {
|
||||
return id(new AphrontRedirectResponse())
|
||||
->setIsExternal(true)
|
||||
->setURI((string)$full_uri);
|
||||
}
|
||||
|
||||
// TODO: It would be nice to give the user more options here, like
|
||||
// reviewing permissions, canceling the authorization, or aborting
|
||||
// the workflow.
|
||||
|
||||
@@ -10,6 +10,7 @@ final class PhabricatorOAuthServerClient
|
||||
protected $name;
|
||||
protected $redirectURI;
|
||||
protected $creatorPHID;
|
||||
protected $isTrusted = 0;
|
||||
protected $viewPolicy;
|
||||
protected $editPolicy;
|
||||
|
||||
@@ -40,6 +41,7 @@ final class PhabricatorOAuthServerClient
|
||||
'name' => 'text255',
|
||||
'secret' => 'text32',
|
||||
'redirectURI' => 'text255',
|
||||
'isTrusted' => 'bool',
|
||||
),
|
||||
self::CONFIG_KEY_SCHEMA => array(
|
||||
'key_phid' => null,
|
||||
|
||||
Reference in New Issue
Block a user