From 637c93f5f5920dd742d0ffaedd4800d6bf9dc25b Mon Sep 17 00:00:00 2001 From: morgangauth <113058716+morgangauth@users.noreply.github.com> Date: Tue, 1 Oct 2024 10:01:18 -0700 Subject: [PATCH] Add in description of using multiple headers env variable Added note from https://github.com/sourcegraph/src-cli/blob/main/AUTH_PROXY.md --- docs/cli/explanations/env.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/cli/explanations/env.mdx b/docs/cli/explanations/env.mdx index ef1355577..036e55d50 100644 --- a/docs/cli/explanations/env.mdx +++ b/docs/cli/explanations/env.mdx @@ -33,6 +33,14 @@ SRC_HEADER_AUTHORIZATION="Bearer $(curl http://service.internal.corp)" SRC_HEADE In the above example, the headers `authorization: Bearer my-generated-token` and `extra: metadata` will be threaded to all HTTP requests to your instance. Multiple such headers can be supplied. +An alternative to the above when passing in multiple headers or headers with dashes is to make use of the `SRC_HEADERS` environment variable as follows: + +```sh +SRC_HEADERS="AUTHORIZATION:Bearer somerandom_string\nClient-ID:client-one\nextra:metadata" +``` + +Note: The different header keys and values need to separated by a new line ("\n"). In the above example, the headers `authorization: Bearer somerandom_string`, `client-id: client-one` and `extra: metadata` will be threaded to all HTTP requests to your instance. + Example passing env vars via a shell config file: In the .zshrc - ```bash