Skip to content
This repository has been archived by the owner on Mar 23, 2024. It is now read-only.

Commit

Permalink
:octocat: add provider table to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
codemasher committed Mar 7, 2024
1 parent 519c277 commit f7e8181
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 5 deletions.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,54 @@ See [the wiki](https://github.com/chillerlan/php-oauth-core/wiki) for advanced d
```
In case you want to keep using `dev-main`, specify the hash of a commit to avoid running into unforeseen issues like so: `dev-main#ff85785139b9531a6c29d41cc161e4878d54491d`

## Implemented Providers

<!-- TABLE-START -->
| Provider | API keys | revoke access | OAuth | `ClientCredentials` |
|----------|----------|---------------|-------|---------------------|
| [Amazon](https://login.amazon.com/) | [link](https://sellercentral.amazon.com/hz/home) | | 2 | |
| [BattleNet](https://develop.battle.net/documentation) | [link](https://develop.battle.net/access/clients) | [link](https://account.blizzard.com/connections) | 2 ||
| [BigCartel](https://developers.bigcartel.com/api/v1) | [link](https://bigcartel.wufoo.com/forms/big-cartel-api-application/) | [link](https://my.bigcartel.com/account) | 2 | |
| [Bitbucket](https://developer.atlassian.com/bitbucket/api/2/reference/) | [link](https://developer.atlassian.com/apps/) | | 2 ||
| [Deezer](https://developers.deezer.com/api) | [link](http://developers.deezer.com/myapps) | [link](https://www.deezer.com/account/apps) | 2 | |
| [DeviantArt](https://www.deviantart.com/developers/) | [link](https://www.deviantart.com/developers/apps) | [link](https://www.deviantart.com/settings/applications) | 2 ||
| [Discogs](https://www.discogs.com/developers/) | [link](https://www.discogs.com/settings/developers) | [link](https://www.discogs.com/settings/applications) | 1 | |
| [Discord](https://discordapp.com/developers/) | [link](https://discordapp.com/developers/applications/) | | 2 ||
| [Flickr](https://www.flickr.com/services/api/) | [link](https://www.flickr.com/services/apps/create/) | [link](https://www.flickr.com/services/auth/list.gne) | 1 | |
| [Foursquare](https://developer.foursquare.com/docs) | [link](https://foursquare.com/developers/apps) | [link](https://foursquare.com/settings/connections) | 2 | |
| [GitHub](https://developer.github.com/) | [link](https://github.com/settings/developers) | [link](https://github.com/settings/applications) | 2 | |
| [GitLab](https://docs.gitlab.com/ee/api/README.html) | [link](https://gitlab.com/profile/applications) | | 2 ||
| [Google](https://developers.google.com/oauthplayground/) | [link](https://console.developers.google.com/apis/credentials) | [link](https://myaccount.google.com/permissions) | 2 | |
| [GuildWars2](https://wiki.guildwars2.com/wiki/API:Main) | [link](https://account.arena.net/applications) | [link](https://account.arena.net/applications) | 2 | |
| [Imgur](https://apidocs.imgur.com) | [link](https://api.imgur.com/oauth2/addclient) | [link](https://imgur.com/account/settings/apps) | 2 | |
| [LastFM](https://www.last.fm/api/) | [link](https://www.last.fm/api/account/create) | [link](https://www.last.fm/settings/applications) | - | |
| [MailChimp](https://developer.mailchimp.com/) | [link](https://admin.mailchimp.com/account/oauth2/) | | 2 | |
| [Mastodon](https://docs.joinmastodon.org/api/) | [link](https://mastodon.social/settings/applications) | [link](https://mastodon.social/oauth/authorized_applications) | 2 | |
| [MicrosoftGraph](https://docs.microsoft.com/graph/overview) | [link](https://aad.portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) | [link](https://account.live.com/consent/Manage) | 2 | |
| [Mixcloud](https://www.mixcloud.com/developers/) | [link](https://www.mixcloud.com/developers/create/) | [link](https://www.mixcloud.com/settings/applications/) | 2 | |
| [MusicBrainz](https://musicbrainz.org/doc/Development) | [link](https://musicbrainz.org/account/applications) | [link](https://musicbrainz.org/account/applications) | 2 | |
| [NPROne](https://dev.npr.org/api/) | [link](https://dev.npr.org/console) | | 2 | |
| [OpenCaching](https://www.opencaching.de/okapi/) | [link](https://www.opencaching.de/okapi/signup.html) | [link](https://www.opencaching.de/okapi/apps/) | 1 | |
| [OpenStreetmap](https://wiki.openstreetmap.org/wiki/API) | [link](https://www.openstreetmap.org/user/{USERNAME}/oauth_clients) | | 1 | |
| [OpenStreetmap2](https://wiki.openstreetmap.org/wiki/API) | [link](https://www.openstreetmap.org/oauth2/applications) | | 2 | |
| [Patreon](https://docs.patreon.com/) | [link](https://www.patreon.com/portal/registration/register-clients) | | 2 | |
| [PayPal](https://developer.paypal.com/docs/connect-with-paypal/reference/) | [link](https://developer.paypal.com/developer/applications/) | | 2 ||
| [PayPalSandbox](https://developer.paypal.com/docs/connect-with-paypal/reference/) | [link](https://developer.paypal.com/developer/applications/) | | 2 ||
| [Slack](https://api.slack.com) | [link](https://api.slack.com/apps) | [link](https://slack.com/apps/manage) | 2 | |
| [SoundCloud](https://developers.soundcloud.com/) | [link](https://soundcloud.com/you/apps) | [link](https://soundcloud.com/settings/connections) | 2 ||
| [Spotify](https://developer.spotify.com/documentation/web-api/) | [link](https://developer.spotify.com/dashboard) | [link](https://www.spotify.com/account/apps/) | 2 ||
| [SteamOpenID](https://developer.valvesoftware.com/wiki/Steam_Web_API) | [link](https://steamcommunity.com/dev/apikey) | | - | |
| [Stripe](https://stripe.com/docs/api) | [link](https://dashboard.stripe.com/apikeys) | [link](https://dashboard.stripe.com/account/applications) | 2 | |
| [Tumblr](https://www.tumblr.com/docs/en/api/v2) | [link](https://www.tumblr.com/oauth/apps) | [link](https://www.tumblr.com/settings/apps) | 1 | |
| [Tumblr2](https://www.tumblr.com/docs/en/api/v2) | [link](https://www.tumblr.com/oauth/apps) | [link](https://www.tumblr.com/settings/apps) | 2 | |
| [Twitch](https://dev.twitch.tv/docs/api/reference/) | [link](https://dev.twitch.tv/console/apps/create) | [link](https://www.twitch.tv/settings/connections) | 2 ||
| [Twitter](https://developer.twitter.com/docs) | [link](https://developer.twitter.com/apps) | [link](https://twitter.com/settings/applications) | 1 | |
| [TwitterCC](https://developer.twitter.com/en/docs/basics/authentication/overview/application-only) | [link](https://developer.twitter.com/apps) | [link](https://twitter.com/settings/applications) | 2 ||
| [Vimeo](https://developer.vimeo.com) | [link](https://developer.vimeo.com/apps) | [link](https://vimeo.com/settings/apps) | 2 ||
| [WordPress](https://developer.wordpress.com/docs/api/) | [link](https://developer.wordpress.com/apps/) | [link](https://wordpress.com/me/security/connected-applications) | 2 | |
| [YouTube](https://developers.google.com/oauthplayground/) | [link](https://console.developers.google.com/apis/credentials) | [link](https://myaccount.google.com/permissions) | 2 | |
<!-- TABLE_END -->


Profit!

Expand Down
19 changes: 14 additions & 5 deletions examples/create-docblocks.php → examples/create-descripton.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@

require_once __DIR__.'/provider-example-common.php';

const REPLACE_START = '<!-- TABLE-START -->';
const REPLACE_END = '<!-- TABLE_END -->';

$table = [
'| Provider | API keys | revoke access | OAuth | `ClientCredentials` |',
'|----------|----------|---------------|-------|---------------------|',
];

foreach(getProviders(__DIR__.'/../src') as $p){
foreach(getProviders(__DIR__.'/../src/Providers') as $p){
/** @var \OAuthProviderFactory $factory */
$provider = $factory->getProvider($p['fqcn'], '', false);

Expand All @@ -44,10 +47,16 @@

$file = __DIR__.'/../README.md';
$readme = file_get_contents($file);
$start = (strpos($readme, '<!--A-->') + 8);
$end = strpos($readme, '<!--O-->');
$start = strpos($readme, REPLACE_START);
$end = (strpos($readme, REPLACE_END) + strlen(REPLACE_END));

$readme = str_replace(
substr($readme, $start, ($end - $start)),
REPLACE_START."\n".implode("\n", $table)."\n".REPLACE_END,
$readme,
);

file_put_contents($file, str_replace(substr($readme, $start, ($end - $start)), "\n".implode("\n", $table)."\n", $readme));
file_put_contents($file, $readme);

exit;

Expand All @@ -74,7 +83,7 @@ function getProviders(string $providerDir):array{

$providers[hash('crc32b', $r->getShortName())] = ['name' => $r->getShortName(), 'fqcn' => $class];
}
catch(Throwable $e){
catch(Throwable){
continue;
}

Expand Down

0 comments on commit f7e8181

Please sign in to comment.