From 65fbbd06c6ac9108a627e7465430ea0878b07920 Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Wed, 16 Jan 2013 10:00:51 -0800 Subject: [PATCH] OAuth options. Test Plan: Looked at the options. Reviewers: epriestley, btrahan, chad Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T2255 Differential Revision: https://secure.phabricator.com/D4470 --- src/__phutil_library_map__.php | 2 + ...abricatorPhabricatorOAuthConfigOptions.php | 53 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 src/applications/config/option/PhabricatorPhabricatorOAuthConfigOptions.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index a267c09d7d..789f76d7bc 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1053,6 +1053,7 @@ phutil_register_library_map(array( 'PhabricatorPeopleLogsController' => 'applications/people/controller/PhabricatorPeopleLogsController.php', 'PhabricatorPeopleProfileController' => 'applications/people/controller/PhabricatorPeopleProfileController.php', 'PhabricatorPeopleQuery' => 'applications/people/PhabricatorPeopleQuery.php', + 'PhabricatorPhabricatorOAuthConfigOptions' => 'applications/config/option/PhabricatorPhabricatorOAuthConfigOptions.php', 'PhabricatorPhameConfigOptions' => 'applications/phame/config/PhabricatorPhameConfigOptions.php', 'PhabricatorPhrictionConfigOptions' => 'applications/phriction/config/PhabricatorPhrictionConfigOptions.php', 'PhabricatorPinboardItemView' => 'view/layout/PhabricatorPinboardItemView.php', @@ -2407,6 +2408,7 @@ phutil_register_library_map(array( 'PhabricatorPeopleLogsController' => 'PhabricatorPeopleController', 'PhabricatorPeopleProfileController' => 'PhabricatorPeopleController', 'PhabricatorPeopleQuery' => 'PhabricatorOffsetPagedQuery', + 'PhabricatorPhabricatorOAuthConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPhameConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPhrictionConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorPinboardItemView' => 'AphrontView', diff --git a/src/applications/config/option/PhabricatorPhabricatorOAuthConfigOptions.php b/src/applications/config/option/PhabricatorPhabricatorOAuthConfigOptions.php new file mode 100644 index 0000000000..acc9163d02 --- /dev/null +++ b/src/applications/config/option/PhabricatorPhabricatorOAuthConfigOptions.php @@ -0,0 +1,53 @@ +newOption('phabricator.oauth-uri', 'string', null) + ->setDescription( + pht( + "The URI of the Phabricator instance to use as an OAuth server.")) + ->addExample('https://phabricator.example.com/', pht('Valid Setting')), + $this->newOption('phabricator.auth-enabled', 'bool', false) + ->setDescription( + pht( + "Can users use Phabricator credentials to login to Phabricator?")), + $this->newOption('phabricator.registration-enabled', 'bool', true) + ->setDescription( + pht( + "Can users use Phabricator credentials to create new Phabricator ". + "accounts?")), + $this->newOption('phabricator.auth-permanent', 'bool', false) + ->setBoolOptions( + array( + pht("Permanent"), + pht("Able to be unlinked"), + )) + ->setDescription( + pht( + "Are Phabricator accounts permanently linked to Phabricator ". + "accounts, or can the user unlink them?")), + $this->newOption('phabricator.application-id', 'string', null) + ->setDescription( + pht( + "The Phabricator 'Client ID' to use for Phabricator API access.")), + $this->newOption('phabricator.application-secret', 'string', null) + ->setMasked(true) + ->setDescription( + pht( + "The Phabricator 'Client Secret' to use for Phabricator API ". + "access.")), + ); + } + +}