Skip to content

Commit 9e7ac89

Browse files
committed
Exclude snapshots/volumes endpoints, merge auth tests into Teams phase
1 parent 08c9bf8 commit 9e7ac89

3 files changed

Lines changed: 11 additions & 218 deletions

File tree

openapi-public.yml

Lines changed: 0 additions & 207 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,79 +1266,6 @@ paths:
12661266
operationId: postSandboxRefreshes
12671267
servers:
12681268
- *id006
1269-
/sandboxes/{sandboxID}/snapshots:
1270-
post:
1271-
description: Create a persistent snapshot from the sandbox's current state.
1272-
Snapshots can be used to create new sandboxes and persist beyond the original
1273-
sandbox's lifetime.
1274-
tags:
1275-
- sandboxes
1276-
security:
1277-
- ApiKeyAuth: []
1278-
parameters:
1279-
- $ref: '#/components/parameters/sandboxID'
1280-
requestBody:
1281-
required: true
1282-
content:
1283-
application/json:
1284-
schema:
1285-
type: object
1286-
properties:
1287-
name:
1288-
type: string
1289-
description: Optional name for the snapshot template. If a snapshot
1290-
template with this name already exists, a new build will be assigned
1291-
to the existing template instead of creating a new one.
1292-
responses:
1293-
'201':
1294-
description: Snapshot created successfully
1295-
content:
1296-
application/json:
1297-
schema:
1298-
$ref: '#/components/schemas/SnapshotInfo'
1299-
'400':
1300-
$ref: '#/components/responses/400'
1301-
'401':
1302-
$ref: '#/components/responses/401'
1303-
'404':
1304-
$ref: '#/components/responses/404'
1305-
'500':
1306-
$ref: '#/components/responses/500'
1307-
operationId: postSandboxSnapshots
1308-
servers:
1309-
- *id006
1310-
/snapshots:
1311-
get:
1312-
description: List all snapshots for the team
1313-
tags:
1314-
- snapshots
1315-
security:
1316-
- ApiKeyAuth: []
1317-
parameters:
1318-
- name: sandboxID
1319-
in: query
1320-
required: false
1321-
schema:
1322-
type: string
1323-
description: Filter snapshots by source sandbox ID
1324-
- $ref: '#/components/parameters/paginationLimit'
1325-
- $ref: '#/components/parameters/paginationNextToken'
1326-
responses:
1327-
'200':
1328-
description: Successfully returned snapshots
1329-
content:
1330-
application/json:
1331-
schema:
1332-
type: array
1333-
items:
1334-
$ref: '#/components/schemas/SnapshotInfo'
1335-
'401':
1336-
$ref: '#/components/responses/401'
1337-
'500':
1338-
$ref: '#/components/responses/500'
1339-
operationId: listSnapshots
1340-
servers:
1341-
- *id006
13421269
/v3/templates:
13431270
post:
13441271
description: Create a new template
@@ -1896,102 +1823,6 @@ paths:
18961823
operationId: getTemplatesAlias
18971824
servers:
18981825
- *id006
1899-
/volumes:
1900-
get:
1901-
description: List all team volumes
1902-
tags:
1903-
- volumes
1904-
security:
1905-
- AccessTokenAuth: []
1906-
- ApiKeyAuth: []
1907-
responses:
1908-
'200':
1909-
description: Successfully listed all team volumes
1910-
content:
1911-
application/json:
1912-
schema:
1913-
type: array
1914-
items:
1915-
$ref: '#/components/schemas/Volume'
1916-
'401':
1917-
$ref: '#/components/responses/401'
1918-
'500':
1919-
$ref: '#/components/responses/500'
1920-
operationId: listVolumes
1921-
post:
1922-
description: Create a new team volume
1923-
tags:
1924-
- volumes
1925-
security:
1926-
- AccessTokenAuth: []
1927-
- ApiKeyAuth: []
1928-
requestBody:
1929-
required: true
1930-
content:
1931-
application/json:
1932-
schema:
1933-
$ref: '#/components/schemas/NewVolume'
1934-
responses:
1935-
'201':
1936-
description: Successfully created a new team volume
1937-
content:
1938-
application/json:
1939-
schema:
1940-
$ref: '#/components/schemas/Volume'
1941-
'400':
1942-
$ref: '#/components/responses/400'
1943-
'401':
1944-
$ref: '#/components/responses/401'
1945-
'500':
1946-
$ref: '#/components/responses/500'
1947-
operationId: postVolumes
1948-
servers:
1949-
- *id006
1950-
/volumes/{volumeID}:
1951-
get:
1952-
description: Get team volume info
1953-
tags:
1954-
- volumes
1955-
security:
1956-
- AccessTokenAuth: []
1957-
- ApiKeyAuth: []
1958-
parameters:
1959-
- $ref: '#/components/parameters/volumeID'
1960-
responses:
1961-
'200':
1962-
description: Successfully retrieved a team volume
1963-
content:
1964-
application/json:
1965-
schema:
1966-
$ref: '#/components/schemas/Volume'
1967-
'401':
1968-
$ref: '#/components/responses/401'
1969-
'404':
1970-
$ref: '#/components/responses/404'
1971-
'500':
1972-
$ref: '#/components/responses/500'
1973-
operationId: getVolume
1974-
delete:
1975-
description: Delete a team volume
1976-
tags:
1977-
- volumes
1978-
security:
1979-
- AccessTokenAuth: []
1980-
- ApiKeyAuth: []
1981-
parameters:
1982-
- $ref: '#/components/parameters/volumeID'
1983-
responses:
1984-
'204':
1985-
description: Successfully deleted a team volume
1986-
'401':
1987-
$ref: '#/components/responses/401'
1988-
'404':
1989-
$ref: '#/components/responses/404'
1990-
'500':
1991-
$ref: '#/components/responses/500'
1992-
operationId: deleteVolume
1993-
servers:
1994-
- *id006
19951826
components:
19961827
securitySchemes:
19971828
AccessTokenAuth:
@@ -3053,23 +2884,6 @@ components:
30532884
enum:
30542885
- running
30552886
- paused
3056-
SnapshotInfo:
3057-
type: object
3058-
required:
3059-
- snapshotID
3060-
- names
3061-
properties:
3062-
snapshotID:
3063-
type: string
3064-
description: Identifier of the snapshot template including the tag. Uses
3065-
namespace/alias when a name was provided (e.g. team-slug/my-snapshot:default),
3066-
otherwise falls back to the raw template ID (e.g. abc123:default).
3067-
names:
3068-
type: array
3069-
items:
3070-
type: string
3071-
description: Full names of the snapshot template including team namespace
3072-
and tag (e.g. team-slug/my-snapshot:v2)
30732887
Mcp:
30742888
type: object
30752889
description: MCP configuration for the sandbox
@@ -4133,27 +3947,6 @@ components:
41333947
items:
41343948
type: string
41353949
type: object
4136-
Volume:
4137-
type: object
4138-
properties:
4139-
volumeID:
4140-
type: string
4141-
description: ID of the volume
4142-
name:
4143-
type: string
4144-
description: Name of the volume
4145-
required:
4146-
- volumeID
4147-
- name
4148-
NewVolume:
4149-
type: object
4150-
properties:
4151-
name:
4152-
type: string
4153-
description: Name of the volume
4154-
pattern: ^[a-zA-Z0-9_-]+$
4155-
required:
4156-
- name
41573950
tags:
41583951
- name: files
41593952
- name: filesystem.Filesystem

