(
State(ctx): State<S>,
Path(DeleteDatabaseParams { name_or_identity }): Path<DeleteDatabaseParams>,
Extension(auth): Extension<SpacetimeAuth>,
)
| 1368 | } |
| 1369 | |
| 1370 | pub async fn unlock_database<S: ControlStateDelegate + Authorization>( |
| 1371 | State(ctx): State<S>, |
| 1372 | Path(DeleteDatabaseParams { name_or_identity }): Path<DeleteDatabaseParams>, |
| 1373 | Extension(auth): Extension<SpacetimeAuth>, |
| 1374 | ) -> axum::response::Result<impl IntoResponse> { |
| 1375 | let database_identity = name_or_identity.resolve(&ctx).await?; |
| 1376 | let Some(_database) = worker_ctx_find_database(&ctx, &database_identity).await? else { |
| 1377 | return Err(StatusCode::NOT_FOUND.into()); |
| 1378 | }; |
| 1379 | |
| 1380 | ctx.authorize_action(auth.claims.identity, database_identity, Action::DeleteDatabase) |
| 1381 | .await?; |
| 1382 | |
| 1383 | ctx.set_database_lock(&auth.claims.identity, &database_identity, false) |
| 1384 | .await |
| 1385 | .map_err(log_and_500)?; |
| 1386 | |
| 1387 | Ok(()) |
| 1388 | } |
| 1389 | |
| 1390 | #[derive(Deserialize)] |
| 1391 | pub struct AddNameParams { |
nothing calls this directly
no test coverage detected
searching dependent graphs…