-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: add new token manager for ICP4D #26
Conversation
Introduce a constructor parameter, `authentication_type`, for specifying the authentication pattern. Required for using ICP4D
Also, make `authentication_type` non-case-sensitive
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.
Here's a first batch of comments.
Should we rename the |
It is ICP4D specific, so that's definitely not a bad idea. I'll make that change, unless anyone disagrees. Definitely a bit of an obnoxious name haha |
Codecov Report
@@ Coverage Diff @@
## master #26 +/- ##
=========================================
Coverage ? 93.26%
=========================================
Files ? 12
Lines ? 505
Branches ? 147
=========================================
Hits ? 471
Misses ? 33
Partials ? 1
Continue to review full report at Codecov.
|
also, rename JwtTokenManager to JwtTokenManagerV1
Okay last minute (small) changes have been made and all tests have been added. Officially ready for final review |
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.
I left a few comments that I hope you will address, but in any event I think the code here is okay to merge.
auth/iam-token-manager-v1.ts
Outdated
@@ -0,0 +1,158 @@ | |||
/** | |||
* Copyright 2015 IBM Corp. All Rights Reserved. |
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.
Need to check copyright date on this file.
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.
Yes, that's certainly wrong. The IAM token manager was originally written in 2018 but this specific file in this repo was added in 2019. So - should it be 2018, 2019
or 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.
👍 looks good! There are a few references to refresh tokens - Are we still refreshing tokens or are all of these meant for compatibility?
We're not using refresh tokens anymore. We are requesting a new token when the token is expired and I might have referred to that as a "refresh" but I agree that may be misleading. I'll update that |
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.
left a few comments but looks OK
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.
LGTM
# [0.3.0](v0.2.8...v0.3.0) (2019-06-05) ### Features * add `IcpTokenManagerV1` as a top-level export of the package ([cfa3e1b](cfa3e1b)) * add new token manager for ICP4D ([ee1ddad](ee1ddad)) * add new token manager for ICP4D ([#26](#26)) ([2097a64](2097a64)) * carry `disable_ssl_verification` through to token managers ([4f2f789](4f2f789))
🎉 This PR is included in version 0.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@dpopp07 can you add an icon to |
no |
Haha I would if I could 🤷♂ |
@germanattanasio Oh wait, it looks like it does have an icon! |
Changes:
authentication_type
, for specifying the authentication pattern. This will be required for using ICP4DJwtTokenManager
for all token-managing needs. This is a base class for the new ICP token manager. I also refactored the IAM token manger to extend the new JWT class tooI still need to write tests but want to start getting feedback on the implementation now, so I don't have to re-write the tests too many times
TODO:
authentication_type
cc @ehdsouza @mediumTaj @lpatino10 @mamoonraja