You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 83f7460
Browse filesBrowse the repository at this point in the historyBrowse files
feat: add data.credentials support to Buildpack and CNB lifecycles
Makes credential handling consistent across lifecycles by introducing
data.credentials for both buildpack and CNB lifecycle types, stored
encrypted in the buildpack_lifecycle_data table.
- New migration adds encrypted_credentials_json / _salt columns to
buildpack_lifecycle_data (previously CNB-only via cnb_lifecycle_data)
- BuildpackLifecycleDataModel gains credentials accessors backed by
set_field_as_encrypted; to_hash redacts the value
- AppBaseLifecycle#update_lifecycle_data_model persists requested lifecycle
fields (including credentials, honoring an explicit null to clear); staging
reads credentials via LifecycleBase#credentials_for_staging
- Buildpack lifecycle injects credentials into the custom buildpack URL for
both the url and key fields, so the staging git clone (driven by key via
-buildpackOrder) authenticates; CNB does not inject into the URL and relies
solely on CNB_REGISTRY_CREDS
- Validators enforce XOR between URL-embedded credentials and data.credentials,
with a clearer message when the conflicting credentials are already stored
- Manifest: unified top-level credentials key for both lifecycles, with
cnb-credentials kept as a backward-compatible alias; specifying both is a
validation error; an explicit null clears stored credentials
- Redaction: audit events, the app manifest output, and the manifest diff all
mask credentials and buildpack-URL userinfo (singular and plural keys)
- url_has_userinfo? detects password-only userinfo (:token@host)
- Docs: document data.credentials for both lifecycles and the manifest
credentials / cnb-credentials keys
Copy file name to clipboardExpand all lines: docs/v3/source/includes/concepts/_lifecycles.md.erb
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@ Name | Type | Description
41
41
**type** | _string_ | `buildpack`
42
42
**data.buildpacks** | _list of strings_ | A list of the names of buildpacks, URLs from which they may be downloaded, or `null` to auto-detect a suitable buildpack during staging
43
43
**data.stack** | _string_ | The root filesystem to use with the buildpack, for example `cflinuxfs4`
44
+
**data.credentials** | _object_ | Credentials used to download custom buildpacks from private git repositories, keyed by host. Each entry is a username/password pair. If any buildpack URL embeds credentials, **data.credentials** must be empty; provide credentials in one place only.
44
45
45
46
For records whose historical lifecycle data is no longer available,
46
47
**data.buildpacks** may be an empty list and **data.stack** may be `null`.
@@ -83,7 +84,7 @@ Name | Type | Description
83
84
---- | ---- | -----------
84
85
**type** | _string_ | `cnb`
85
86
**data.buildpacks** | _list of strings_ | A list of URLs with either `docker://` or `http(s)://` scheme, pointing to the Cloud Native Buildpack OCI image. <br/>When the scheme is `http(s)://`, an OCI tarball is expected to be present at the specified location.
86
-
**data.credentials** | _object_ | Credentials used to download the configured buildpacks. This can either contain username/password or a token.
87
+
**data.credentials** | _object_ | Credentials used to download the configured buildpacks, keyed by registry host. Each entry contains either a username/password pair or a token. CNB buildpack URLs must not embed credentials; use **data.credentials** instead.
87
88
**data.stack** | _string_ | The root filesystem to use with the buildpack, for example `cflinuxfs4`
88
89
89
90
For records whose historical lifecycle data is no longer available,
Copy file name to clipboardExpand all lines: docs/v3/source/includes/resources/manifests/_object.md.erb
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,8 @@ Name | Type | Description
105
105
**name** | _string_ | Name of the app
106
106
**lifecycle** | _string_ | Type of the lifecycle; valid values are `buildpack`, `cnb`, `docker`. Defaults to `buildpack`, unless the **docker** property is present.
107
107
**buildpacks** | _list of strings_ | a) An empty array, which will automatically select the appropriate default buildpack according to the coding language (incompatible with **lifecycle: cnb**) <br>b) An array of one or more URLs pointing to buildpacks <br>c) An array of one or more installed buildpack names <br>Replaces the legacy `buildpack` field
108
+
**credentials** | _object_ | Credentials used to download custom buildpacks (buildpack lifecycle) or buildpack OCI images (cnb lifecycle) from private git repositories or registries, keyed by host. For the buildpack lifecycle each entry is a username/password pair; for the cnb lifecycle each entry is a username/password pair or a token. Set to `null` to clear previously stored credentials. If any buildpack URL embeds credentials, **credentials** must be empty; provide credentials in one place only.
109
+
**cnb-credentials** | _object_ | Backward-compatible alias for **credentials**. Specifying both **credentials** and **cnb-credentials** is an error.
108
110
**docker** | _object_ | If present, the created app will have Docker lifecycle type; the value of this key is ignored by the API but may be used by clients to source the registry address of the image and credentials, if needed; the [generate manifest endpoint](#generate-a-manifest-for-an-app) will return the registry address of the image and username provided with this key
109
111
**env** | _object_ | A key-value mapping of environment variables to be used for the app when running
110
112
**features** | _object_ | A key-value mapping of feature names to booleans (true = enabled, false = disabled)
0 commit comments