-
-
Couldn't load subscription status.
- Fork 442
Pr3/3 manage apt key removal #1487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
maisim
wants to merge
15
commits into
pyinfra-dev:3.x
Choose a base branch
from
maisim:pr3-manage-apt-key-removal
base: 3.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
WIP, I messed up the rebase of this branch... I'll continue at the end of the week. |
- Add GpgFactBase, GpgKey, GpgKeys, GpgSecretKeys, and GpgKeyrings facts - Add gpg.key and gpg.dearmor operations for managing GPG keys - Support for keyserver fetching, local files, URLs, and key removal - Comprehensive test coverage for all GPG operations and facts
- Add AptRepo and AptSourcesFile dataclasses for type-safe repository handling - Support both legacy .list and modern .sources deb822 formats - Maintain backward compatibility with dict-like access patterns - Add comprehensive parsing for deb822 multi-value fields - Expand deb822 entries to individual repository configurations - Add test coverage for deb822 sources and components with numbers - Update existing tests to handle new file-marker based parsing
- Add GpgFactBase, GpgKey, GpgKeys, GpgSecretKeys, and GpgKeyrings facts - Add gpg.key and gpg.dearmor operations for managing GPG keys - Support for keyserver fetching, local files, URLs, and key removal - Comprehensive test coverage for all GPG operations and facts
- Add AptRepo and AptSourcesFile dataclasses for type-safe repository handling - Support both legacy .list and modern .sources deb822 formats - Maintain backward compatibility with dict-like access patterns - Add comprehensive parsing for deb822 multi-value fields - Expand deb822 entries to individual repository configurations - Add test coverage for deb822 sources and components with numbers - Update existing tests to handle new file-marker based parsing
…mand - Update AptKeys fact to use GpgKeyrings instead of deprecated apt-key command - Maintain backward compatibility by flattening keyring data to match old format - Search APT-specific directories: /etc/apt/trusted.gpg.d, /etc/apt/keyrings, /usr/share/keyrings - Add comprehensive test coverage for modernized apt.key operations - Support both legacy and modern APT key management workflows
- Break down complex key() function into smaller, focused helper functions - Add _install_key_from_src() for file/URL installation - Add _install_key_from_keyserver() for keyserver installation - Add _remove_key_from_keyrings() for multi-keyring removal - Add _remove_key_from_keyring() for single keyring removal - Add _remove_keyring_file() for complete keyring removal - Add validation helper functions for parameters - Improve code readability and maintainability - Follow Docker operations pattern for function organization - Maintain 100% backward compatibility with existing API
# Conflicts: # src/pyinfra/operations/gpg.py
# Conflicts: # src/pyinfra/facts/apt.py # src/pyinfra/operations/gpg.py
2602657 to
c9e83ad
Compare
GPG key IDs contain hexadecimal values that trigger false positives in typos (e.g., 'BA' in '1E9377A2BA9EF27F' is flagged as misspelled). These are valid hex values, not typos.
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request refactors and modernizes the APT repository and key management logic in
src/pyinfra/facts/apt.pyand related files. supporting both legacy and deb822 repository formats, and updating keyring handling to use modern GPG infrastructure.Follow #1465
3.xat this time)scripts/dev-test.sh)scripts/dev-lint.sh)