This repository was archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Allow to configure validator with custom authentication result codes and validation messages #47
Merged
Xerkus
merged 6 commits into
zendframework:develop
from
Xerkus:feature/configurable-validator
May 14, 2019
Merged
Allow to configure validator with custom authentication result codes and validation messages #47
Xerkus
merged 6 commits into
zendframework:develop
from
Xerkus:feature/configurable-validator
May 14, 2019
+230
−12
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
weierophinney
suggested changes
May 13, 2019
There was a problem hiding this 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.
@weierophinney I pushed improved documentation for validator that I hope should be more clear. |
weierophinney
suggested changes
May 14, 2019
There was a problem hiding this 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
commented
May 14, 2019
Co-Authored-By: Matthew Weier O'Phinney <matthew@weierophinney.net>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds feature to configure Authentication validator with user defined authentication result codes and their corresponding validation messages.
Solves #41
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.
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 ormessages
option.develop
branch, and submit against that branch.CHANGELOG.md
entry for the new feature.