Commit Graph

127 Commits (master)

Author SHA1 Message Date
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
5 years ago
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
5 years ago
Josh Rabinowitz 83b03b61bc
Aspell fixes (#365)
* spellcheck fixes from aspell
5 years ago
Josh Rabinowitz 8ed4f46de6
fix test under git hook (#349)
* fix test under git hook. Actually closes #334
5 years ago
Josh Rabinowitz 5a28744c5d
Fix for tests under bats, fix typos, mention #334 (#342)
* fix test under githooks, fix typos, mention #334 as relevant
5 years ago
Josh Rabinowitz e34248fdc1
remove diagnostic output from tests (#329) 5 years ago
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
5 years ago
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
5 years ago
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
6 years ago
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.
6 years ago
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
6 years ago
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
6 years ago
joshr 4c2c9a9719 remove diagnostic debug output 6 years ago
joshr 6eedaab489 rename test to show SECRETS_DIR. add debug output. 6 years ago
joshr 2287b3e54e test that $_SECRETS_DIR is set as expected 6 years ago
joshr 4dd04a06e0 comment out old debug code 6 years ago
joshr 1ea3b3139d clarify comment for devs regarding bats TAP diagnostic output 6 years ago
joshr 5d5392232b remove debug code 6 years ago
joshr 645fc2370e change preserve option from -C to -P 6 years ago
joshr afec23fb17 add test for -C option. fix typos in comments. 6 years ago
joshr 835fe80d8f set permissions when hiding files. change option to -C. 6 years ago
joshr a090bbddac fix 6 years ago
joshr cfdca85469 fixes, use _get_encrypted_filename, show TAP diag output 6 years ago
joshr eb528df301 test permissions 6 years ago
joshr 2e7d6a12a5 add -c (preserve permission) option to reveal. For #172 6 years ago
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
6 years ago
joshr c141fd4492 test with filenames with spaces 6 years ago
joshr 7096499465 fix quoting for files with spaces. use filenames from _test_base.bats 6 years ago
joshr 7648e2f604 cleanup 6 years ago
joshr 2b28271d8b create a test displaying issue #230 6 years ago
Josh Rabinowitz 5d97c66e90 for testing, use bats-core v1.0.2, not bats 6 years ago
Josh Rabinowitz 553eae53f7
Revert "migrate from bats to bats-core (redux)" 6 years ago
Josh Rabinowitz bde7a3ca90 migrate from bats to bats-core (redux) 6 years ago
Josh Rabinowitz bfa3015394
Revert "migrate from bats to bats-core " 6 years ago
joshr 84f9605519 use bats-core 6 years ago
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
6 years ago
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
6 years ago
joshr 33adc19682 fix test to match _abort() output 6 years ago
Josh Rabinowitz b626faf472 typos fixed 6 years ago
Josh Rabinowitz cb64fb15a7 remove unneeded lines 6 years ago
Josh Rabinowitz 7b00d81ea7 change to test CI 6 years ago
Josh Rabinowitz 5c5a49bc3b cleanup 6 years ago
Josh Rabinowitz 50b23c9739 fix 6 years ago
Josh Rabinowitz d5b1dd7829 test cat with wrong filename 6 years ago
Josh Rabinowitz 29b36ae3a8 remove unneeded code 6 years ago
Josh Rabinowitz 50c9463763 add test for 'git secret cat' 6 years ago
Carlos Hernandez 408b26ee61
Adding test for hide option '-m'. closes #109. 7 years ago
Carlos Hernandez 0cabcbc92a Add alpine to test matrix and fix tests 7 years ago
Carlos Hernandez 1c10408734 Make test compatible with macos ps 7 years ago
Carlos Hernandez 9d1125b1bb Workaround bug in gpg v2.0.22 where rc 2 is return on decryption. 7 years ago
Carlos Hernandez 8a03a41e47 Fixing bug in test_usage 7 years ago
Carlos Hernandez fea9c3201d Remove left over files from tests 7 years ago
Carlos Hernandez f9b70fbd16 Added fixes for gnupg >= 2.1 7 years ago
Carlos Hernandez 6ced466a84 Making test compat with gnupg 2.1 7 years ago
Carlos Hernandez c602db9583 Migrate to exported keys. 7 years ago
Christoph Tavan 078729a0c6
Make hide -d work with secrets in subdirectories
When searching for files to be removed after being hidden we must use
find with -path instead of -name if we want to remove files in
subdirectories as well.
7 years ago
sobolevn 763e130b8d
Adds new strategy on working with the relative paths.
Changes:
1. When adding new file path is normalized in respect to both CWD and repo root
2. All commands now know about that
3. Tests are fixed

Refs #86, #85, #83
7 years ago
sobolevn 8a1fe788f8
Adds fix to the `changes` command
Changes:
1. Fixes #80, there was a pipe to null, which broke the output
2. Also changed the `diff` formating
3. Also added test case to test deletions
7 years ago
sobolevn 9d0a2ac1c1
Adds fixes to subdirectories bug.
Changes:
1. Fixes #86, now all variables are accessed as functions
2. Fixes #85, now these use cases are working correctly
3. Fixes #83, now init works relative to `.git` folder
4. Closes #77, zsh-plugin is deprecated
5. Refs #53, done some refactoring to tests
6. Closes #82, added additional information to pull-request template
7. Refs #22, plugins are deprecated
8. Also made a lot of improvments into both code and tests
7 years ago
sobolevn 728371912e
Version 0.2.2 pre-release
There are a lot of changes, multiple things were refactored: tests,
some commands, building and meta.

Several critical bugs fixed.

Changes:
1. Fixed #74, when `_user_required` was not working after reimporting keys
2. Closes #73, now it is possible to provide multiple emails to the `killperson` command
3. Closes #72, now it is possible to provide multiple emails to the `tell` command
4. Closes #71, now every doc in this project refer to `git-secret.io` instead of old `gh-pages` website
5. Closes #70, now installation section is removed from main `man` file
6. Closes #69, now "See also" section in the `man`s are clickable
7. Closes #61, added "Manual" section to the manuals
8. Refs #38, added `centos` Dockerfile, but `ci` testing is still failing
9. Refs #52, tests are refactored. Added `clean` command tests, removed a lot of hardcoded things, moved tests execution from `./temp` folder to `/tmp`, added a lot of new check in old tests, and some new test cases
10. Refactored `hide` and `clean` commands to be shorter
11. `shellcheck` is now supported with `make lint`

Additional features are not comming to 0.2.2 after this commit.
7 years ago
Miguel Silvestre 40777fe450 Test changes using multiple files passed as argument 7 years ago
Tim Churchard 1f8a9809a2 Add -d option to hide command to remove unencrypted files. 7 years ago
sobolevn 73526644e0
Adds an attempt to fix the CI
Changes:
1. Fixes the licence information in the `plugin.zsh` to be MIT
2. Fixes link in the README
3. Fixes some tests

Closes #54
7 years ago
sobolevn f099802324
Fixed several issues
Changes:
1. Fixed typo in tests_base
2. Fixed `--no-index` issue
3. Refactored `add` test to be more strict

Closes #50
Refernces #46
8 years ago
sobolevn 904ce02cfc
Added test to cover #50
Changes:
1. Fixed typo in `add -h`
2. Removed unused function from `usage`
8 years ago
sobolevn 67218994f3
refactored all src folder 8 years ago
sobolevn a1cd887101
refactoring started, shellcheck is now supported 8 years ago
sobolevn 8b1a01f1f6
This commit is pretty large. A lot of changes.
The full list of changes:
1. Added `.docker/` folder with Dockerfiles
2. Now `travis` runs integrational tests inside these containers
3. Now `travis` runs tests with `mac os x`
4. Now there are new ways to autodeploy `deb` and `rpm` packages
5. Fixed some issues
6. Also added `.ci/` folder, where utility scripts for travis are stored
7. Moved `git-hooks` into the separate folder: `utils/hooks/`
8. Added new target to the `Makefile`
9. `.gitignore` is updated to ignore `build/` folder and inner files
8 years ago
sobolevn b176040a83 Changed the way tests were handling `git-commit`. Since CI was failing.
Changed it to set `user.name` and `user.email`.
8 years ago
sobolevn b5bdec9673 Added `git-secret-changes` and changed the way `decryption` worked.
Now there's a separate function `_decrypt` which handles `gpg`-decryption.
It is convinient, since both `changes` and `reveal` use it.

Also I have updated manuals to match new features. Also new `brew` repo is now officialy supported.
Added tests for the `changes` command.
8 years ago
sobolevn 8206de7ebb Added '-f' option to the `reveal` command.
This option allows to easily overwite existing giles with no prompt.
Also added documentation for the new option.

Closes #24
8 years ago
sobolevn d523d8b8a9 There was a bug with `sed` command, when trying to `remove` filename with slashes.
Now it is fixed. See `_delete_line` function.
Closes #23
8 years ago
sobolevn 3577c165ec Added `-i` flag to the `git-secret-add` command, which now auto-ignores unignored files.
Also added a test case for this feature.
Other changes:
1. refactored `Makefile` to have `.PHONY` marks
2. added install target to the `Makefile`, now one can run `make install` (with optional `$PREFIX` variable)
3. updated docs for `git-secret.7`, `git-secret-add.1`
4. refactored some commands to `shift` arguments
5. added a test case to the 'other-file-extension' situation
5. added `.github` folder to store templates

Closed #18
8 years ago
sobolevn 1161098f12 Fixes the `gpg2` issue by changing the way fixture installation and uninstallation were handled.
Also `--dry-run` option was added to the `git-secret` command.
8 years ago
elinamorits 73a6e041fa fixed .deb package creation 8 years ago
sobolevn 6278d2e597 somehow git repo fucked up 8 years ago
sobolevn b370149e18 fixes after makefile crash 8 years ago