MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / backup_database_readonly_denied

Function backup_database_readonly_denied

nodedb/tests/auth_admin_ddl_gating.rs:362–372  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

360
361#[tokio::test]
362async fn backup_database_readonly_denied() {
363 let state = make_state_with_catalog();
364 let foo_id = setup_foo_db(&state).await;
365 let ro = readonly_user();
366 let err = ddl_err(&state, &ro, "BACKUP DATABASE foo TO 's3://x'").await;
367 assert!(
368 err.contains("42501") || err.contains("permission denied"),
369 "expected 42501/permission denied, got: {err}"
370 );
371 assert_audit_has(&state, AuditEvent::PermissionDenied, Some(foo_id));
372}
373
374// ─── RESTORE DATABASE ────────────────────────────────────────────────────────
375

Callers

nothing calls this directly

Calls 5

make_state_with_catalogFunction · 0.85
setup_foo_dbFunction · 0.85
readonly_userFunction · 0.85
ddl_errFunction · 0.85
assert_audit_hasFunction · 0.85

Tested by

no test coverage detected