Skip to content

Commit

Permalink
feat(encrypt): Answer yes in gpg encrypt and decrypt cmds (#2707)
Browse files Browse the repository at this point in the history
### Changed

- Answer yes in gpg encrypt and decrypt cmds
  • Loading branch information
henrikstranneheim authored Nov 28, 2023
1 parent 858e839 commit c1b22a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cg/constants/encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ class EncryptionUserID(StrEnum):
class GPGParameters(ListEnum):
ASYMMETRIC_ENCRYPTION: list[str] = [
"--encrypt",
"--yes",
"--recipient",
EncryptionUserID.HASTA_USER_ID,
]
ASYMMETRIC_DECRYPTION: list = [
"--decrypt",
"--yes",
"--batch",
"--cipher-algo",
CipherAlgorithm.AES256,
Expand All @@ -47,6 +49,7 @@ class GPGParameters(ListEnum):
]
SYMMETRIC_DECRYPTION: list[str] = [
"--decrypt",
"--yes",
"--cipher-algo",
CipherAlgorithm.AES256,
"--batch",
Expand Down
1 change: 1 addition & 0 deletions cg/meta/encryption/encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ def get_asymmetrically_encrypt_passphrase_cmd(self, passphrase_file_path: Path)
[
self.binary_path,
"--encrypt",
"--yes",
"--recipient",
EncryptionUserID.HASTA_USER_ID,
"--output",
Expand Down
6 changes: 6 additions & 0 deletions tests/meta/encryption/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def asymmetric_encryption_command(output_file_path: Path, input_file_path: Path)
"""Return asymmetric encryption command."""
return [
"--encrypt",
"--yes",
"--recipient",
EncryptionUserID.HASTA_USER_ID,
"-o",
Expand All @@ -68,6 +69,7 @@ def asymmetric_decryption_command(output_file_path: Path, input_file_path: Path)
"""Return asymmetric decryption command."""
return [
"--decrypt",
"--yes",
"--batch",
"--cipher-algo",
CipherAlgorithm.AES256,
Expand Down Expand Up @@ -111,6 +113,7 @@ def symmetric_decryption_command(
"""Return symmetric decryption command."""
return [
"--decrypt",
"--yes",
"--cipher-algo",
CipherAlgorithm.AES256,
"--batch",
Expand Down Expand Up @@ -149,6 +152,7 @@ def key_asymmetric_encryption_command(
"""Return asymmetric encryption command."""
return [
"--encrypt",
"--yes",
"--recipient",
EncryptionUserID.HASTA_USER_ID,
"-o",
Expand All @@ -166,6 +170,7 @@ def spring_symmetric_decryption_command(
"""Return symmetric decryption_command."""
return [
"--decrypt",
"--yes",
"--cipher-algo",
CipherAlgorithm.AES256,
"--batch",
Expand All @@ -184,6 +189,7 @@ def key_asymmetric_decryption_command(
"""Return asymmetric encryption command."""
return [
"--decrypt",
"--yes",
"--batch",
"--cipher-algo",
CipherAlgorithm.AES256,
Expand Down

0 comments on commit c1b22a8

Please sign in to comment.