Skip to content

Commit bbcc14e

Browse files
committed
:octocat: rename SteamOpenID to Steam
1 parent 2f49fea commit bbcc14e

File tree

7 files changed

+25
-28
lines changed

7 files changed

+25
-28
lines changed

.config/.env_example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,10 @@ SPOTIFY_CALLBACK_URL=
219219
#SPOTIFY_TESTUSER=
220220

221221
# http://steamcommunity.com/dev/apikey
222-
STEAMOPENID_KEY=
223-
STEAMOPENID_SECRET=
224-
STEAMOPENID_CALLBACK_URL=
225-
#STEAMOPENID_TESTUSER=
222+
STEAM_KEY=
223+
STEAM_SECRET=
224+
STEAM_CALLBACK_URL=
225+
#STEAM_TESTUSER=
226226

227227
# https://dashboard.stripe.com/account/apikeys
228228
STRIPE_KEY=

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ Note: replace `dev-main` with a [version constraint](https://getcomposer.org/doc
134134
| [Slack](https://api.slack.com) | [link](https://api.slack.com/apps) | [link](https://slack.com/apps/manage) | 2 ||| | | | |
135135
| [SoundCloud](https://developers.soundcloud.com/) | [link](https://soundcloud.com/you/apps) | [link](https://soundcloud.com/settings/connections) | 2 || | ||| |
136136
| [Spotify](https://developer.spotify.com/documentation/web-api/) | [link](https://developer.spotify.com/dashboard) | [link](https://www.spotify.com/account/apps/) | 2 ||| ||| |
137-
| [SteamOpenID](https://developer.valvesoftware.com/wiki/Steam_Web_API) | [link](https://steamcommunity.com/dev/apikey) | | - || | | | | |
137+
| [Steam](https://developer.valvesoftware.com/wiki/Steam_Web_API) | [link](https://steamcommunity.com/dev/apikey) | | - || | | | | |
138138
| [Stripe](https://stripe.com/docs/api) | [link](https://dashboard.stripe.com/apikeys) | [link](https://dashboard.stripe.com/account/applications) | 2 ||| | |||
139139
| [Tumblr](https://www.tumblr.com/docs/en/api/v2) | [link](https://www.tumblr.com/oauth/apps) | [link](https://www.tumblr.com/settings/apps) | 1 || | | | | |
140140
| [Tumblr2](https://www.tumblr.com/docs/en/api/v2) | [link](https://www.tumblr.com/oauth/apps) | [link](https://www.tumblr.com/settings/apps) | 2 ||| ||| |

docs/Basics/Overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ fully [PSR-7](https://www.php-fig.org/psr/psr-7/)/[PSR-17](https://www.php-fig.o
7373
| [Slack](https://api.slack.com) | [link](https://api.slack.com/apps) | [link](https://slack.com/apps/manage) | 2 ||| | | | |
7474
| [SoundCloud](https://developers.soundcloud.com/) | [link](https://soundcloud.com/you/apps) | [link](https://soundcloud.com/settings/connections) | 2 || | ||| |
7575
| [Spotify](https://developer.spotify.com/documentation/web-api/) | [link](https://developer.spotify.com/dashboard) | [link](https://www.spotify.com/account/apps/) | 2 ||| ||| |
76-
| [SteamOpenID](https://developer.valvesoftware.com/wiki/Steam_Web_API) | [link](https://steamcommunity.com/dev/apikey) | | - || | | | | |
76+
| [Steam](https://developer.valvesoftware.com/wiki/Steam_Web_API) | [link](https://steamcommunity.com/dev/apikey) | | - || | | | | |
7777
| [Stripe](https://stripe.com/docs/api) | [link](https://dashboard.stripe.com/apikeys) | [link](https://dashboard.stripe.com/account/applications) | 2 ||| | |||
7878
| [Tumblr](https://www.tumblr.com/docs/en/api/v2) | [link](https://www.tumblr.com/oauth/apps) | [link](https://www.tumblr.com/settings/apps) | 1 || | | | | |
7979
| [Tumblr2](https://www.tumblr.com/docs/en/api/v2) | [link](https://www.tumblr.com/oauth/apps) | [link](https://www.tumblr.com/settings/apps) | 2 ||| ||| |
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,15 @@
99
*/
1010
declare(strict_types=1);
1111

12-
use chillerlan\HTTP\Utils\MessageUtil;
13-
use chillerlan\OAuth\Providers\SteamOpenID;
12+
use chillerlan\OAuth\Providers\Steam;
1413

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

1716
/**
18-
* @var \OAuthExampleProviderFactory $factory
19-
* @var \chillerlan\OAuth\Providers\SteamOpenID $provider
17+
* @var \OAuthExampleProviderFactory $factory
18+
* @var \chillerlan\OAuth\Providers\Steam $provider
2019
*/
21-
$provider = $factory->getProvider(SteamOpenID::class);
20+
$provider = $factory->getProvider(Steam::class);
2221
$name = $provider->name;
2322

2423
// step 2: redirect to the provider's login screen
@@ -27,7 +26,7 @@
2726
}
2827
// step 3: receive the access token
2928
elseif(isset($_GET['openid_sig']) && isset($_GET['openid_signed'])){
30-
// the SteamOpenID provider takes the whole $_GET array as it uses multiple of the query parameters
29+
// the Steam provider takes the whole $_GET array as it uses multiple of the query parameters
3130
$token = $provider->getAccessToken($_GET);
3231

3332
// save the token [...]
@@ -45,9 +44,8 @@
4544
// use the file storage from now on
4645
$provider->setStorage($factory->getFileStorage());
4746

47+
$data = $provider->me();
4848
$token = $provider->getAccessTokenFromStorage(); // the user's steamid is stored as access token
49-
$response = $provider->request('/ISteamUser/GetPlayerSummaries/v2', ['steamids' => $token->accessToken]);
50-
$data = print_r(MessageUtil::decodeJSON($response), true);
5149
$tokenJSON = $token->toJSON();
5250

5351
printf('<pre>%s</pre><textarea cols="120" rows="5" onclick="this.select();">%s</textarea>', $data, $tokenJSON);
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Class SteamOpenID
3+
* Class Steam
44
*
55
* @created 15.03.2021
66
* @author smiley <smiley@chillerlan.net>
@@ -24,9 +24,9 @@
2424
* @see https://partner.steamgames.com/doc/webapi_overview
2525
* @see https://steamwebapi.azurewebsites.net/
2626
*/
27-
class SteamOpenID extends OAuthProvider implements UserInfo{
27+
class Steam extends OAuthProvider implements UserInfo{
2828

29-
public const IDENTIFIER = 'STEAMOPENID';
29+
public const IDENTIFIER = 'STEAM';
3030

3131
protected string $authorizationURL = 'https://steamcommunity.com/openid/login';
3232
protected string $accessTokenURL = 'https://steamcommunity.com/openid/login';

tests/Providers/Live/SteamOpenIDAPITest.php renamed to tests/Providers/Live/SteamAPITest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Class SteamOpenIDAPITest
3+
* Class SteamAPITest
44
*
55
* @created 15.03.2021
66
* @author smiley <smiley@chillerlan.net>
@@ -12,19 +12,19 @@
1212
namespace chillerlan\OAuthTest\Providers\Live;
1313

1414
use chillerlan\OAuth\Core\AuthenticatedUser;
15-
use chillerlan\OAuth\Providers\SteamOpenID;
15+
use chillerlan\OAuth\Providers\Steam;
1616
use PHPUnit\Framework\Attributes\Group;
1717

1818
/**
19-
* @property \chillerlan\OAuth\Providers\SteamOpenID $provider
19+
* @property \chillerlan\OAuth\Providers\Steam $provider
2020
*/
2121
#[Group('providerLiveTest')]
22-
final class SteamOpenIDAPITest extends OAuthProviderLiveTestAbstract{
22+
final class SteamAPITest extends OAuthProviderLiveTestAbstract{
2323

2424
protected int $id;
2525

2626
protected function getProviderFQCN():string{
27-
return SteamOpenID::class;
27+
return Steam::class;
2828
}
2929

3030
protected function setUp():void{
@@ -40,7 +40,6 @@ public function testUnauthorizedAccessException():void{
4040
}
4141

4242
protected function assertMeResponse(AuthenticatedUser $user):void{
43-
var_dump($user);
4443
$this::assertSame((int)$this->TEST_USER, $user->id);
4544
}
4645

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* Class SteamOpenIDTest
3+
* Class SteamTest
44
*
55
* @created 15.03.2021
66
* @author smiley <smiley@chillerlan.net>
@@ -11,15 +11,15 @@
1111

1212
namespace chillerlan\OAuthTest\Providers\Unit;
1313

14-
use chillerlan\OAuth\Providers\SteamOpenID;
14+
use chillerlan\OAuth\Providers\Steam;
1515

1616
/**
17-
* @property \chillerlan\OAuth\Providers\SteamOpenID $provider
17+
* @property \chillerlan\OAuth\Providers\Steam $provider
1818
*/
19-
final class SteamOpenIDTest extends OAuthProviderUnitTestAbstract{
19+
final class SteamTest extends OAuthProviderUnitTestAbstract{
2020

2121
protected function getProviderFQCN():string{
22-
return SteamOpenID::class;
22+
return Steam::class;
2323
}
2424

2525
public function testMeUnknownErrorException():void{

0 commit comments

Comments
 (0)