Skip to content
Open
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
27 changes: 26 additions & 1 deletion trellis/composer-authentication.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
date_modified: 2026-03-10 12:00
date_modified: 2026-03-11 12:00
date_published: 2021-09-06 16:48
description: Set up Composer authentication in Trellis to access private packages, commercial plugins, and authenticated repositories during deployment.
title: Composer Authentication
Expand Down Expand Up @@ -38,6 +38,7 @@ Trellis supports authentication for multiple Composer repositories, via the Ansi
| `gitlab-oauth` | GitLab OAuth token |
| `gitlab-token` | GitLab personal/deploy token |
| `bitbucket-oauth` | Bitbucket OAuth consumer key/secret |
| `custom-headers` | Custom HTTP header authentication |

## HTTP Basic

Expand Down Expand Up @@ -118,6 +119,30 @@ vault_wordpress_sites:
- { type: bitbucket-oauth, hostname: bitbucket.org, consumer_key: my-consumer-key, consumer_secret: my-consumer-secret }
```

## Custom Headers

For private repositories that use custom HTTP headers for authentication:

```yaml
# group_vars/<env>/vault.yml

vault_wordpress_sites:
example.com:
composer_authentications:
- { type: custom-headers, hostname: repo.example.org, headers: ["API-TOKEN: my-api-token"] }
```

Multiple headers can be specified:

```yaml
# group_vars/<env>/vault.yml

vault_wordpress_sites:
example.com:
composer_authentications:
- { type: custom-headers, hostname: repo.example.org, headers: ["API-TOKEN: my-api-token", "X-CUSTOM-HEADER: value"] }
```

## Multiple repositories

Multiple private Composer repositories can be configured together:
Expand Down
Loading