diff --git a/site/content/vendir/docs/develop/sync.md b/site/content/vendir/docs/develop/sync.md index 564249b52..7d21d6a9a 100644 --- a/site/content/vendir/docs/develop/sync.md +++ b/site/content/vendir/docs/develop/sync.md @@ -73,3 +73,54 @@ $ export VENDIR_CACHE_DIR=~/.vendir/cache $ export VENDIR_MAX_CACHE_SIZE=1Ki $ vendir sync ``` + +## Sync with HTTP authentication + +For HTTP sources that require authentication, configure the HTTP contents with a `secretRef`. + +Use `username` and `password` keys for basic authentication (Authorization: Basic ): + +```yaml +--- +apiVersion: v1 +kind: Secret +metadata: + name: http-auth +data: + username: dXNlcm5hbWU= + password: cGFzc3dvcmQ= +--- +apiVersion: vendir.k14s.io/v1alpha1 +kind: Config +directories: +- path: stack + contents: + - path: "." + http: + url: https:// + secretRef: + name: http-auth +``` + +Use `token` for Bearer Token authentication (Authorization: Bearer ): + +```yaml +--- +apiVersion: v1 +kind: Secret +metadata: + name: http-auth +data: + token: dG9rZW4= +--- +apiVersion: vendir.k14s.io/v1alpha1 +kind: Config +directories: +- path: stack + contents: + - path: "." + http: + url: https:// + secretRef: + name: http-auth +``` diff --git a/site/content/vendir/docs/v0.46.x/sync.md b/site/content/vendir/docs/v0.46.x/sync.md index fbb5703ef..3591172fc 100644 --- a/site/content/vendir/docs/v0.46.x/sync.md +++ b/site/content/vendir/docs/v0.46.x/sync.md @@ -74,3 +74,54 @@ $ export VENDIR_CACHE_DIR=~/.vendir/cache $ export VENDIR_MAX_CACHE_SIZE=1Ki $ vendir sync ``` + +## Sync with HTTP authentication + +For HTTP sources that require authentication, configure the HTTP contents with a `secretRef`. + +Use `username` and `password` keys for basic authentication (Authorization: Basic ): + +```yaml +--- +apiVersion: v1 +kind: Secret +metadata: + name: http-auth +data: + username: dXNlcm5hbWU= + password: cGFzc3dvcmQ= +--- +apiVersion: vendir.k14s.io/v1alpha1 +kind: Config +directories: +- path: stack + contents: + - path: "." + http: + url: https:// + secretRef: + name: http-auth +``` + +Use `token` for Bearer Token authentication (Authorization: Bearer ): + +```yaml +--- +apiVersion: v1 +kind: Secret +metadata: + name: http-auth +data: + token: dG9rZW4= +--- +apiVersion: vendir.k14s.io/v1alpha1 +kind: Config +directories: +- path: stack + contents: + - path: "." + http: + url: https:// + secretRef: + name: http-auth +```