|
1 | 1 | openapi: 3.0.3 |
2 | 2 | info: |
3 | 3 | title: sandboxd /v1 API |
4 | | - version: "0.2.0" |
| 4 | + version: "0.3.0" |
5 | 5 | description: > |
6 | 6 | The public, tenant-scoped API for sandboxd. This is the only surface a |
7 | 7 | console or external integration should use — the internal /sandbox and |
@@ -115,6 +115,89 @@ paths: |
115 | 115 | application/json: |
116 | 116 | schema: { $ref: "#/components/schemas/Error" } |
117 | 117 |
|
| 118 | + /v1/apps/{id}/config: |
| 119 | + parameters: |
| 120 | + - $ref: "#/components/parameters/Id" |
| 121 | + get: |
| 122 | + tags: [apps] |
| 123 | + summary: List an app's config entries (metadata; secret values redacted) |
| 124 | + description: > |
| 125 | + Returns every config key for the app. Sensitive entries never |
| 126 | + include their value (only value_set=true); non-sensitive entries |
| 127 | + include the plaintext value. |
| 128 | + responses: |
| 129 | + "200": |
| 130 | + description: OK |
| 131 | + content: |
| 132 | + application/json: |
| 133 | + schema: |
| 134 | + type: object |
| 135 | + properties: |
| 136 | + config: |
| 137 | + type: array |
| 138 | + items: { $ref: "#/components/schemas/ConfigItem" } |
| 139 | + "404": { $ref: "#/components/responses/Error" } |
| 140 | + post: |
| 141 | + tags: [apps] |
| 142 | + summary: Create a config entry (set sensitive=true to encrypt at rest) |
| 143 | + description: > |
| 144 | + Sensitive values are AES-256-GCM-encrypted at rest and are |
| 145 | + write-only — they are never returned by any GET. access_policy |
| 146 | + governs who may later read the value through the broker; the |
| 147 | + default control_plane_only never leaves sandboxd. |
| 148 | + requestBody: |
| 149 | + required: true |
| 150 | + content: |
| 151 | + application/json: |
| 152 | + schema: { $ref: "#/components/schemas/CreateConfigRequest" } |
| 153 | + responses: |
| 154 | + "201": |
| 155 | + description: Created |
| 156 | + content: |
| 157 | + application/json: |
| 158 | + schema: { $ref: "#/components/schemas/ConfigItem" } |
| 159 | + "400": { $ref: "#/components/responses/Error" } |
| 160 | + "404": { $ref: "#/components/responses/Error" } |
| 161 | + "409": |
| 162 | + description: A config entry with this key already exists; PATCH to update. |
| 163 | + content: |
| 164 | + application/json: |
| 165 | + schema: { $ref: "#/components/schemas/Error" } |
| 166 | + |
| 167 | + /v1/apps/{id}/config/{key}: |
| 168 | + parameters: |
| 169 | + - $ref: "#/components/parameters/Id" |
| 170 | + - in: path |
| 171 | + name: key |
| 172 | + required: true |
| 173 | + schema: { type: string } |
| 174 | + patch: |
| 175 | + tags: [apps] |
| 176 | + summary: Update a config entry (value, sensitivity, or access policy) |
| 177 | + description: > |
| 178 | + Omit value to keep the stored value untouched (a policy-only |
| 179 | + change preserves an existing secret). Toggling sensitive |
| 180 | + re-encodes the stored value. |
| 181 | + requestBody: |
| 182 | + required: true |
| 183 | + content: |
| 184 | + application/json: |
| 185 | + schema: { $ref: "#/components/schemas/PatchConfigRequest" } |
| 186 | + responses: |
| 187 | + "200": |
| 188 | + description: OK |
| 189 | + content: |
| 190 | + application/json: |
| 191 | + schema: { $ref: "#/components/schemas/ConfigItem" } |
| 192 | + "400": { $ref: "#/components/responses/Error" } |
| 193 | + "404": { $ref: "#/components/responses/Error" } |
| 194 | + delete: |
| 195 | + tags: [apps] |
| 196 | + summary: Delete a config entry |
| 197 | + responses: |
| 198 | + "204": { description: Deleted } |
| 199 | + "404": { $ref: "#/components/responses/Error" } |
| 200 | + |
118 | 201 | /v1/sandboxes: |
119 | 202 | post: |
120 | 203 | tags: [sandboxes] |
@@ -429,6 +512,39 @@ components: |
429 | 512 | name: { type: string } |
430 | 513 | description: { type: string } |
431 | 514 | tags: { type: array, items: { type: string } } |
| 515 | + ConfigItem: |
| 516 | + type: object |
| 517 | + properties: |
| 518 | + key: { type: string } |
| 519 | + sensitive: { type: boolean } |
| 520 | + access_policy: |
| 521 | + type: string |
| 522 | + enum: [control_plane_only, agent_access, runtime_access, both] |
| 523 | + value_set: { type: boolean, description: "True when a value is stored." } |
| 524 | + value: |
| 525 | + type: string |
| 526 | + description: "Present only for non-sensitive entries; sensitive values are never returned." |
| 527 | + created_at: { type: string, format: date-time } |
| 528 | + updated_at: { type: string, format: date-time } |
| 529 | + CreateConfigRequest: |
| 530 | + type: object |
| 531 | + required: [key] |
| 532 | + properties: |
| 533 | + key: { type: string } |
| 534 | + value: { type: string } |
| 535 | + sensitive: { type: boolean, default: false } |
| 536 | + access_policy: |
| 537 | + type: string |
| 538 | + enum: [control_plane_only, agent_access, runtime_access, both] |
| 539 | + default: control_plane_only |
| 540 | + PatchConfigRequest: |
| 541 | + type: object |
| 542 | + properties: |
| 543 | + value: { type: string, description: "Omit to keep the stored value unchanged." } |
| 544 | + sensitive: { type: boolean } |
| 545 | + access_policy: |
| 546 | + type: string |
| 547 | + enum: [control_plane_only, agent_access, runtime_access, both] |
432 | 548 | Sandbox: |
433 | 549 | type: object |
434 | 550 | properties: |
|
0 commit comments