Commit 61584b9
committed
fix(provisioning,api): surface handler failures + always-on loopback-admin middleware
aws_provisioning_adapter._provision_via_handlers now checks
result["success"] before returning. Provider handlers that swallow
exceptions and return {"success": False, "error_message": ...} were
flowing through unchecked: instance_operation_service wrapped the
failure in ProviderResult.success_result, the orchestrator saw
success=True with resource_ids=[], and the request landed on FAILED
with the misleading "No instances provisioned and no cloud resources
created" message instead of the real error. Re-raising as
InfrastructureError lets _handle_provisioning_failure stamp the
actual cause.
api.server now installs _LoopbackAdminTokenMiddleware unconditionally
and calls _load_loopback_token outside the auth-enabled branch. The
loopback-admin token written by the daemon at start
(<work_dir>/server/orb-server.token) is the security model for
intra-host admin operations; it must work even when the primary auth
middleware is disabled, so the CLI reload command and the live REST
tests can authenticate as admin via Authorization: Bearer <token>.
tests/providers/aws/live/test_rest_api_onaws ORBServerManager reads
the same token after the /health probe succeeds and threads it
through to RestApiClient.session.headers as Authorization: Bearer
<token>. Role-guarded routes (POST /machines/request, /machines/return,
admin endpoints) now accept the live REST tests.1 parent c4efa33 commit 61584b9
3 files changed
Lines changed: 100 additions & 3 deletions
File tree
- src/orb
- api
- providers/aws/infrastructure/adapters
- tests/providers/aws/live
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
120 | 155 | | |
121 | 156 | | |
122 | 157 | | |
| |||
225 | 260 | | |
226 | 261 | | |
227 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
228 | 274 | | |
229 | 275 | | |
230 | 276 | | |
231 | 277 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | 278 | | |
236 | 279 | | |
237 | 280 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
181 | 194 | | |
182 | 195 | | |
183 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
186 | 190 | | |
187 | 191 | | |
188 | 192 | | |
| |||
237 | 241 | | |
238 | 242 | | |
239 | 243 | | |
| 244 | + | |
240 | 245 | | |
241 | 246 | | |
242 | 247 | | |
| |||
253 | 258 | | |
254 | 259 | | |
255 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
256 | 289 | | |
257 | 290 | | |
258 | 291 | | |
| |||
299 | 332 | | |
300 | 333 | | |
301 | 334 | | |
| 335 | + | |
302 | 336 | | |
303 | 337 | | |
304 | 338 | | |
305 | 339 | | |
306 | 340 | | |
307 | 341 | | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
308 | 347 | | |
309 | 348 | | |
310 | 349 | | |
| |||
483 | 522 | | |
484 | 523 | | |
485 | 524 | | |
| 525 | + | |
486 | 526 | | |
487 | 527 | | |
488 | 528 | | |
| |||
2239 | 2279 | | |
2240 | 2280 | | |
2241 | 2281 | | |
| 2282 | + | |
2242 | 2283 | | |
2243 | 2284 | | |
2244 | 2285 | | |
| |||
0 commit comments