Skip to content

Commit 0276f5d

Browse files
authored
Document local blobstore endpoints as not routed in BOSH deployments (#5658)
* Adopt docs * Make description for local blobstore and dev more clear
1 parent 9e087b0 commit 0276f5d

1 file changed

Lines changed: 46 additions & 39 deletions

File tree

‎docs/internal/README.md‎

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ In capi-release, nginx (`jobs/cloud_controller_ng/templates/nginx.conf.erb`) fro
1313
| Listener | Property (default) | Auth | Serves |
1414
|----------|--------------------|------|--------|
1515
| mTLS internal | `cc.tls_port` (9023) | mTLS (`ssl_verify_client on`) | `/internal/v4/`, `/internal/v5/`, staging completion + upload regexes |
16-
| Public TLS | `cc.public_tls.port` (9024) | in-app (OAuth) / staging basic auth | All public API routes; `/internal/v...` is 403'd here |
17-
| Public non-TLS | `cc.external_port` (9022) | in-app (OAuth) / staging basic auth | Same route set as the public TLS listener |
16+
| Public TLS | `cc.public_tls.port` (9024) | in-app (OAuth) | All public API routes; `/internal/v...` is 403'd here |
17+
| Public non-TLS | `cc.external_port` (9022) | in-app (OAuth) | Same route set as the public TLS listener |
1818
| Metrics mTLS | `cc.prom_metrics_server_tls_port` (9025) | mTLS (separate cert) | `/internal/v4/metrics` only |
1919
| Status | `9021` (hardcoded) | none (loopback) | `/internal/v4/status` health check only |
2020

@@ -24,7 +24,6 @@ Auth mechanisms below:
2424

2525
- **mTLS** — Served on the mTLS internal listener (or the metrics listener for `/internal/v4/metrics`). An `/internal/*` path does not by itself imply mTLS — `ssh_access` is OAuth on the public listener, and `log_access` is mTLS **plus** an in-app OAuth check.
2626
- **OAuth** — CC validates the UAA token's scope in-app; served on the public listeners.
27-
- **Staging basic auth** — Enforced in-app by a Sinatra `before '/staging/*'` filter; served on the public listeners. Only works with a **local blobstore** (dev config) — production uses `storage-cli`, where Diego fetches a direct URL and nginx 403s `/staging/*`.
2827

2928
## Endpoints
3029

@@ -46,42 +45,6 @@ Auth mechanisms below:
4645

4746
**Routing:** Public listeners (`cc.public_tls.port` 9024; also `cc.external_port` 9022). The path `/internal/apps/...` does not match the public listener's `/internal/v` forbid rule, so it is proxied to CC and authenticated in-app.
4847

49-
### GET /v2/buildpacks/:guid/download
50-
**Description:** Download a buildpack file. Note: this is a `/v2` public-namespace path (served on the public listener), not an `/internal/*` endpoint — its `download` action is exempt from user OAuth and gated by staging basic auth instead.
51-
52-
**Intended Consumer:** Diego staging task (local blobstore; remote blobstores get a direct signed URL and bypass this endpoint)
53-
54-
**Auth Mechanism:** Staging basic auth
55-
56-
**Routing:** Public listeners (`cc.public_tls.port` 9024; also `cc.external_port` 9022)
57-
58-
### GET /staging/packages/:guid
59-
**Description:** Download a package if the blobstore is local (see "Staging basic auth" above)
60-
61-
**Intended Consumer:** Diego staging task
62-
63-
**Auth Mechanism:** Staging basic auth
64-
65-
**Routing:** Public listeners (`cc.public_tls.port` 9024; also `cc.external_port` 9022)
66-
67-
### GET /staging/v3/droplets/:guid/download
68-
**Description:** Download a droplet if the blobstore is local (see "Staging basic auth" above)
69-
70-
**Intended Consumer:** Diego running task or process
71-
72-
**Auth Mechanism:** Staging basic auth
73-
74-
**Routing:** Public listeners (`cc.public_tls.port` 9024; also `cc.external_port` 9022)
75-
76-
### GET /staging/v3/buildpack_cache/:stack/:app_guid/download
77-
**Description:** Download buildpack cache for a given stack and app combination if the blobstore is local (see "Staging basic auth" above)
78-
79-
**Intended Consumer:** Diego staging task
80-
81-
**Auth Mechanism:** Staging basic auth
82-
83-
**Routing:** Public listeners (`cc.public_tls.port` 9024; also `cc.external_port` 9022)
84-
8548
### GET /internal/v4/droplets/:guid/:droplet_checksum/download
8649
**Description:** Permalink for downloading a droplet.
8750

@@ -202,3 +165,47 @@ These endpoints are deprecated and have no known live consumer. They are removal
202165
**Auth Mechanism:** None enforced at the nginx layer — this is the plain-HTTP (non-mTLS) branch of the droplet URL generator (built with `external_port`). Contrast the v4 permalink, which is the HTTPS/mTLS path.
203166

204167
**Routing:** No nginx listener serves this path (public listeners 403 `/internal/v`; mTLS listener has no matching location). Reachable only by bypassing nginx and hitting the CC app socket directly.
168+
169+
## Endpoints for local dev
170+
171+
These endpoints are only used when CC is configured with `blobstore_type: local` or `local-temp-storage`, i.e. local development setups. They are **not routed in BOSH deployments**: capi-release does not emit a `location /staging/` nginx routing block, so `/staging/*` paths return 404 from the nginx catch-all. In any standard BOSH deployment, `storage-cli` is used and Diego fetches blobs via signed URLs directly from the blobstore, never calling these endpoints.
172+
173+
### Auth: Staging basic auth
174+
175+
Enforced in-app by a Sinatra `before '/staging/*'` filter on the public listeners. The credentials are configured via `staging.auth.user` / `staging.auth.password` in the CC config (populated from `cc.staging_upload_user` / `cc.staging_upload_password` BOSH properties in local dev). In BOSH deployments, capi-release no longer renders these properties and the endpoints are not nginx-routed.
176+
177+
### GET /v2/buildpacks/:guid/download
178+
**Description:** Download a buildpack file. This is a `/v2` public-namespace path, its `download` action is exempt from user OAuth and gated by staging basic auth instead.
179+
180+
**Intended Consumer:** Diego staging task (local blobstore only; with `storage-cli` Diego receives a signed URL and bypasses this endpoint)
181+
182+
**Auth Mechanism:** Staging basic auth
183+
184+
**Routing:** Public listeners (`cc.public_tls.port` 9024; also `cc.external_port` 9022) via `location /v2/` (when `cc.temporary_enable_v2` is true). Not called in BOSH deployments.
185+
186+
### GET /staging/packages/:guid
187+
**Description:** Download a package from the local blobstore.
188+
189+
**Intended Consumer:** Diego staging task
190+
191+
**Auth Mechanism:** Staging basic auth
192+
193+
**Routing:** Not routed in BOSH deployments, no `location /staging/` nginx block; returns 404 from the catch-all.
194+
195+
### GET /staging/v3/droplets/:guid/download
196+
**Description:** Download a droplet from the local blobstore.
197+
198+
**Intended Consumer:** Diego running task or process
199+
200+
**Auth Mechanism:** Staging basic auth
201+
202+
**Routing:** Not routed in BOSH deployments, no `location /staging/` nginx block; returns 404 from the catch-all.
203+
204+
### GET /staging/v3/buildpack_cache/:stack/:app_guid/download
205+
**Description:** Download buildpack cache for a given stack and app combination from the local blobstore.
206+
207+
**Intended Consumer:** Diego staging task
208+
209+
**Auth Mechanism:** Staging basic auth
210+
211+
**Routing:** Not routed in BOSH deployments, no `location /staging/` nginx block; returns 404 from the catch-all.

0 commit comments

Comments
 (0)