scripts/generate_openapi_reference.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,9 @@ def filter_paths(spec: dict[str, Any]) -> None:
10561056
- Removes Supabase and AdminToken securityScheme definitions
10571057
"""
10581058
# Remove excluded paths
1059-
excluded_prefixes = ("/access-tokens", "/api-keys")
1060-
excluded_exact = {"/v2/sandboxes/{sandboxID}/logs", "/init"}
1059+
excluded_prefixes = ("/access-tokens", "/api-keys", "/volumes", "/snapshots")
1060+
excluded_exact = {"/v2/sandboxes/{sandboxID}/logs", "/init",
1061+
"/sandboxes/{sandboxID}/snapshots"}
10611062
to_remove = [
10621063
p for p in spec["paths"]
10631064
if p.startswith(excluded_prefixes) or p in excluded_exact
@@ -1071,7 +1072,7 @@ def filter_paths(spec: dict[str, Any]) -> None:
10711072
for path in to_remove:
10721073
del spec["paths"][path]
10731074
if to_remove:
1074-
print(f"==> Removed {len(to_remove)} paths (volumes + admin)")
1075+
print(f"==> Removed {len(to_remove)} paths (volumes, snapshots, admin, internal)")
10751076

10761077
# Strip supabase security entries from all operations
10771078
for path_item in spec["paths"].values():

scripts/validate_api_reference.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -844,12 +844,15 @@ def _collect_refs(node, refs: set):
844844

845845
def run_phase_1_teams(api_key: str, team_id: str | None, spec: dict,
846846
access_token: str | None = None) -> list[EndpointResult]:
847-
"""Phase 1: Platform — Teams."""
847+
"""Phase 1: Platform — Teams (auth checks + teams read)."""
848848
results = []
849849
h = api_key_hdr(api_key)
850850

851+
# Auth tests: 401 for all endpoints without API key
852+
results.extend(run_auth_tests(api_key))
853+
851854
# GET /teams (requires AccessTokenAuth — Bearer token, not ApiKeyAuth)
852-
print("\n Phase 1: Platform — Teams")
855+
print("\n Teams")
853856
print(" GET /teams")
854857
ep = EndpointResult("GET", "/teams", surface="platform")
855858
if access_token:
@@ -2139,7 +2142,7 @@ def run_auth_tests(api_key: str) -> list[EndpointResult]:
21392142
"""Test 401 for all control plane endpoints without auth."""
21402143
results = []
21412144

2142-
print("\n Auth Tests: 401 for control plane without API key")
2145+
print("\n 401 checks (no API key)")
21432146

21442147
endpoints = [
21452148
("GET", "/sandboxes", None),
@@ -2428,11 +2431,7 @@ def should_run(phase: int) -> bool:
24282431
return phase_filter is None or phase_filter == phase
24292432

24302433
try:
2431-
# Auth tests (always run)
2432-
if should_run(0):
2433-
all_results.extend(run_auth_tests(api_key))
2434-
2435-
# Phase 1: Teams
2434+
# Phase 1: Teams (includes 401 auth checks)
24362435
if should_run(1):
24372436
all_results.extend(run_phase_1_teams(api_key, team_id, spec, access_token=access_token))
24382437

0 commit comments

Comments
 (0)