Skip to content

Commit

Permalink
Merge branch 'main' into renovate/python-semantic-release-python-sema…
Browse files Browse the repository at this point in the history
…ntic-release-8.x
  • Loading branch information
raddessi authored Jan 29, 2024
2 parents 2584e1f + 0e3531e commit 2d5548f
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: "3.10"
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
# CHANGELOG



## v1.0.1 (2024-01-29)

### Fix

* fix: duplicate blocks in the same file causes errors (#28)

When an encrypted block is present more than one time in a file it causes errors since the first replacement replaces both instances and the second then fails. ([`21b8543`](https://github.com/raddessi/salt-gnupg-rotate/commit/21b85430313d4e9923773d03a5f9dab0c033281a))


## v1.0.0 (2024-01-29)

### Breaking

* feat!: initial release ([`7eefa6a`](https://github.com/raddessi/salt-gnupg-rotate/commit/7eefa6a9c262bcd5e36f68af2a7bafb752cbce4e))
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Poetry package config
[tool.poetry]
name = "salt-gnupg-rotate"
version = "0.2.2"
version = "1.0.1"
description = "Easily rotate gnupg encryption keys of fully or partially encrypted files."
authors = ["Ryan Addessi <[email protected]>"]
license = "BSD 2-Clause 'Simplified' License"
Expand Down
2 changes: 1 addition & 1 deletion salt_gnupg_rotate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Easily rotate gnupg encryption keys of fully or partially encrypted files.
"""

__version__ = "0.2.2"
__version__ = "1.0.1"
2 changes: 1 addition & 1 deletion salt_gnupg_rotate/rotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def encrypt(self) -> None:
)

proposed_change = new_contents.replace(
encrypted_block, reencrypted_padded_block
encrypted_block, reencrypted_padded_block, 1
)
# check if nothing was changed incorrectly
if proposed_change == new_contents:
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def gnupg_keyring_dirpath() -> str:
"multiple_keys_in_yaml.sls",
"one_key_in_yaml.sls",
"nonconforming_file_type.txt",
"duplicate_blocks_in_yaml.sls",
],
)
def salt_pillar_fpath_fixture(
Expand Down
30 changes: 30 additions & 0 deletions tests/data/salt_pillar/duplicate_blocks_in_yaml.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
this-value: |
-----BEGIN PGP MESSAGE-----

hF4Dv6kh6n/3RV4SAQdAfdDaT1ktkS3ktXnEG50DlmouWC5DGCZzBKzY/bR42hUw
R8Nvh06CDXJKwst4WxvLM72aOIjOnTL3KZtDqiWi4e8wuPCbvh1c2K+D5YwIVC4Y
1FcBCQIQqw/ziVZigFuWV/CWlGz7kqYWRiKP0ZnGcENhcQTYseYeEjThHyYA0Mki
fB6t85QuRuIANeR2SrMeKVhI1AU1hoH0UAzrrDeFzdMz0mVxFEWbQhc=
=QPmN
-----END PGP MESSAGE-----

gets repeated in the same file: |
-----BEGIN PGP MESSAGE-----

hF4Dv6kh6n/3RV4SAQdAfdDaT1ktkS3ktXnEG50DlmouWC5DGCZzBKzY/bR42hUw
R8Nvh06CDXJKwst4WxvLM72aOIjOnTL3KZtDqiWi4e8wuPCbvh1c2K+D5YwIVC4Y
1FcBCQIQqw/ziVZigFuWV/CWlGz7kqYWRiKP0ZnGcENhcQTYseYeEjThHyYA0Mki
fB6t85QuRuIANeR2SrMeKVhI1AU1hoH0UAzrrDeFzdMz0mVxFEWbQhc=
=QPmN
-----END PGP MESSAGE-----

and sometimes:
at different indentation: |
-----BEGIN PGP MESSAGE-----

hF4Dv6kh6n/3RV4SAQdAfdDaT1ktkS3ktXnEG50DlmouWC5DGCZzBKzY/bR42hUw
R8Nvh06CDXJKwst4WxvLM72aOIjOnTL3KZtDqiWi4e8wuPCbvh1c2K+D5YwIVC4Y
1FcBCQIQqw/ziVZigFuWV/CWlGz7kqYWRiKP0ZnGcENhcQTYseYeEjThHyYA0Mki
fB6t85QuRuIANeR2SrMeKVhI1AU1hoH0UAzrrDeFzdMz0mVxFEWbQhc=
=QPmN
-----END PGP MESSAGE-----

0 comments on commit 2d5548f

Please sign in to comment.