Skip to content

Commit 978201b

Browse files
committed
fix: route dashboard reads through AWS API
1 parent 632e39e commit 978201b

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

apps/site/lib/asset-api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ export async function fetchAssetThumbnail(
10161016

10171017
const upstream = await controlPlaneFetch(
10181018
auth,
1019-
`/internal/site/assets/${encodeURIComponent(normalizedAssetId)}/thumbnail`,
1019+
`/v1/site/assets/${encodeURIComponent(normalizedAssetId)}/thumbnail`,
10201020
{
10211021
headers: { accept: "image/jpeg,image/*;q=0.8,*/*;q=0.5" },
10221022
}
@@ -1129,7 +1129,7 @@ export async function fetchAssetPlayerTelemetry(
11291129
if (options.playbackSessionId) params.set("playback_session_id", options.playbackSessionId);
11301130
const upstream = await controlPlaneFetch(
11311131
auth,
1132-
`/internal/site/assets/${encodeURIComponent(normalizedAssetId)}/player-events?${params}`
1132+
`/v1/site/assets/${encodeURIComponent(normalizedAssetId)}/player-events?${params}`
11331133
);
11341134
const data = await readUpstreamJson(upstream);
11351135
if (!isRecord(data) || safeAssetId(data.asset_id) !== normalizedAssetId || !Array.isArray(data.events)) {

apps/site/lib/asset-routes.test.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ test("asset thumbnail client streams binary thumbnail responses without playback
152152
);
153153

154154
assert.equal(calls.length, 1);
155-
assert.equal(calls[0].url, "http://127.0.0.1:4000/internal/site/assets/00000000-0000-0000-0000-000000000001/thumbnail");
155+
assert.equal(calls[0].url, "http://127.0.0.1:4000/v1/site/assets/00000000-0000-0000-0000-000000000001/thumbnail");
156156
assert.equal(calls[0].accept, "image/jpeg,image/*;q=0.8,*/*;q=0.5");
157157
assert.equal(response.headers.get("content-type"), "image/jpeg");
158158
assert.equal(response.headers.get("cache-control"), "private, max-age=31536000, immutable");
@@ -168,7 +168,7 @@ test("asset player telemetry client reads durable events and strips invalid rows
168168
await withMockFetch(async (url, init) => {
169169
assert.equal(
170170
String(url),
171-
`http://127.0.0.1:4000/internal/site/assets/${assetId}/player-events?limit=20`
171+
`http://127.0.0.1:4000/v1/site/assets/${assetId}/player-events?limit=20`
172172
);
173173
const headers = new Headers(init?.headers);
174174
assert.equal(headers.get("x-rend-site-token"), "site-internal-token");

services/rend-api/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,7 @@ fn build_app(state: Arc<AppState>, request_timeout: Duration) -> Router {
20862086
.merge(metrics_routes)
20872087
.merge(authenticated_routes)
20882088
.merge(site_player_telemetry_routes)
2089-
.nest("/internal/site", site_internal_routes)
2089+
.nest("/v1/site", site_internal_routes)
20902090
.nest("/internal/edges", edge_routes)
20912091
.nest("/internal/operator", operator_routes)
20922092
.nest("/internal/telemetry", telemetry_routes);

services/rend-api/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ async fn playback_analytics_endpoint_requires_dev_api_key() {
992992
#[tokio::test]
993993
async fn recent_player_events_endpoint_requires_dev_api_key() {
994994
let app = build_app(test_state(), Duration::from_secs(10));
995-
let path = "/internal/site/assets/00000000-0000-0000-0000-000000000001/player-events";
995+
let path = "/v1/site/assets/00000000-0000-0000-0000-000000000001/player-events";
996996

997997
let response = route_response(app.clone(), path, None).await;
998998
assert_eq!(response.status(), StatusCode::UNAUTHORIZED);

0 commit comments

Comments
 (0)