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

Allow to configure validator with custom authentication result codes and validation messages #47

Merged
merged 6 commits into from
May 14, 2019

Conversation

Xerkus
Copy link
Member

@Xerkus Xerkus commented May 13, 2019

This PR adds feature to configure Authentication validator with user defined authentication result codes and their corresponding validation messages.
Solves #41

  • Are you creating a new feature?
    • Why is the new feature needed? What purpose does it serve?
      Authentication Result allows custom result codes to be specified but Authentication validator does not provide a way to map those codes to meaningful validation error messages. This feature fixes that by introducing new configuration option for Authentication validator.
    • How will users use the new feature?
      New constructor configuration option code_map added. It is an array of [int $resultCode => string $validatorMessageKey].
      Custom validator message key can be specified which is then registered as a new template that can be modified using common ways provided by Zend\Validator\AbstractValidator: setMessage() method or messages option.
    • Base your feature on the develop branch, and submit against that branch.
    • Add only one feature per pull request; split multiple features over multiple pull requests
    • Add tests for the new feature.
    • Add documentation for the new feature.
    • Add a CHANGELOG.md entry for the new feature.

Sorry, something went wrong.

Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

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

Code looks good.

I've flagged a couple documentation changes, and have one question about code types.

@Xerkus
Copy link
Member Author

Xerkus commented May 14, 2019

@weierophinney I pushed improved documentation for validator that I hope should be more clear.

Copy link
Member

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

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

This reads REALLY well, and makes it very clear how everything works!

I've provided a number of suggestions that fix grammar and/or punctuation. You should be able to commit each and/or batch them from the UI (instead of addressing them one-by-one manually).

Xerkus and others added 2 commits May 15, 2019 03:41
Co-Authored-By: Matthew Weier O'Phinney <matthew@weierophinney.net>
@Xerkus Xerkus merged commit 2268e32 into zendframework:develop May 14, 2019
Xerkus added a commit that referenced this pull request May 14, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Close #47
@Xerkus Xerkus added this to the 2.7.0 milestone May 14, 2019
@Xerkus Xerkus mentioned this pull request May 14, 2019
9 tasks
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.

None yet

2 participants