Skip to content

Commit 1a858da

Browse files
authored
Add documentation for proxy configuration (#2083)
Adds documentation to the smithy-build guide detailing how to configure a proxy to use for dependency resolution.
1 parent 4d6b346 commit 1a858da

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

docs/source-2.0/guides/building-models/build-config.rst

+43-1
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,19 @@ the following configuration:
271271
- HTTP basic or digest credentials to use with the repository.
272272
Credentials are provided in the form of "username:password".
273273

274+
.. warning::
275+
276+
Credentials SHOULD NOT be defined statically in a smithy-build.json
277+
file. Instead, use :ref:`environment variables <build_envars>` to
278+
keep credentials out of source control.
279+
* - proxyHost
280+
- ``string``
281+
- The URL of the proxy to configure for this repository (for example, ``http://proxy.maven.apache.org:8080``).
282+
* - proxyCredentials
283+
- ``string``
284+
- HTTP credentials to use with the proxy for the repository.
285+
Credentials are provided in the form of "username:password".
286+
274287
.. warning::
275288

276289
Credentials SHOULD NOT be defined statically in a smithy-build.json
@@ -285,7 +298,9 @@ the following configuration:
285298
"repositories": [
286299
{
287300
"url": "https://my_domain-111122223333.d.codeartifact.region.amazonaws.com/maven/my_repo/",
288-
"httpCredentials": "aws:${CODEARTIFACT_AUTH_TOKEN}"
301+
"httpCredentials": "aws:${CODEARTIFACT_AUTH_TOKEN}",
302+
"proxyHost": "http://localhost:8080",
303+
"proxyCredentials": "user:${PROXY_AUTH_TOKEN}"
289304
}
290305
],
291306
"dependencies": [
@@ -324,6 +339,33 @@ variable, no default repositories are assumed when resolving the
324339
Repositories defined in ``SMITHY_MAVEN_REPOS`` take precedence over
325340
repositories defined through smithy-build.json configuration.
326341

342+
Proxy environment variables
343+
---------------------------
344+
345+
When using the Smithy CLI, the ``SMITHY_PROXY_HOST`` and ``SMITHY_PROXY_CREDENTIALS`` environment variables can be used
346+
to configure a proxy to use for dependency resolution. Setting these environment variables will configure a common
347+
proxy configuration for all repositories.
348+
349+
.. important::
350+
351+
If a :ref:`Maven Repository <maven-repositories>` definition provides a proxy configuration, that configuration will
352+
override the proxy configuration defined by the ``SMITHY_PROXY_HOST`` and ``SMITHY_PROXY_CREDENTIALS``
353+
environment variables.
354+
355+
The ``SMITHY_PROXY_HOST`` environment variable is a URL:
356+
357+
.. code-block::
358+
359+
SMITHY_PROXY_HOST='http://localhost:8080'
360+
361+
The ``SMITHY_PROXY_CREDENTIALS`` environment variable is a colon-delimited value (``:``) containing both the
362+
username and password to use for authenticating to the proxy configured by the ``SMITHY_PROXY_HOST`` environment
363+
variable:
364+
365+
.. code-block::
366+
367+
SMITHY_PROXY_CREDENTIALS='user:$PROXY_PASSWORD'
368+
327369
328370
.. _projections:
329371

0 commit comments

Comments
 (0)