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

[Storage] Get proxySettings from Environment when not defined in the code #5230

Merged
merged 3 commits into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sdk/storage/storage-blob/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2019.09 12.0.0-preview.4

- Library tries to load the proxy settings from the environment variables like HTTP_PROXY if the proxy settings are not provided when clients like BlobServiceClient or BlobClient are instantiated.

## 2019.09 12.0.0-preview.3

- [Breaking] `RawTokenCredential` is dropped. TokenCredential implementations can be found in the [@azure/identity](https://www.npmjs.com/package/@azure/identity) library for authentication.
Expand Down
1 change: 1 addition & 0 deletions sdk/storage/storage-blob/samples/javascript/proxyAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function main() {
// or
// an option bag consisting {host, port, username, password }
proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" }
// if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY
}
);

Expand Down
1 change: 1 addition & 0 deletions sdk/storage/storage-blob/samples/typescript/proxyAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function main() {
// or
// an option bag consisting {host, port, username, password }
proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" }
// if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY
}
);

Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-blob/src/Pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export function newPipeline(
if (isNode) {
// ProxyPolicy is only avaiable in Node.js runtime, not in browsers
let proxySettings: ProxySettings | undefined;
if (typeof pipelineOptions.proxy === "string") {
if (typeof pipelineOptions.proxy === "string" || !pipelineOptions.proxy) {
proxySettings = getDefaultProxySettings(pipelineOptions.proxy);
} else {
proxySettings = pipelineOptions.proxy;
Expand Down
4 changes: 4 additions & 0 deletions sdk/storage/storage-file/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2019.09 12.0.0-preview.4

- Library tries to load the proxy settings from the environment variables like HTTP_PROXY if the proxy settings are not provided when clients like FileServiceClient or FileClient are instantiated.

## 2019.08 12.0.0-preview.3

- Updated Azure Storage Service API version to 2019-02-02.
Expand Down
1 change: 1 addition & 0 deletions sdk/storage/storage-file/samples/javascript/proxyAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function main() {
// or
// an option bag consisting {host, port, username, password }
proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" }
// if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY
}
);

Expand Down
1 change: 1 addition & 0 deletions sdk/storage/storage-file/samples/typescript/proxyAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function main() {
// or
// an option bag consisting {host, port, username, password }
proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" }
// if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY
}
);

Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-file/src/Pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export function newPipeline(
if (isNode) {
// ProxyPolicy is only avaiable in Node.js runtime, not in browsers
let proxySettings: ProxySettings | undefined;
if (typeof pipelineOptions.proxy === "string") {
if (typeof pipelineOptions.proxy === "string" || !pipelineOptions.proxy) {
proxySettings = getDefaultProxySettings(pipelineOptions.proxy);
} else {
proxySettings = pipelineOptions.proxy;
Expand Down
4 changes: 4 additions & 0 deletions sdk/storage/storage-queue/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2019.09 12.0.0-preview.4

- Library tries to load the proxy settings from the environment variables like HTTP_PROXY if the proxy settings are not provided when clients like QueueServiceClient or QueueClient are instantiated.

## 2019.08 12.0.0-preview.3

- [Breaking] `RawTokenCredential` is dropped. TokenCredential implementations can be found in the [@azure/identity](https://www.npmjs.com/package/@azure/identity) library for authentication.
Expand Down
1 change: 1 addition & 0 deletions sdk/storage/storage-queue/samples/javascript/proxyAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function main() {
// or
// an option bag consisting {host, port, username, password }
proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" }
// if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY
}
);

Expand Down
1 change: 1 addition & 0 deletions sdk/storage/storage-queue/samples/typescript/proxyAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async function main() {
// or
// an option bag consisting {host, port, username, password }
proxy: { host: "http://localhost", port: 3128, username: "username", password: "password" }
// if proxy is undefined, the library tries to load the proxy settings from the environment variables like HTTP_PROXY
}
);

Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-queue/src/Pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function newPipeline(
if (isNode) {
// ProxyPolicy is only avaiable in Node.js runtime, not in browsers
let proxySettings: ProxySettings | undefined;
if (typeof pipelineOptions.proxy === "string") {
if (typeof pipelineOptions.proxy === "string" || !pipelineOptions.proxy) {
proxySettings = getDefaultProxySettings(pipelineOptions.proxy);
} else {
proxySettings = pipelineOptions.proxy;
Expand Down