diff options
author | Richard Maw <richard.maw@gmail.com> | 2016-11-05 15:01:37 +0000 |
---|---|---|
committer | Richard Maw <richard.maw@gmail.com> | 2016-11-05 15:03:36 +0000 |
commit | ce7defb7534e3f17853b369db6b1225cbd9cf7f9 (patch) | |
tree | a1bf02b5883ea3da508782331f92a6e58d95906d /testing/02-commands-destroy.yarn | |
parent | 232850b9035ce258f747f97694f0cf68648ec54e (diff) | |
download | gitano-ce7defb7534e3f17853b369db6b1225cbd9cf7f9.tar.gz |
testing: Check delete token expiry
Diffstat (limited to 'testing/02-commands-destroy.yarn')
-rw-r--r-- | testing/02-commands-destroy.yarn | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/02-commands-destroy.yarn b/testing/02-commands-destroy.yarn index bbb71f7..8af9772 100644 --- a/testing/02-commands-destroy.yarn +++ b/testing/02-commands-destroy.yarn @@ -30,3 +30,22 @@ Repositories writable by the user can be destroyed by the user. WHEN alice main runs destroy personal/alice/testrepo --force AND alice main runs ls THEN stdout does not contain personal/alice/testrepo + +Use of `--force` is dangerous as the user has no way of knowing +whether another user pushed to the repository since they last used it. + +If not passed then the first time a destroy is attempted it provides a token, +which will do the delete if the token is still valid when passed to destroy. + + WHEN alice main runs create personal/alice/testrepo + AND alice main runs ls + THEN stdout contains personal/alice/testrepo + WHEN alice main runs destroy personal/alice/testrepo + THEN stderr contains re-run your command with the following confirmation token + GIVEN the token is saved as delete + WHEN testinstance adminkey runs config personal/alice/testrepo set project.description Foo + AND alice using main, expecting failure, destroys personal/alice/testrepo using the delete token + THEN stderr contains ERROR: Confirmation token does not match, refusing to destroy + +This is to prevent deleting a repository that someone has just pushed to +and losing their changes. |