aboutsummaryrefslogtreecommitdiff
path: root/crypto_context.go
AgeCommit message (Collapse)Author
2024-04-06all: comply with linter recommendationsShulhan
2024-03-22all: replace module "share" with "pakakeh.go"Shulhan
The "share" project has been moved to SourceHut with new name "pakakeh.go".
2023-11-25all: print non error information using package log instead of fmtShulhan
Although log print to stderr, this allow user to filter between awwan output and command output, for example by piping stderr to /dev/null $ awwan env-get "key" dir/ 2>/dev/null The output env-get is not poluted by other logs.
2023-10-10all: trim spaces in passphrase when its read from fileShulhan
Using vim, or UNIX in general, the file always end with "\n". If we read the whole file then the passphrase will end with it, this cause the decryption may fail (or wrong encryption passphrase used).
2023-09-30all: add option to bypass input passphrase from terminalShulhan
In the environment where passphrase cannot be inputted manually, for example, automatic integration or deployment, we need some mechanism where awwan can be executed to copy or decrypt the encrypted file. The option is by reading plain passphrase from file named "awwan.pass" inside the ".ssh" directory. If its exists and not empty, awwan will not prompt for passphrase from terminal, instead use the content of that file as passhprase.
2023-09-27all: print any path relative to base directoryShulhan
This is to minimize log length in stdout and stderr, which make it more readable.
2023-09-27all: change default path for private key to be located under .ssh directoryShulhan
Using hidden file (with "." prefix in name) cluttering the workspace directory. Since we already have ".ssh" as indicator of workspace, we should use it, the same principal that ~/.ssh/ store user's private key.
2023-09-26all: move fields and methods related to encryption to struct cryptoContextShulhan
The cryptoContext contains the default hash, loaded privateKey, dummy terminal, base directory, and default label; all of those fields are required for encryption and decryption. The cryptoContext have three methods: encrypt, decrypt, and loadPrivateKey. By moving to separate struct the cryptoContext instance can be shared with Session.