Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit d3371d1

Browse files
committed
Merge pull request #115 from stormpath/hotfix/v1.12.2
Hotfix/v1.12.2
2 parents a03c7af + 9f9fb6d commit d3371d1

11 files changed

Lines changed: 92 additions & 23 deletions

CHANGES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
stormpath-sdk-php Changelog
22
===========================
33

4+
Version 1.12.2
5+
--------------
6+
7+
Released on December 16, 2015
8+
9+
- Fixed a bug where the accessToken and refreshTokens were not accessible from the Account
10+
- We now show the refresh token object from OauthGrantAuthenticatorResult for all requests if enabled
11+
- Removed logging from the phpunit tests. If code coverage is needed, you should now use the flag on phpunit
12+
- Update Readme Documentation to reference the fixes and phpunit changes
13+
- Removed branch alias from composer.json file
14+
415
Version 1.12.1
516
--------------
617

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
[![Codecov](https://img.shields.io/codecov/c/github/stormpath/stormpath-sdk-php.svg)](https://codecov.io/github/stormpath/stormpath-sdk-php)
33
[![Total Downloads](https://poser.pugx.org/stormpath/sdk/d/total.svg)](https://packagist.org/packages/stormpath/sdk)
44
[![Latest Stable Version](https://poser.pugx.org/stormpath/sdk/v/stable.svg)](https://packagist.org/packages/stormpath/sdk)
5-
[![Latest Unstable Version](https://poser.pugx.org/stormpath/sdk/v/unstable.svg)](https://packagist.org/packages/stormpath/sdk)
65
[![License](https://poser.pugx.org/stormpath/sdk/license.svg)](https://packagist.org/packages/stormpath/sdk)
76

87
# Stormpath PHP SDK
@@ -1942,8 +1941,11 @@ Alternatively, configure the api key id and secret and run the tests:
19421941
export STORMPATH_SDK_TEST_API_KEY_SECRET=API_KEY_SECRET_VALUE
19431942
vendor/bin/phpunit
19441943

1945-
After running the tests, find the code coverage information
1946-
in the following directory: <code>tests/code-coverage</code>
1944+
If you would like code coverage, please run the tests with the following:
1945+
1946+
vendor/bin/phpunit --coverage-html=./code-coverage
1947+
1948+
The code coverage will be placed in the root of the package in a folder named `code-coverage`. Once you have this folder, you can open it in your browser to view it.
19471949

19481950
## Contributing
19491951

composer.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@
3535
"Stormpath\\Tests\\": "tests/"
3636
}
3737
},
38-
"extra": {
39-
"branch-alias": {
40-
"dev-master": "1.12-dev"
41-
}
42-
},
4338
"require": {
4439
"php": ">=5.4",
4540
"guzzle/guzzle": "3.9.*",

phpunit.xml.dist

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@
99
</testsuite>
1010
</testsuites>
1111

12-
<logging>
13-
<log type="coverage-html" target="./code-coverage" charset="UTF-8" yui="true" lowUpperBound="50" highLowerBound="90"/>
14-
<log type="coverage-clover" target="./code-coverage/clover.xml"/>
15-
<log type="coverage-crap4j" target="./code-coverage/crap4j.xml"/>
16-
<log type="coverage-php" target="./code-coverage/coverage.php"/>
17-
<log type="coverage-text" target="./code-coverage/coverage.txt"/>
18-
<log type="junit" target="./code-coverage/junit.xml" logIncompleteSkipped="false"/>
19-
</logging>
20-
2112
<filter>
2213
<whitelist addUncoveredFilesFromWhitelist="true">
2314
<directory suffix=".php">./src</directory>

src/Oauth/OauthGrantAuthenticationResultBuilder.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ public function build()
6565
$this->accessTokenHref = $this->grantAuthenticationToken->getAccessTokenHref();
6666
$this->tokenType = $this->grantAuthenticationToken->getTokenType();
6767
$this->expiresIn = $this->grantAuthenticationToken->getExpiresIn();
68-
69-
if ($this->isRefreshGrantAuthRequest)
70-
$this->refreshToken = $this->grantAuthenticationToken->getAsRefreshToken();
68+
$this->refreshToken = $this->grantAuthenticationToken->getAsRefreshToken();
7169

7270
return new OauthGrantAuthenticationResult($this);
7371
}

src/Resource/AccessTokenList.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace Stormpath\Resource;
4+
5+
/*
6+
* Copyright 2013 Stormpath, Inc.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
21+
use Stormpath\Stormpath;
22+
23+
class AccessTokenList extends AbstractCollectionResource
24+
{
25+
function getItemClassName()
26+
{
27+
return Stormpath::ACCESS_TOKEN;
28+
}
29+
30+
}

src/Resource/Account.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ class Account extends InstanceResource implements Deletable
3939
const FULL_NAME = "fullName";
4040
const TENANT = "tenant";
4141
const PROVIDER_DATA = "providerData";
42+
const ACCESS_TOKENS = "accessTokens";
43+
const REFRESH_TOKENS = "refreshTokens";
4244

4345
const PATH = "accounts";
4446

@@ -156,6 +158,16 @@ public function getDirectory(array $options = array())
156158
return $this->getResourceProperty(self::DIRECTORY, Stormpath::DIRECTORY, $options);
157159
}
158160

161+
public function getAccessTokens(array $options = array())
162+
{
163+
return $this->getResourceProperty(self::ACCESS_TOKENS, Stormpath::ACCESS_TOKEN_LIST, $options);
164+
}
165+
166+
public function getRefreshTokens(array $options = array())
167+
{
168+
return $this->getResourceProperty(self::REFRESH_TOKENS, Stormpath::REFRESH_TOKEN_LIST, $options);
169+
}
170+
159171
public function getEmailVerificationToken(array $options = array())
160172
{
161173
return $this->getResourceProperty(self::EMAIL_VERIFICATION_TOKEN, Stormpath::EMAIL_VERIFICATION_TOKEN, $options);

src/Resource/RefreshTokenList.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
namespace Stormpath\Resource;
4+
5+
/*
6+
* Copyright 2013 Stormpath, Inc.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
21+
use Stormpath\Stormpath;
22+
23+
class RefreshTokenList extends AbstractCollectionResource
24+
{
25+
function getItemClassName()
26+
{
27+
return Stormpath::REFRESH_TOKEN;
28+
}
29+
30+
}

src/Stormpath.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
class Stormpath
2222
{
2323
const ACCESS_TOKEN = 'AccessToken';
24+
const ACCESS_TOKEN_LIST = 'AccessTokenList';
2425
const ACCOUNT = 'Account';
2526
const ACCOUNT_CREATION_POLICY = "AccountCreationPolicy";
2627
const ACCOUNT_LIST = 'AccountList';
@@ -59,6 +60,7 @@ class Stormpath
5960
const PROVIDER_ACCOUNT_RESULT = 'ProviderAccountResult';
6061
const PROVIDER_DATA = 'ProviderData';
6162
const REFRESH_TOKEN = 'RefreshToken';
63+
const REFRESH_TOKEN_LIST = 'RefreshTokenList';
6264
const TENANT = 'Tenant';
6365
const VERIFICATION_EMAIL = 'VerificationEmail';
6466

tests/Oauth/PasswordRefreshGrantTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function it_responds_to_password_grant_types()
6666
$this->assertInstanceOf('Stormpath\Oauth\OauthGrantAuthenticationResult', self::$token);
6767
$this->assertInstanceOf('Stormpath\Resource\AccessToken', self::$token->getAccessToken());
6868
$this->assertCount(3, explode('.',self::$token->getAccessTokenString()));
69-
$this->assertNull(self::$token->getRefreshToken());
69+
$this->assertInstanceOf('Stormpath\Resource\RefreshToken', self::$token->getRefreshToken());
7070
$this->assertCount(3, explode('.',self::$token->getRefreshTokenString()));
7171
$this->assertcontains('/accessTokens/', self::$token->getAccessTokenHref());
7272
$this->assertEquals('Bearer', self::$token->getTokenType());

0 commit comments

Comments
 (0)