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

Add NTLM support #43

Merged
merged 3 commits into from
Jul 6, 2016
Merged

Add NTLM support #43

merged 3 commits into from
Jul 6, 2016

Conversation

jeffyoung
Copy link
Contributor

(Pending code scan of node-http-ntlm; already in progress.)

Add an NTLM handler using portions of the node-http-ntlm package. Caller provides username and password (and optional domain and workstation) to create the handler. Added two methods to IRequestHandler to determine if the handler can handle the particular type of authentication (e.g., NTLM). I considered adding a new interface but it ended up making the code where the RequestHandler is used more complex (WebApi.ts) so I went the simpler route.

Updated node.d.ts with file from DefinitelyTyped (the ntlm support required the AgentOptions interface exposed by node). Note that the version of Node.js (0.10.1) remains the same.

Took a dependency on underscore, received OSS approval and added ThirdPartyNotices.txt.

Updated Copyright line in LICENSE file per guidance from legal.

Regression tested on Ubuntu VM with xplat build agent. Created a build definition that ran an Ant build and uploaded JAR files as artifacts. Configuration of the build agent and builds on the build definition succeeded.

Manually testing the NTLM changes with the VS Code extension (currently in progress).

@@ -146,14 +147,45 @@ export class HttpClient implements ifm.IHttpClient {
}

request(protocol: any, options: any, objs: any, onResult: (err: any, res: http.ClientResponse, contents: string) => void): void {
// Set up a callback to pass off 401s to an authentication handler that can deal with it
let self = this;
Copy link
Contributor

Choose a reason for hiding this comment

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

you can avoid this if you use a fat-arrow function in the callback below:

var callback = (err, res, contents) => {
  // replace self with this
});`

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.

4 participants