Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Develop.validate session #23

Closed

Conversation

Stafox
Copy link
Contributor

@Stafox Stafox commented Feb 4, 2016

Issue #21 fix. Now if session id invalid, the exception
Exception\RuntimeException('Session validation failed')
will thrown.

@adamlundrigan
Copy link

You will need to provide unit tests to cover the changes you are proposing to this component.

Your fix extends the public API of SessionManager (by adding a new constructor argument) and adds a new class so it will need closer scrutiny before a decision can be made.

@Stafox
Copy link
Contributor Author

Stafox commented Feb 15, 2016

Ok, I'll add tests asap.

* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
Copy link
Contributor

Choose a reason for hiding this comment

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

2005-2016

@Stafox
Copy link
Contributor Author

Stafox commented Mar 14, 2016

Needs #28 to avoid tests fall.

* @param array $options
* @return SessionManager
*/
public function setOptions(array $options)
Copy link
Member

Choose a reason for hiding this comment

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

The point of your pull request is to allow having default validators enabled, not to expose arbitrary options. As such, I plan to remove the setOptions/getOptions methods on merge, as they are not part of that goal, and because the side-effects of options passed to the constructor can be determined programmatically already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree.

@weierophinney weierophinney added this to the 2.7.0 milestone Apr 11, 2016
@weierophinney weierophinney self-assigned this Apr 11, 2016
weierophinney added a commit that referenced this pull request Apr 11, 2016
- Removed `set`/`getOptions()`, as they were unnecessary to the pull
  request, and unwanted items to the public API.
- Do not store options; unneeded after instantiation.
- Merge default validators before passing to parent constructor.
- Use `::class` notation wherever possible.
- Store session id as `$id` property in `Id` validator; naming is now
  consistent with purpose.
- Provide the delimiters to regex patterns when defining them;
  prevents need for concatenation later.
- Provide guaranteed invalid identifier value when testing ID validator.
- Updated SessionManagerFactory to allow detecting and utilizing options when
  creating SessionManager instance.
weierophinney added a commit that referenced this pull request Apr 11, 2016
weierophinney added a commit that referenced this pull request Apr 11, 2016
@weierophinney
Copy link
Member

Merged to develop for release with 2.7.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants