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

Update support for MSI authentication #13

Merged
merged 45 commits into from
Sep 5, 2018

Conversation

@kpajdzik kpajdzik requested review from amarzavery, RikkiGibson and a user August 30, 2018 17:54
@@ -0,0 +1,110 @@
import { MSITokenCredentials } from "./msiTokenCredentials";
import { MSIAppServiceOptions, TokenResponse, Callback } from "../login";
import * as request from "request";
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need the request library?

Copy link
Contributor

Choose a reason for hiding this comment

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

* {object} [tokenResponse] The tokenResponse (tokenType and accessToken are the two important properties).
*/
getToken(callback: Callback<TokenResponse>): void {
const postUrl = `http://localhost:${this.port}/oauth2/token`;
Copy link

Choose a reason for hiding this comment

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

I'm guessing this only works on an Azure VM?

@RikkiGibson
Copy link
Member

When this is ready please bump the minor version and promote the auto-published preview to @latest

});

it("should throw on request with empty resource", function (done) {
it("should throw on request with empty resource", async (done) => {
Copy link
Member

Choose a reason for hiding this comment

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

this only matters if you actually use it--but note that individual test configuration (conditional skip, per-test timeout, etc) is done by using the dynamic this inside the test function, which requires the old function syntax.

@RikkiGibson
Copy link
Member

It actually looks like there is no auto-publish for this 📦

/**
* @property {string} access_token - The access token.
* TODO
Copy link
Contributor

Choose a reason for hiding this comment

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

Why a TODO?

@kpajdzik kpajdzik changed the title Update support for MSI authenticatopm Update support for MSI authentication Sep 4, 2018
* @param {object} [options] - Optional parameters
* @param {string} [options.resource] - The resource uri or token audience for which the token is needed.
* For e.g. it can be:
* - resource management endpoint "https://management.azure.com"(default)
Copy link
Contributor

Choose a reason for hiding this comment

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

The documentation does not end with forward slash, whereas the actual value does. One more thing, it is better to define a constant in lib/util/authConstants.ts and then reference it everywhere.

@amarzavery amarzavery merged commit 399d3d6 into master Sep 5, 2018
@kpajdzik kpajdzik deleted the feature/kamip/appservice-msi-support branch November 13, 2018 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants