Skip to content

Commit

Permalink
Fixes #133 : ntlm auth suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric05 committed Mar 12, 2022
1 parent 1fe3bef commit 854d62e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/extension/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,22 @@ abstract class BaseSpanClient implements ICommandClient {
export class StdoutClient extends BaseSpanClient {
rl!: Interface;
eventS: EventEmitter = new EventEmitter();
version: string = "unknown";

constructor(options: { pythonpath: string, stdargs: string[], type: RunType }) {
super(options);
this.setup();
this.healInstallation(options);

once(this.eventS, "-1").then(result => {
if (result.length != 1){
console.log('unknown dothttp cli')
} else {
this.version = result[0].result.dothttp_version;
console.log(`detected dothttp cli with version: ${this.version}`,)
}
});

}
private setup() {
this.rl = createInterface({
Expand Down
13 changes: 12 additions & 1 deletion src/extension/models/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export enum DothttpTypes {
URL = "url",
BASIC_AUTH = "basic_auth",
DIGEST_AUTH = "digest_auth",
NTLM_AUTH = "ntlm_auth",
CERTIFICATE = "certificate",
HEADER = "header",
URL_PARAMS = "urlparams",
Expand Down Expand Up @@ -65,13 +66,21 @@ visit [docs](https://docs.dothttp.dev/docs/flags)`),
1. name (Opitonal) \`@name\`
1. flags(@insecure/@clear) (Optional) \`@insecure\`, \`@clear\`
1. Url (required)
1. basicauth/digestauth (Optional) \`basicauth\`, \`digestauth\`
1. basicauth/digestauth (Optional) \`basicauth\`, \`digestauth\`, \`ntlmauth\`, \`awsauth\`
1. certificate (Optional) \`certificate(cert="", key="")\` or \`certificate(cert="")\` or \`p12(file="", password="")\`
1. headers (Optional) \`Authorization: "secretkey"\`
1. urlparams (Optional) \`? page = 20\`
1. payload (Optional) \`data("some")\`, \`json({"a":"b"})\` , \`urlencode({"a":"b"})\`, \`files( (key, value), ..)\`, \`fileinput("path to file")\`
1. script (Optional)
`),
"ntlm_auth": new MarkdownString(`Configured with HttpDef Basic authentication mechanism
example:
\`ntlmauth("<username>", "<password>")\`
visit [docs](https://docs.dothttp.dev/docs/auth/#ntlm-authentication)
`),
"basic_auth": new MarkdownString(`Configured with HttpDef Basic authentication mechanism
Expand Down Expand Up @@ -167,6 +176,8 @@ visit [docs](https://docs.dothttp.dev/docs/request-basics#multipart)`),
`),
"script": new MarkdownString(`Run Javascript script after execution of httpdef
\`> {% client.log("sample script") %}\`
visit [docs](https://docs.dothttp.dev/docs/scripts)`),
"comment": new MarkdownString("Comment"),
};
2 changes: 2 additions & 0 deletions src/extension/services/dothttpCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,10 @@ export class KeywordCompletionItemProvider implements CompletionItemProvider {
"multipart",
"text",
"form",
"awsauth",
"fileinput",
"digestauth",
"ntlmauth",
"cert",
"p12",
"certificate",
Expand Down

0 comments on commit 854d62e

Please sign in to comment.