Skip to content
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(VpcInstanceAuthenticator): add support for new VPC authentication flow #172

Merged
merged 17 commits into from
Nov 8, 2021

Conversation

dpopp07
Copy link
Member

@dpopp07 dpopp07 commented Oct 20, 2021

This commit introduces the VpcInstanceAuthenticator.
This authenticator implements the authentication flow
within a VPC-managed compute resource that is configured to
use the compute resource identity feature.
This involves the use of the compute resource's local
VPC Instance Metadata Service API to retrieve an instance identity
token, and then exchange that token for an IAM access token.
The IAM access token is then used to authenticate outbound REST
API requests by adding an Authorization containing the access token.

Checklist
  • npm test passes (tip: npm run lint-fix can correct most style issues)
  • tests are included
  • documentation is changed or added

@dpopp07 dpopp07 force-pushed the dp/vpc-authenticator branch 2 times, most recently from ef45f0b to e41e6d4 Compare October 20, 2021 22:03
Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

Looks good overall. I pointed out a few minor things to fix, plus we should discuss whether to include/exclude the disableSslVerification and headers properties.
Also, I noticed that we don't do any testing with an actual JWT-based access token to test things like the expiration of a token or the need to acquire a new one within the "refresh window", etc.
But I noticed that we do that in the iam token manager and jwt token manager tests. I guess that would be sufficient since we're inheriting that functionality (jwt-token-manager) into the vpc-token-manager.

Authentication.md Outdated Show resolved Hide resolved
Authentication.md Outdated Show resolved Hide resolved
Authentication.md Outdated Show resolved Hide resolved
auth/authenticators/vpc-instance-authenticator.ts Outdated Show resolved Hide resolved
auth/token-managers/vpc-instance-token-manager.ts Outdated Show resolved Hide resolved
auth/token-managers/vpc-instance-token-manager.ts Outdated Show resolved Hide resolved
auth/token-managers/vpc-instance-token-manager.ts Outdated Show resolved Hide resolved
test/unit/vpc-instance-authenticator.test.js Outdated Show resolved Hide resolved
Copy link
Member

@pyrooka pyrooka left a comment

Choose a reason for hiding this comment

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

Looks good!

auth/token-managers/vpc-instance-token-manager.ts Outdated Show resolved Hide resolved
Authentication.md Outdated Show resolved Hide resolved
Authentication.md Outdated Show resolved Hide resolved
Copy link
Member

@padamstx padamstx left a comment

Choose a reason for hiding this comment

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

Reviewed latest updates. Looks good! 👍

dpopp07 and others added 10 commits October 21, 2021 12:16
…n flow

This commit introduces the VpcInstanceAuthenticator.
This authenticator implements the authentication flow
within a VPC-managed compute resource that is configured to
use the compute resource identity feature.
This involves the use of the compute resource's local
VPC Instance Metadata Service API to retrieve an instance identity
token, and then exchange that token for an IAM access token.
The IAM access token is then used to authenticate outbound REST
API requests by adding an Authorization containing the access token.
Co-authored-by: Phil Adams <padamstx@gmail.com>
Co-authored-by: Phil Adams <padamstx@gmail.com>
Co-authored-by: Phil Adams <padamstx@gmail.com>
Co-authored-by: Phil Adams <padamstx@gmail.com>
Co-authored-by: Norbert Biczo <pyrooka@users.noreply.github.com>
Co-authored-by: Norbert Biczo <pyrooka@users.noreply.github.com>
Co-authored-by: Norbert Biczo <pyrooka@users.noreply.github.com>
@dpopp07
Copy link
Member Author

dpopp07 commented Oct 21, 2021

Okay, all requested changes have now been addressed. This PR should be ready to merge once we complete the additional, external testing 👍

@padamstx padamstx merged commit 8bbe704 into main Nov 8, 2021
@padamstx padamstx deleted the dp/vpc-authenticator branch November 8, 2021 17:23
ibm-devx-sdk pushed a commit that referenced this pull request Nov 8, 2021
# [2.17.0](v2.16.0...v2.17.0) (2021-11-08)

### Features

* **VpcInstanceAuthenticator:** add support for new VPC authentication flow ([#172](#172)) ([8bbe704](8bbe704))
@ibm-devx-sdk
Copy link

🎉 This PR is included in version 2.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants