Skip to content

Commit

Permalink
Merge pull request #41 from rozpuszczalny/bugfix/37-additional-option…
Browse files Browse the repository at this point in the history
…s-from-config

#37 | Respect rejectUnauthorized and additionalHeaders in http(s) options
  • Loading branch information
rozpuszczalny authored Oct 13, 2021
2 parents cbf738d + bb441de commit 6fe4e09
Show file tree
Hide file tree
Showing 9 changed files with 1,338 additions and 1,011 deletions.
1 change: 0 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
},
"extends": [
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended"
],
"rules": {
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to the "vscode-redmine" extension will be documented in this

## [Unreleased]

### Fixed

- [Issue #37](https://github.com/rozpuszczalny/vscode-redmine/issues/37)

## 1.0.3 - 21.09.2020

### Fixed
Expand Down
2,317 changes: 1,314 additions & 1,003 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,19 @@
"watch": "tsc -watch -p ./"
},
"devDependencies": {
"@types/lodash": "^4.14.175",
"@types/mocha": "^2.2.42",
"@types/node": "^7.0.43",
"@types/vscode": "^1.31.0",
"@typescript-eslint/eslint-plugin": "^3.9.1",
"@typescript-eslint/parser": "^3.9.1",
"eslint": "^7.7.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.4",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"prettier": "^2.0.5",
"typescript": "^3.9.7"
},
"dependencies": {
"lodash": "^4.17.21"
}
}
2 changes: 1 addition & 1 deletion src/definitions/redmine-config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface RedmineConfig extends WorkspaceConfiguration {
/**
* Pass rejectUnauthorized to https request options. Use only if your redmine instance has self-signed certificate!
*/
rejectUnauthorized?: string;
rejectUnauthorized?: boolean;
/**
* Project identifier in Redmine
*/
Expand Down
2 changes: 2 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export function activate(context: vscode.ExtensionContext): void {
const redmineServer = new RedmineServer({
address: config.url,
key: config.apiKey,
additionalHeaders: config.additionalHeaders,
rejectUnauthorized: config.rejectUnauthorized,
});

const fromBucket = bucket.servers.find((s) =>
Expand Down
5 changes: 4 additions & 1 deletion src/redmine/redmine-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { TimeEntry } from "./models/time-entry";
import { Issue } from "./models/issue";
import { IssueStatus as RedmineIssueStatus } from "./models/issue-status";
import { Membership as RedmineMembership } from "./models/membership";
import { isEqual } from "lodash";

type HttpMethods = "GET" | "POST" | "PUT" | "DELETE" | "PATCH";

Expand Down Expand Up @@ -360,7 +361,9 @@ export class RedmineServer {
compare(other: RedmineServer) {
return (
this.options.address === other.options.address &&
this.options.key === other.options.key
this.options.key === other.options.key &&
this.options.rejectUnauthorized === other.options.rejectUnauthorized &&
isEqual(this.options.additionalHeaders, other.options.additionalHeaders)
);
}
}
2 changes: 2 additions & 0 deletions src/trees/my-issues-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export class MyIssuesTree implements vscode.TreeDataProvider<Issue> {
this.server = new RedmineServer({
address: config.url,
key: config.apiKey,
additionalHeaders: config.additionalHeaders,
rejectUnauthorized: config.rejectUnauthorized,
});
}

Expand Down
2 changes: 2 additions & 0 deletions src/trees/projects-tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export class ProjectsTree
this.server = new RedmineServer({
address: config.url,
key: config.apiKey,
additionalHeaders: config.additionalHeaders,
rejectUnauthorized: config.rejectUnauthorized,
});
}

Expand Down

0 comments on commit 6fe4e09

Please sign in to comment.