Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 5.1.0 #230

Merged
merged 7 commits into from
Mar 5, 2018
Merged

Release 5.1.0 #230

merged 7 commits into from
Mar 5, 2018

Conversation

joshcanhelp
Copy link
Contributor

Closed issues

  • Support for php-jwt 5 #210

Added

  • Adding tests for state handler; correcting storage method used #228 (joshcanhelp)

Changed

@joshcanhelp joshcanhelp added this to the 5.1.0 milestone Mar 1, 2018
@joshcanhelp
Copy link
Contributor Author

Tested and working on Drupal (PR #87) and Laravel (PR #90) with changes. Composer update will come with fixes.

README.md Outdated
@@ -24,6 +24,14 @@ Check our docs page to get a complete guide on how to install it in an existing

> If you find something wrong in our docs, PR are welcome in our docs repo: https://github.com/auth0/docs

## Security Upgrade Notes 5.1.0+

**State validation** is now default behaviour for improved security. By default this will automatically use **Session Storage** and will
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not intended carriage return

* @author Auth0
*/
class DummyStateHandler implements StateHandler
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class braces style is different from the method one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be but not consistent in the library (yet)

*
* @author Auth0
*/
interface StateHandler {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inconsistent brace style 😛

@@ -8,6 +8,9 @@
use Auth0\SDK\Store\SessionStore;
use Auth0\SDK\Store\StoreInterface;
use Auth0\SDK\API\Authentication;
use Auth0\SDK\API\Helpers\State\StateHandler;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see StateHandler being instantiated or referenced here. I do see SessionStateHandler and DummyStateHandler though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's mentioned in a docblock, which is flagged in my IDE

@@ -238,7 +256,8 @@ public function __construct(array $config) {
$this->refresh_token = $this->store->get("refresh_token");
}

public function login($state = null, $connection = null) {
public function login($state = null, $connection = null, $additional_params = []) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is NOT a breaking change because you're passing [] as default value when the parameter is missing. Am I correct?

src/Auth0.php Outdated
$params['response_mode'] = $this->response_mode;

if($additional_params) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if my statement is correct, then this will always be either [] or some (I say good) value passed by the user. In any case, this if is always true. Maybe the check should be if($additional_params && $additional_params.length/size>0)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That if will check for truth-y values so an empty array or null will skip it. That said, if someone passed in a 1 or a string or something, they'll get an error. Probably should be something like:

if(!empty($additional_params) && is_array($additional_params)) {
      $params = array_replace($params, $additional_params);
    }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will accept the change, however as long as the parameter type is documented somewhere, users shouldn't be passing invalid (non-array) values. So next time: doc + if($var) should be enough.

use Auth0\SDK\API\Helpers\State\SessionStateHandler;
use Auth0\SDK\Store\SessionStore;

class StateHandlerTest extends \PHPUnit_Framework_TestCase {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the \ intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PHP namespace thing, means 'use the global namespace'

@joshcanhelp joshcanhelp merged commit d1be6f6 into master Mar 5, 2018
@joshcanhelp joshcanhelp deleted the release-5.1.0 branch March 5, 2018 17:32
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants