Skip to content

Commit

Permalink
allow disabling automatically loading proxy settings from environment…
Browse files Browse the repository at this point in the history
… variables
  • Loading branch information
allen-li1231 committed Jan 25, 2025
1 parent 32a4ba0 commit c549652
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 27 deletions.
48 changes: 25 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"order": 1,
"type": "boolean",
"default": true,
"description": "Specify whether to sync notebook with Zeppelin server when active notebook is changed."
"description": "Sync notebook with Zeppelin server when current active notebook is changed."
},
"zeppelin.autosave.throttleTime": {
"order": 2,
Expand Down Expand Up @@ -151,61 +151,63 @@
"default": 5,
"description": "Set minimum interval (in seconds) to track interpreter status."
},
"zeppelin.proxy.host": {
"zeppelin.proxy.loadEnvironmentVariable": {
"order": 7,
"type": "string",
"type": "boolean",
"default": true,
"markdownDescription": "Load proxy settings via `http_proxy`, `https_proxy` and `no_proxy` environment variables (Require reloading window to apply)."
},
"zeppelin.proxy.host": {
"order": 8,
"type": ["string", "null"],
"format": "uri",
"default": null,
"description": "Set proxy host for connection with Zeppelin server."
},
"zeppelin.proxy.port": {
"order": 8,
"type": "integer",
"order": 9,
"type": ["integer", "null"],
"default": null,
"description": "Set proxy port for connection with Zeppelin server."
},
"zeppelin.proxy.credential.username": {
"order": 9,
"type": "string",
"order": 10,
"type": ["string", "null"],
"default": null,
"description": "Specifies proxy authentication for connection with Zeppelin server."
},
"zeppelin.proxy.credential.password": {
"order": 10,
"type": [
"string"
],
"order": 11,
"type": ["string", "null"],
"default": null,
"description": "Specifies proxy authentication for connection with Zeppelin server."
},
"zeppelin.proxy.credential.protocol": {
"order": 11,
"type": "string",
"order": 12,
"type": ["string", "null"],
"default": null,
"description": "Specifies the proxy protocol for connection with Zeppelin server."
},
"zeppelin.https.CA-Certification": {
"order": 12,
"type": "string",
"order": 13,
"type": ["string", "null"],
"default": null,
"description": "Configure a trustworthy private CA cert file path. A complete cert chain is in .pem or .crt format. You must include all certs in the chain up to the trust root."
},
"zeppelin.https.KeyPath": {
"order": 13,
"type": "string",
"order": 14,
"type": ["string", "null"],
"default": null,
"description": "Configure a trustworthy private key path."
},
"zeppelin.https.passphase": {
"order": 14,
"type": [
"string"
],
"order": 15,
"type": ["string", "null"],
"default": null,
"description": "Configure key's corresponding passphase."
"description": "Configure private key's corresponding passphase."
},
"zeppelin.https.rejectUnauthorized": {
"order": 15,
"order": 16,
"type": "boolean",
"default": true,
"description": "Enable client verification. Note that this is otherwise unsafe when accessing a public endpoint."
Expand Down
4 changes: 2 additions & 2 deletions src/common/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class BasicService {
constructor(
baseURL: string,
userAgent: string,
proxy: AxiosProxyConfig | undefined = undefined
proxy: AxiosProxyConfig | false | undefined = undefined
) {
this.baseURL = formatURL(baseURL);

Expand Down Expand Up @@ -176,7 +176,7 @@ export class NotebookService extends BasicService {
constructor(
baseUrl: string,
userAgent: string,
proxy: AxiosProxyConfig | undefined = undefined,
proxy: AxiosProxyConfig | false | undefined = undefined,
) {
super(baseUrl, userAgent, proxy);
}
Expand Down
8 changes: 6 additions & 2 deletions src/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ export function logDebug(item: string | any, ...optionalParams: any[]) {
}

export function getProxy() {
let proxy: AxiosProxyConfig | undefined = undefined;

let config = workspace.getConfiguration('zeppelin');

if (!config.get('proxy.loadEnvironmentVariable')) {
return false;
}

let proxy: AxiosProxyConfig | undefined = undefined;
if (!!config.get('proxy.host') && !!config.get('proxy.port')) {
proxy = {
host: config.get('proxy.host', ''),
Expand Down

0 comments on commit c549652

Please sign in to comment.