Commit Graph

81 Commits

Author SHA1 Message Date
Josh Rabinowitz
8adb7d5741
Revert "use pgrep & kill $pid, not ps+gawk+regex+system+kill (#400)" (#405)
This reverts commit a2a9bd32ba.
2019-03-09 13:14:44 -05:00
Josh Rabinowitz
a2a9bd32ba
use pgrep & kill $pid, not ps+gawk+regex+system+kill (#400)
* use pgrep & kill, not ps+gawk+regex+system+kill
* install shellcheck and enable lint on macos/brew.
* add shellcheck fixes and exception
* reorder CHANGELOG entries
2019-03-09 10:14:47 -05:00
Josh Rabinowitz
22fe1ed2d4
Add support for SECRETS_VERBOSE env var (#393)
* Support SECRETS_VERBOSE env var in addition to -v
* don't use --quiet when decrypting in verbose mode
* show output of gpg encryption in verbose mode
* add tests for SECRETS_VERBOSE env var set to 0 and 1
* update changelog, reorder entries.
* add tests for 'cat' and 'hide' with SECRETS_VERBOSE=1
2019-03-07 17:46:51 -05:00
Josh Rabinowitz
c4331693f3
use 'kill', not 'kill -9' (#379) 2019-03-07 15:17:51 -05:00
Josh Rabinowitz
7b06b25c0a
Respect secrets dir on init, and document (#366)
* respect SECRETS_DIR and SECRETS_EXTENSION in tests
* add line regarding fixes to CHANGELOG.md
* test with non-standard SECRETS_EXTENSION
* Add details about init, mention SECRETS_EXTENSION in init page
* update git-secret-init man page
2019-03-05 08:41:13 -05:00
Josh Rabinowitz
505cb1fe42 have lint target run shellcheck over tests (closes #373)
* have lint target run shellcheck over tests

* lint and fix tests/ since shellcheck knows bats

* lint and fix tests/ since shellcheck knows bats

* revert debug output

* changes for shellcheck

* revert unintended change

  [tests/_test_base.bash]

* use 'local' for user/filename vars, not 'export'

* add note about Shellcheck and tests/

* local can only be used in functions - use export

* restore shbang edited in error
2019-03-04 17:40:35 +03:00
Josh Rabinowitz
83b03b61bc
Aspell fixes (#365)
* spellcheck fixes from aspell
2019-02-21 15:20:34 -05:00
Josh Rabinowitz
8ed4f46de6
fix test under git hook (#349)
* fix test under git hook. Actually closes #334
2019-02-11 09:05:16 -05:00
Josh Rabinowitz
5a28744c5d
Fix for tests under bats, fix typos, mention #334 (#342)
* fix test under githooks, fix typos, mention #334 as relevant
2019-02-10 16:44:21 -05:00
Josh Rabinowitz
e34248fdc1
remove diagnostic output from tests (#329) 2019-01-27 18:06:18 -05:00
Josh Rabinowitz
65fe4c4127
Add verbose option to 'git secret tell' showing output of key imports (#321)
* add 'git secret tell -v' option to show output of key imports
* add tests for tell with/without -v
* remove unneeded test code and bats diagnostic output
2019-01-26 22:59:13 -05:00
Josh Rabinowitz
913d026537
Fixes for 'changes' and trailing newlines, for #291 (#293)
* tests and comments about 'changes' for #291
* add 'changes' tests, improve diagnostic 
* preserve trailing newlines in diff output
* use bash trickery to preserve trailing newlines in captured text
* test 'changes' on files without newlines and when called on a non-existant file
* improve comments and variable names
2019-01-01 09:37:11 -05:00
Josh Rabinowitz
9cccf162c6 WIP: test with expired key, add 'whoknows -l' (#287)
* test with expired key, add 'whoknows -l'

    * 'whoknows -l' shows key expiration dates
    * also added docs and tests for `whoknows -l`,
    * tests for expired keys,
    * epoch_to_date functions

* update man pages

* fix epoch-to-date conversion on OSX

* test output of 'whoknows -l'

* fix for lint/shellcheck

* fix for osx

* lint fix

* use date as found in $PATH

* disable 'set -e' as little as possible
2018-12-05 09:43:48 +03:00
Josh Rabinowitz
74f8a07166
improve testing regarding expired keys and keys with only email addresses (#262)
* test that hiding secret with expired key fails
* add test of user key without username.
* revert to performing most tests with 'user1'.
* move user4 private/public key fixtures
* factor code fetching emails from keyrings, add comments.
* use factored _warn_or_abort()
* add to, clean up, and clarify comments.
2018-12-01 08:48:09 -05:00
Josh Rabinowitz
4a3877b486
WIP: Force mode for hide and reveal (#263)
* -F (force even if gpg fails) option for hide and reveal
* allow 'reveal' to decrypt a subset of files.
* update and regen man pages
* man pages update and improvements
* text about why all files should be hidden at once
* add _warn() and _warn_or_abort()
* tests for -F option
* glob source .sh files in Makefile better
* add comment about issue #238. cleanup error msg.
* test exact case in #253
* disable gnupg doc building on ubuntu-rolling
2018-10-10 21:21:58 -04:00
Josh Rabinowitz
9e975e4eed make sure email addresses used with 'tell' and 'killperson' exist in keyring (#267)
* name keys after emails, not usernames

* use emails to specify users

* rename and add function to get emails from keyrings
* rename directories holding gpg test fixtures

* deny emails that aren't in the keyring, and test.

* require 'killperson' emails to exist in keyring

* change test to reflect killperson must use email

* remove no-longer-needed test function

* factor function _assert_keychain_contains_emais()

* fix/make lint happy
2018-09-26 00:08:44 +03:00
joshr
4c2c9a9719 remove diagnostic debug output 2018-09-07 15:48:19 -04:00
joshr
6eedaab489 rename test to show SECRETS_DIR. add debug output. 2018-08-25 10:05:48 -04:00
joshr
2287b3e54e test that $_SECRETS_DIR is set as expected 2018-08-25 09:58:12 -04:00
joshr
4dd04a06e0 comment out old debug code 2018-08-25 08:14:14 -04:00
joshr
1ea3b3139d clarify comment for devs regarding bats TAP diagnostic output 2018-08-18 10:34:48 -04:00
joshr
5d5392232b remove debug code 2018-08-18 10:31:57 -04:00
joshr
645fc2370e change preserve option from -C to -P 2018-08-18 10:09:58 -04:00
joshr
afec23fb17 add test for -C option. fix typos in comments. 2018-08-18 09:17:05 -04:00
joshr
835fe80d8f set permissions when hiding files. change option to -C. 2018-08-18 09:16:50 -04:00
joshr
a090bbddac fix 2018-07-22 23:16:01 -04:00
joshr
cfdca85469 fixes, use _get_encrypted_filename, show TAP diag output 2018-07-22 23:13:12 -04:00
joshr
eb528df301 test permissions 2018-07-22 22:43:37 -04:00
joshr
2e7d6a12a5 add -c (preserve permission) option to reveal. For #172 2018-07-22 16:13:06 -04:00
Josh Rabinowitz
246825c658
fix for keys with only emails, and no usernames. Closes #227 (#240)
* test and fix for keys with only emails, and no usernames. Closes #227
2018-07-17 12:01:16 -04:00
joshr
c141fd4492 test with filenames with spaces 2018-07-14 15:23:17 -04:00
joshr
7096499465 fix quoting for files with spaces. use filenames from _test_base.bats 2018-07-14 15:21:41 -04:00
joshr
7648e2f604 cleanup 2018-07-12 10:22:36 -04:00
joshr
2b28271d8b create a test displaying issue #230 2018-07-12 09:46:49 -04:00
Josh Rabinowitz
5d97c66e90 for testing, use bats-core v1.0.2, not bats 2018-06-20 09:56:25 -04:00
Josh Rabinowitz
553eae53f7
Revert "migrate from bats to bats-core (redux)" 2018-06-19 09:22:56 -04:00
Josh Rabinowitz
bde7a3ca90 migrate from bats to bats-core (redux) 2018-06-13 12:03:25 -04:00
Josh Rabinowitz
bfa3015394
Revert "migrate from bats to bats-core " 2018-06-12 11:24:47 -04:00
joshr
84f9605519 use bats-core 2018-06-09 08:15:32 -04:00
Josh Rabinowitz
c2081514d6 fixes for git secret changes (#160)
* fixes for git secret changes

check that we can find filenames passed on command line, and that
we can find the unencrypted versions of hidden files.

* new test

* add tests
2018-04-21 18:25:38 +03:00
Josh Rabinowitz
deae0d1cd5 'git secret hide' without source files gives appropriate error (#158)
* don't hide files that don't exist decrypted.

and change related error message to 'file not found: filename'.

* ensure all source files are present before hiding

* test for 'add' while unencrypted file missing
2018-04-18 20:56:54 +03:00
joshr
33adc19682 fix test to match _abort() output 2018-04-16 22:24:11 -04:00
Josh Rabinowitz
b626faf472 typos fixed 2018-04-16 11:05:50 -04:00
Josh Rabinowitz
cb64fb15a7 remove unneeded lines 2018-04-14 16:23:13 -04:00
Josh Rabinowitz
7b00d81ea7 change to test CI 2018-04-14 16:14:10 -04:00
Josh Rabinowitz
5c5a49bc3b cleanup 2018-04-14 15:50:38 -04:00
Josh Rabinowitz
50b23c9739 fix 2018-04-14 10:05:27 -04:00
Josh Rabinowitz
d5b1dd7829 test cat with wrong filename 2018-04-14 09:28:05 -04:00
Josh Rabinowitz
29b36ae3a8 remove unneeded code 2018-04-14 08:43:27 -04:00
Josh Rabinowitz
50c9463763 add test for 'git secret cat' 2018-04-14 08:33:57 -04:00