-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check authorization when attempting to delete a database
- Loading branch information
Showing
2 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
if [ "$DESCRIBE_TEST" = 1 ] ; then | ||
echo "This test checks to make sure that you cannot delete a database that you do not own." | ||
exit | ||
fi | ||
|
||
set -euox pipefail | ||
|
||
source "./test/lib.include" | ||
|
||
run_test cargo run identity new --no-email | ||
IDENT=$(grep IDENTITY "$TEST_OUT" | awk '{print $2}') | ||
run_test cargo run identity set-default "$IDENT" | ||
run_test cargo run publish -s -d --project-path="$PROJECT_PATH" --clear-database | ||
ADDRESS="$(grep "reated new database" "$TEST_OUT" | awk 'NF>1{print $NF}')" | ||
|
||
reset_config | ||
if cargo run delete "$ADDRESS"; then exit 1; fi |