diff --git a/CHANGELOG.md b/CHANGELOG.md index f5734dca..1f52a696 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## {{Next Version}} + +### Misc + +- Rename `killperson` command to `removeperson` (#684) + ## 0.4.0 ### Bugfixes diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 325667b2..3370e09c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,28 +78,24 @@ lean heavily on git and widely-used Unix command features instead of re-implemen ### Development Process -1. Firstly, you should setup git-secret's development git hooks with `make install-hooks` -This will copy the hooks from utils/hooks into .git/hooks/pre-commit and .git/hooks/post-commit +1. Make changes to the git secret files that need to be changed -2. Make changes to the git secret files that need to be changed +2. When making changes to any files inside `src/`, for changes to take effect you will need to rebuild the `git-secret` script with `make clean && make build` -3. When making changes to any files inside `src/`, for changes to take effect you will need to rebuild the `git-secret` script with `make clean && make build` - -4. Run `shellcheck` against all your changes with `make lint`. +3. Run `shellcheck` against all your changes with `make lint`. You should also check your changes for spelling errors using 'aspell -c filename'. -5. Add an entry to CHANGELOG.md, referring to the related issue # if appropriate +4. Add an entry to CHANGELOG.md, referring to the related issue # if appropriate -6. Change the `man` source file(s) (we write them in markdown) in `man/man1` and `man/man7` to document your changes if appropriate +5. Change the `man` source file(s) (we write them in markdown) in `man/man1` and `man/man7` to document your changes if appropriate -7. Now, add all your files to the commit with `git add --all` and commit changes with `git commit`. +6. Now, add all your files to the commit with `git add --all` and commit changes with `git commit`. Write a good commit message which explains your work -8. When running `git commit` the tests will run automatically, your commit will be canceled if they fail. +7. When running `git commit` the tests will run automatically, your commit will be canceled if they fail. You can run the tests manually with `make clean build test`. - If you want to make a commit and not run the pre- and post-commit hooks, use 'git commit -n' -9. Push to your repository, and make a pull-request against `master` branch. It's ideal to have one commit per pull-request, +8. Push to your repository, and make a pull-request against `master` branch. It's ideal to have one commit per pull-request, but don't worry, it's easy to `squash` PRs into a small number of commits when they're merged. ### Branches diff --git a/README.md b/README.md index d9b78129..e721956b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ allowing users you trust to access encrypted data using pgp and their secret key With `git-secret`, changes to access rights are simplified, and private-public key issues are handled for you. When someone's permission is revoked, secrets do not need to be changed with `git-secret` - -just remove their key from the keychain using `git secret killperson their@email.com`, +just remove their key from the keychain using `git secret removeperson their@email.com`, re-encrypt the files, and they won't be able to decrypt secrets anymore. If you think the user might have copied the secrets or keys when they had access, then you should also change the secrets. diff --git a/man/man1/git-secret-add.1 b/man/man1/git-secret-add.1 index 103acb75..ee526fbe 100644 --- a/man/man1/git-secret-add.1 +++ b/man/man1/git-secret-add.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-ADD" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-ADD" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-add\fR \- starts to track added files\. diff --git a/man/man1/git-secret-cat.1 b/man/man1/git-secret-cat.1 index bff32cd5..8f62723f 100644 --- a/man/man1/git-secret-cat.1 +++ b/man/man1/git-secret-cat.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-CAT" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-CAT" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-cat\fR \- decrypts files passed on command line to stdout diff --git a/man/man1/git-secret-changes.1 b/man/man1/git-secret-changes.1 index 357c5dc0..a2bff3aa 100644 --- a/man/man1/git-secret-changes.1 +++ b/man/man1/git-secret-changes.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-CHANGES" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-CHANGES" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-changes\fR \- view diff of the hidden files\. diff --git a/man/man1/git-secret-clean.1 b/man/man1/git-secret-clean.1 index 4602cb7e..d6417a50 100644 --- a/man/man1/git-secret-clean.1 +++ b/man/man1/git-secret-clean.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-CLEAN" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-CLEAN" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-clean\fR \- removes all the hidden files\. @@ -33,4 +33,4 @@ You can also enable verbosity using the SECRETS_VERBOSE environment variable, as Run \fBman git\-secret\-clean\fR to see this note\. . .SH "SEE ALSO" -git\-secret\-whoknows(1) \fIhttp://git\-secret\.io/git\-secret\-whoknows\fR, git\-secret\-add(1) \fIhttp://git\-secret\.io/git\-secret\-add\fR, git\-secret\-remove(1) \fIhttp://git\-secret\.io/git\-secret\-remove\fR, git\-secret\-killperson(1) \fIhttp://git\-secret\.io/git\-secret\-killperson\fR +git\-secret\-whoknows(1) \fIhttp://git\-secret\.io/git\-secret\-whoknows\fR, git\-secret\-add(1) \fIhttp://git\-secret\.io/git\-secret\-add\fR, git\-secret\-remove(1) \fIhttp://git\-secret\.io/git\-secret\-remove\fR, git\-secret\-removeperson(1) \fIhttp://git\-secret\.io/git\-secret\-removeperson\fR diff --git a/man/man1/git-secret-clean.1.md b/man/man1/git-secret-clean.1.md index 980d5100..cc1cb112 100644 --- a/man/man1/git-secret-clean.1.md +++ b/man/man1/git-secret-clean.1.md @@ -27,4 +27,4 @@ Run `man git-secret-clean` to see this note. ## SEE ALSO [git-secret-whoknows(1)](http://git-secret.io/git-secret-whoknows), [git-secret-add(1)](http://git-secret.io/git-secret-add), -[git-secret-remove(1)](http://git-secret.io/git-secret-remove), [git-secret-killperson(1)](http://git-secret.io/git-secret-killperson) +[git-secret-remove(1)](http://git-secret.io/git-secret-remove), [git-secret-removeperson(1)](http://git-secret.io/git-secret-removeperson) diff --git a/man/man1/git-secret-hide.1 b/man/man1/git-secret-hide.1 index 6084dae4..34394d5c 100644 --- a/man/man1/git-secret-hide.1 +++ b/man/man1/git-secret-hide.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-HIDE" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-HIDE" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-hide\fR \- encrypts all added files with the inner keyring\. diff --git a/man/man1/git-secret-init.1 b/man/man1/git-secret-init.1 index 313c1125..6bf754e2 100644 --- a/man/man1/git-secret-init.1 +++ b/man/man1/git-secret-init.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-INIT" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-INIT" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-init\fR \- initializes git\-secret repository\. diff --git a/man/man1/git-secret-list.1 b/man/man1/git-secret-list.1 index 594ba48e..60c86e61 100644 --- a/man/man1/git-secret-list.1 +++ b/man/man1/git-secret-list.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-LIST" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-LIST" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-list\fR \- prints all the added files\. diff --git a/man/man1/git-secret-remove.1 b/man/man1/git-secret-remove.1 index 38b3fe88..bb41a764 100644 --- a/man/man1/git-secret-remove.1 +++ b/man/man1/git-secret-remove.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-REMOVE" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-REMOVE" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-remove\fR \- removes files from index\. @@ -33,4 +33,4 @@ git secret remove [\-c] \.\.\. Run \fBman git\-secret\-remove\fR to see this note\. . .SH "SEE ALSO" -git\-secret\-add(1) \fIhttp://git\-secret\.io/git\-secret\-add\fR, git\-secret\-clean(1) \fIhttp://git\-secret\.io/git\-secret\-clean\fR, git\-secret\-killperson(1) \fIhttp://git\-secret\.io/git\-secret\-killperson\fR +git\-secret\-add(1) \fIhttp://git\-secret\.io/git\-secret\-add\fR, git\-secret\-clean(1) \fIhttp://git\-secret\.io/git\-secret\-clean\fR, git\-secret\-removeperson(1) \fIhttp://git\-secret\.io/git\-secret\-removeperson\fR diff --git a/man/man1/git-secret-remove.1.md b/man/man1/git-secret-remove.1.md index 6b28c7fb..2db061a2 100644 --- a/man/man1/git-secret-remove.1.md +++ b/man/man1/git-secret-remove.1.md @@ -29,4 +29,4 @@ Run `man git-secret-remove` to see this note. ## SEE ALSO [git-secret-add(1)](http://git-secret.io/git-secret-add), [git-secret-clean(1)](http://git-secret.io/git-secret-clean), -[git-secret-killperson(1)](http://git-secret.io/git-secret-killperson) +[git-secret-removeperson(1)](http://git-secret.io/git-secret-removeperson) diff --git a/man/man1/git-secret-killperson.1 b/man/man1/git-secret-removeperson.1 similarity index 56% rename from man/man1/git-secret-killperson.1 rename to man/man1/git-secret-removeperson.1 index 977fa5c9..9a641f00 100644 --- a/man/man1/git-secret-killperson.1 +++ b/man/man1/git-secret-removeperson.1 @@ -1,21 +1,21 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-KILLPERSON" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-REMOVEPERSON" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" -\fBgit\-secret\-killperson\fR \- deletes key identified by an email from the inner keyring\. +\fBgit\-secret\-removeperson\fR \- deletes key identified by an email from the inner keyring\. . .SH "SYNOPSIS" . .nf -git secret killperson \.\.\. +git secret removeperson \.\.\. . .fi . .SH "DESCRIPTION" -This command removes the keys associated with the selected email addresses from the keyring\. If you remove a keypair\'s access with \fBgit\-secret\-killperson\fR, and run \fBgit\-secret\-reveal\fR and \fBgit\-secret\-hide \-r\fR, it will be impossible for given users to decrypt the hidden files\. +This command removes the keys associated with the selected email addresses from the keyring\. If you remove a keypair\'s access with \fBgit\-secret\-removeperson\fR, and run \fBgit\-secret\-reveal\fR and \fBgit\-secret\-hide \-r\fR, it will be impossible for given users to decrypt the hidden files\. . .SH "OPTIONS" . @@ -26,7 +26,7 @@ This command removes the keys associated with the selected email addresses from .fi . .SH "MANUAL" -Run \fBman git\-secret\-killperson\fR to see this note\. +Run \fBman git\-secret\-removeperson\fR to see this note\. . .SH "SEE ALSO" git\-secret\-tell(1) \fIhttp://git\-secret\.io/git\-secret\-tell\fR, git\-secret\-remove(1) \fIhttp://git\-secret\.io/git\-secret\-remove\fR, git\-secret\-clean(1) \fIhttp://git\-secret\.io/git\-secret\-clean\fR diff --git a/man/man1/git-secret-killperson.1.md b/man/man1/git-secret-removeperson.1.md similarity index 64% rename from man/man1/git-secret-killperson.1.md rename to man/man1/git-secret-removeperson.1.md index a602d2dc..dda163c1 100644 --- a/man/man1/git-secret-killperson.1.md +++ b/man/man1/git-secret-removeperson.1.md @@ -1,14 +1,14 @@ -git-secret-killperson - deletes key identified by an email from the inner keyring. +git-secret-removeperson - deletes key identified by an email from the inner keyring. ================================================================================== ## SYNOPSIS - git secret killperson ... + git secret removeperson ... ## DESCRIPTION This command removes the keys associated with the selected email addresses from the keyring. -If you remove a keypair's access with `git-secret-killperson`, and run `git-secret-reveal` and `git-secret-hide -r`, +If you remove a keypair's access with `git-secret-removeperson`, and run `git-secret-reveal` and `git-secret-hide -r`, it will be impossible for given users to decrypt the hidden files. @@ -19,7 +19,7 @@ it will be impossible for given users to decrypt the hidden files. ## MANUAL -Run `man git-secret-killperson` to see this note. +Run `man git-secret-removeperson` to see this note. ## SEE ALSO diff --git a/man/man1/git-secret-reveal.1 b/man/man1/git-secret-reveal.1 index 3b283a26..c2c97aae 100644 --- a/man/man1/git-secret-reveal.1 +++ b/man/man1/git-secret-reveal.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-REVEAL" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-REVEAL" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-reveal\fR \- decrypts all added files\. diff --git a/man/man1/git-secret-tell.1 b/man/man1/git-secret-tell.1 index 5129876f..4e353f6b 100644 --- a/man/man1/git-secret-tell.1 +++ b/man/man1/git-secret-tell.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-TELL" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-TELL" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-tell\fR \- adds a person, who can access private data\. @@ -40,4 +40,4 @@ Versions of \fBgit\-secret tell\fR after 0\.3\.2 will warn about keys that are e Run \fBman git\-secret\-tell\fR to see this note\. . .SH "SEE ALSO" -git\-secret\-init(1) \fIhttp://git\-secret\.io/git\-secret\-init\fR, git\-secret\-add(1) \fIhttp://git\-secret\.io/git\-secret\-add\fR, git\-secret\-hide(1) \fIhttp://git\-secret\.io/git\-secret\-hide\fR, git\-secret\-reveal(1) \fIhttp://git\-secret\.io/git\-secret\-reveal\fR, git\-secret\-cat(1) \fIhttp://git\-secret\.io/git\-secret\-cat\fR, git\-secret\-killperson(1) \fIhttp://git\-secret\.io/git\-secret\-killperson\fR +git\-secret\-init(1) \fIhttp://git\-secret\.io/git\-secret\-init\fR, git\-secret\-add(1) \fIhttp://git\-secret\.io/git\-secret\-add\fR, git\-secret\-hide(1) \fIhttp://git\-secret\.io/git\-secret\-hide\fR, git\-secret\-reveal(1) \fIhttp://git\-secret\.io/git\-secret\-reveal\fR, git\-secret\-cat(1) \fIhttp://git\-secret\.io/git\-secret\-cat\fR, git\-secret\-removeperson(1) \fIhttp://git\-secret\.io/git\-secret\-removeperson\fR diff --git a/man/man1/git-secret-tell.1.md b/man/man1/git-secret-tell.1.md index 45a106e7..d833fa5c 100644 --- a/man/man1/git-secret-tell.1.md +++ b/man/man1/git-secret-tell.1.md @@ -38,4 +38,4 @@ Run `man git-secret-tell` to see this note. [git-secret-init(1)](http://git-secret.io/git-secret-init), [git-secret-add(1)](http://git-secret.io/git-secret-add), [git-secret-hide(1)](http://git-secret.io/git-secret-hide), [git-secret-reveal(1)](http://git-secret.io/git-secret-reveal), -[git-secret-cat(1)](http://git-secret.io/git-secret-cat), [git-secret-killperson(1)](http://git-secret.io/git-secret-killperson) +[git-secret-cat(1)](http://git-secret.io/git-secret-cat), [git-secret-removeperson(1)](http://git-secret.io/git-secret-removeperson) diff --git a/man/man1/git-secret-usage.1 b/man/man1/git-secret-usage.1 index 9f4f2071..cd25b6a8 100644 --- a/man/man1/git-secret-usage.1 +++ b/man/man1/git-secret-usage.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-USAGE" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-USAGE" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-usage\fR \- prints all the available commands\. diff --git a/man/man1/git-secret-whoknows.1 b/man/man1/git-secret-whoknows.1 index 405db3f6..a02e6714 100644 --- a/man/man1/git-secret-whoknows.1 +++ b/man/man1/git-secret-whoknows.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET\-WHOKNOWS" "1" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET\-WHOKNOWS" "1" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\-whoknows\fR \- prints email\-labels for each key in the keyring\. diff --git a/man/man7/git-secret.7 b/man/man7/git-secret.7 index eb5cd4b1..e0cea77d 100644 --- a/man/man7/git-secret.7 +++ b/man/man7/git-secret.7 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-SECRET" "7" "May 2021" "sobolevn" "git-secret 0.4.0" +.TH "GIT\-SECRET" "7" "June 2021" "sobolevn" "git-secret 0.4.0" . .SH "NAME" \fBgit\-secret\fR \- bash tool to store private data inside a git repo\. @@ -13,7 +13,7 @@ These steps cover the basic process of using \fBgit\-secret\fR: Before starting, \fImake sure you have created a \fBgpg\fR RSA key\-pair\fR: a public and a secret key identified by your email address\. . .IP "2." 4 -Begin with an existing or new git repository\. You\'ll use the \'git secret\' commands to add the keyrings and information to make \fBgit\-secret\fR hide and reveal files in this repository\. +Begin with an existing or new git repository\. You\'ll use the \'git\-secret\' commands to add the keyrings and information to make \fBgit\-secret\fR hide and reveal files in this repository\. . .IP "3." 4 Initialize the \fBgit\-secret\fR repository by running \fBgit secret init\fR command\. The \fB\.gitsecret/\fR folder will be created\. \fBNote\fR all the contents of the \fB\.gitsecret/\fR folder should be checked in, \fB/except/\fR the \fBrandom_seed\fR file\. In other words, of all the files in \fB\.gitsecret/\fR, only the \fBrandom_seed\fR file should be mentioned in your \fB\.gitignore\fR file\. By default, \fBgit secret init\fR will add the file \fB\.gitsecret/keys/random_seed\fR to your \fB\.gitignore\fR file\. @@ -74,7 +74,7 @@ To export your public key, run: . .nf -gpg \-\-export your\.email@address\.com \-\-armor > public\-key\.gpg +gpg \-\-armor \-\-export your\.email@address\.com > public\-key\.gpg . .fi . @@ -106,7 +106,7 @@ One way of doing it is the following: \fIcreate a gpg key\fR for your CI/CD environment\. You can chose any name and email address you want: for instance \fBMyApp CodeShip \fR if your app is called MyApp and your CI/CD provider is CodeShip\. It is easier not to define a password for that key\. . .IP "2." 4 -run \fBgpg \-\-export\-secret\-key myapp@codeship\.com \-\-armor\fR to get your private key value +run \fBgpg \-\-armor \-\-export\-secret\-key myapp@codeship\.com\fR to get your private key value . .IP "3." 4 Create an env var on your CI/CD server \fBGPG_PRIVATE_KEY\fR and assign it the private key value\. @@ -142,7 +142,7 @@ Note: your CI/CD might not allow you to create a multiline value\. In that case, . .nf -gpg \-\-export\-secret\-key myapp@codeship\.com \-\-armor | tr \'\en\' \',\' +gpg \-\-armor \-\-export\-secret\-key myapp@codeship\.com | tr \'\en\' \',\' . .fi . @@ -191,7 +191,7 @@ This folder contains information about the files encrypted by git\-secret, and a You can change the name of this directory using the SECRETS_DIR environment variable\. . .P -Use the various \'git secret\' commands to manipulate the files in \fB\.gitsecret\fR, you should not change the data in these files directly\. +Use the various \'git\-secret\' commands to manipulate the files in \fB\.gitsecret\fR, you should not change the data in these files directly\. . .P Exactly which files exist in the \fB\.gitsecret\fR folder and what their contents are vary slightly across different versions of gpg\. Thus it is best to use git\-secret with the same version of gpg being used by all users\. This can be forced using SECRETS_GPG_COMMAND environment variable\. diff --git a/src/commands/git_secret_killperson.sh b/src/commands/git_secret_removeperson.sh similarity index 74% rename from src/commands/git_secret_killperson.sh rename to src/commands/git_secret_removeperson.sh index 1d21efa0..b8283e43 100644 --- a/src/commands/git_secret_killperson.sh +++ b/src/commands/git_secret_removeperson.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash -function killperson { +function removeperson { OPTIND=1 while getopts 'h' opt; do case "$opt" in - h) _show_manual_for 'killperson';; + h) _show_manual_for 'removeperson';; - *) _invalid_option_for 'killperson';; + *) _invalid_option_for 'removeperson';; esac done @@ -22,7 +22,7 @@ function killperson { local emails=( "$@" ) if [[ ${#emails[@]} -eq 0 ]]; then - _abort "at least one email is required for killperson." + _abort "at least one email is required for removeperson." fi # Getting the local git-secret `gpg` key directory: local secrets_dir_keys @@ -43,3 +43,9 @@ function killperson { _message "now [$*] do not have an access to the repository." _message 'make sure to hide the existing secrets again.' } + +function killperson { + echo 'Warning: `killperson` has been renamed to `removeperson`. This alias will be removed in the future versions, please switch to call `removeperson` going forward.' + + removeperson "$@" +} diff --git a/src/commands/git_secret_usage.sh b/src/commands/git_secret_usage.sh index ed909568..156afbed 100644 --- a/src/commands/git_secret_usage.sh +++ b/src/commands/git_secret_usage.sh @@ -28,7 +28,7 @@ function usage { echo " clean - deletes all encrypted files" echo " hide - encrypts (or re-encrypts) the files to be hidden" echo " init - initializes the git-secret repository" - echo " killperson [emails] - deletes a person's public key from the keyring" + echo " removeperson [emails] - deletes a person's public key from the keyring" echo " list - prints all the added files" echo " remove [files] - removes files from the list of hidden files" echo " reveal - decrypts all hidden files" diff --git a/tests/test_killperson.bats b/tests/test_removeperson.bats similarity index 70% rename from tests/test_killperson.bats rename to tests/test_removeperson.bats index 7ae27340..d81a690c 100644 --- a/tests/test_killperson.bats +++ b/tests/test_removeperson.bats @@ -19,18 +19,18 @@ function teardown { } -@test "run 'killperson' without arguments" { - run git secret killperson +@test "run 'removeperson' without arguments" { + run git secret removeperson [ "$status" -eq 1 ] } -@test "run 'killperson' with short name" { +@test "run 'removeperson' with short name" { local name name=$(echo "$TEST_DEFAULT_USER" | sed -e 's/@.*//') - # killperson must use full email, not short name - run git secret killperson "$name" + # removeperson must use full email, not short name + run git secret removeperson "$name" [ "$status" -eq 1 ] # Then whoknows will be ok because user3@gitsecret.io still knows @@ -42,10 +42,10 @@ function teardown { } -@test "run 'killperson' with email" { +@test "run 'removeperson' with email" { local email="$TEST_DEFAULT_USER" - run git secret killperson "$email" + run git secret removeperson "$email" [ "$status" -eq 0 ] # Testing output: @@ -57,7 +57,7 @@ function teardown { } -@test "run 'killperson' with multiple arguments" { +@test "run 'removeperson' with multiple arguments" { # Adding second user: install_fixture_key "$TEST_SECOND_USER" set_state_secret_tell "$TEST_SECOND_USER" @@ -65,7 +65,7 @@ function teardown { local default_email="$TEST_DEFAULT_USER" local second_email="$TEST_SECOND_USER" - run git secret killperson "$default_email" "$second_email" + run git secret removeperson "$default_email" "$second_email" [ "$status" -eq 0 ] # Testing output: @@ -78,8 +78,14 @@ function teardown { } -@test "run 'killperson' with bad arg" { +@test "run 'removeperson' with bad arg" { local email="$TEST_DEFAULT_USER" - run git secret killperson -Z "$email" + run git secret removeperson -Z "$email" [ "$status" -ne 0 ] } + + +@test "run the 'killperson' alias" { + run git secret killperson + [ "$status" -eq 1 ] +} diff --git a/tests/test_tell.bats b/tests/test_tell.bats index 155fb513..6609d814 100644 --- a/tests/test_tell.bats +++ b/tests/test_tell.bats @@ -75,7 +75,7 @@ function teardown { # Preparations: git secret tell -d "$TEST_GPG_HOMEDIR" "$TEST_DEFAULT_USER" - git secret killperson "$TEST_DEFAULT_USER" + git secret removeperson "$TEST_DEFAULT_USER" # It was showing something like `tru::1:1289775241:0:2:1:6` # after the preparations done and the error was not generated. diff --git a/tests/test_whoknows.bats b/tests/test_whoknows.bats index 2f538a9e..3158cff7 100644 --- a/tests/test_whoknows.bats +++ b/tests/test_whoknows.bats @@ -86,7 +86,7 @@ function teardown { # Preparations, removing users: local email1="$TEST_DEFAULT_USER" local email2="$TEST_SECOND_USER" - git secret killperson "$email1" "$email2" + git secret removeperson "$email1" "$email2" # Now whoknows should raise an error: there are no users. run git secret whoknows