Conversation
Codecov Report
@@ Coverage Diff @@
## master #64 +/- ##
==========================================
- Coverage 65.33% 58.15% -7.19%
==========================================
Files 5 6 +1
Lines 251 282 +31
==========================================
Hits 164 164
- Misses 87 118 +31
Continue to review full report at Codecov.
|
Contributor
Author
|
Tests are currently failing since this requires TypeSafeMiddleware which will only be available in Kitura 2.4 |
ianpartridge
approved these changes
Jun 1, 2018
djones6
approved these changes
Jun 1, 2018
Contributor
djones6
left a comment
There was a problem hiding this comment.
This looks good. Minor comment about refactoring but that could be done another time.
| onFailure: { status, headers in | ||
| fail(response: response, status: status, headers: headers) | ||
| }, | ||
| onSkip: { status, headers in |
Contributor
There was a problem hiding this comment.
This could be refactored into a skip() function
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add the TypeSafeCredentials protocol needed for TypeSafeMiddleware
This has a handle function which will be called by the type-safe middleware to authenticate the user and return an instance of self on success, fail and end the response onFailure or return an error and continue onPass.
inProgress was removed since it isn't getting called by the current credentials and i don't believe we will use it.
redirect unauthorized was added which would redirect the user to a defined url if they failed to authenticate and this is set to have a value.
The plugin headers are set to allow httpBasic to set the headers requesting the user input a username and password.
Id and Provider are needed since these combined will make a unique identifier which is the desired result of this process and will simplify multiple authentication.
On pass will only set the response status if one has not already been set. This is so you can have multiple routes defined on the same path with different auths and if one succeeds then you don't get back unauthorized.