@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add Amazon and Asana providers

Summary: Ref T1536. Ref T2852. Adds providers for Asana and Amazon. See D6248.

Test Plan:
{F46960}

{F46961}

Reviewers: btrahan, chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T1536, T2852

Differential Revision: https://secure.phabricator.com/D6249

+88
+4
src/__phutil_library_map__.php
··· 838 838 'PhabricatorAuthProviderConfigTransactionQuery' => 'applications/auth/query/PhabricatorAuthProviderConfigTransactionQuery.php', 839 839 'PhabricatorAuthProviderLDAP' => 'applications/auth/provider/PhabricatorAuthProviderLDAP.php', 840 840 'PhabricatorAuthProviderOAuth' => 'applications/auth/provider/PhabricatorAuthProviderOAuth.php', 841 + 'PhabricatorAuthProviderOAuthAmazon' => 'applications/auth/provider/PhabricatorAuthProviderOAuthAmazon.php', 842 + 'PhabricatorAuthProviderOAuthAsana' => 'applications/auth/provider/PhabricatorAuthProviderOAuthAsana.php', 841 843 'PhabricatorAuthProviderOAuthDisqus' => 'applications/auth/provider/PhabricatorAuthProviderOAuthDisqus.php', 842 844 'PhabricatorAuthProviderOAuthFacebook' => 'applications/auth/provider/PhabricatorAuthProviderOAuthFacebook.php', 843 845 'PhabricatorAuthProviderOAuthGitHub' => 'applications/auth/provider/PhabricatorAuthProviderOAuthGitHub.php', ··· 2700 2702 'PhabricatorAuthProviderConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 2701 2703 'PhabricatorAuthProviderLDAP' => 'PhabricatorAuthProvider', 2702 2704 'PhabricatorAuthProviderOAuth' => 'PhabricatorAuthProvider', 2705 + 'PhabricatorAuthProviderOAuthAmazon' => 'PhabricatorAuthProviderOAuth', 2706 + 'PhabricatorAuthProviderOAuthAsana' => 'PhabricatorAuthProviderOAuth', 2703 2707 'PhabricatorAuthProviderOAuthDisqus' => 'PhabricatorAuthProviderOAuth', 2704 2708 'PhabricatorAuthProviderOAuthFacebook' => 'PhabricatorAuthProviderOAuth', 2705 2709 'PhabricatorAuthProviderOAuthGitHub' => 'PhabricatorAuthProviderOAuth',
+46
src/applications/auth/provider/PhabricatorAuthProviderOAuthAmazon.php
··· 1 + <?php 2 + 3 + final class PhabricatorAuthProviderOAuthAmazon 4 + extends PhabricatorAuthProviderOAuth { 5 + 6 + public function getProviderName() { 7 + return pht('Amazon'); 8 + } 9 + 10 + public function getConfigurationHelp() { 11 + $login_uri = $this->getLoginURI(); 12 + 13 + $uri = new PhutilURI(PhabricatorEnv::getProductionURI('/')); 14 + $https_note = null; 15 + if ($uri->getProtocol() !== 'https') { 16 + $https_note = pht( 17 + 'NOTE: Amazon **requires** HTTPS, but your Phabricator install does '. 18 + 'not use HTTPS. **You will not be able to add Amazon as an '. 19 + 'authentication provider until you configure HTTPS on this install**.'); 20 + } 21 + 22 + return pht( 23 + "%s\n\n". 24 + "To configure Amazon OAuth, create a new 'API Project' here:". 25 + "\n\n". 26 + "http://login.amazon.com/manageApps". 27 + "\n\n". 28 + "Use these settings:". 29 + "\n\n". 30 + " - **Allowed Return URLs:** Add this: `%s`". 31 + "\n\n". 32 + "After completing configuration, copy the **Client ID** and ". 33 + "**Client Secret** to the fields above.", 34 + $https_note, 35 + $login_uri); 36 + } 37 + 38 + protected function newOAuthAdapter() { 39 + return new PhutilAuthAdapterOAuthAmazon(); 40 + } 41 + 42 + protected function getLoginIcon() { 43 + return 'Amazon'; 44 + } 45 + 46 + }
+38
src/applications/auth/provider/PhabricatorAuthProviderOAuthAsana.php
··· 1 + <?php 2 + 3 + final class PhabricatorAuthProviderOAuthAsana 4 + extends PhabricatorAuthProviderOAuth { 5 + 6 + public function getProviderName() { 7 + return pht('Asana'); 8 + } 9 + 10 + public function getConfigurationHelp() { 11 + $app_uri = PhabricatorEnv::getProductionURI('/'); 12 + $login_uri = $this->getLoginURI(); 13 + 14 + return pht( 15 + "To configure Asana OAuth, create a new application by logging in to ". 16 + "Asana and going to **Account Settings**, then **Apps**, then ". 17 + "**Add New Application**.". 18 + "\n\n". 19 + "Use these settings:". 20 + "\n\n". 21 + " - **App URL:** Set this to: `%s`\n". 22 + " - **Redirect URL:** Set this to: `%s`". 23 + "\n\n". 24 + "After completing configuration, copy the **Client ID** and ". 25 + "**Client Secret** to the fields above.", 26 + $app_uri, 27 + $login_uri); 28 + } 29 + 30 + protected function newOAuthAdapter() { 31 + return new PhutilAuthAdapterOAuthAsana(); 32 + } 33 + 34 + protected function getLoginIcon() { 35 + return 'Asana'; 36 + } 37 + 38 + }