feat(config): add puppy_token provider hook for plugin-based credential backends#666
Merged
mpfaffenberger merged 1 commit intoJul 22, 2026
Conversation
…al backends Add register_puppy_token_provider(getter, setter) to config.py so distribution-specific plugins can route puppy_token storage through a secure backend (e.g. OS keyring) without modifying core code. When no provider is registered, get_puppy_token / set_puppy_token behave exactly as before (plaintext puppy.cfg). When a provider is registered at startup, calls delegate to the plugin's getter/setter. This enables downstream enterprise distributions to implement secure credential migration entirely within their plugin layer. Includes three tests covering provider delegation and plaintext fallback.
mpfaffenberger
approved these changes
Jul 22, 2026
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
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.
Summary
Adds
register_puppy_token_provider(getter, setter)toconfig.pysodistribution-specific plugins can route
puppy_tokenstorage through asecure backend (e.g. OS keyring) without modifying core code.
Motivation
Downstream enterprise distributions need to migrate
puppy_tokenfromplaintext
puppy.cfginto the OS keyring. Today, that requires editingthe core
get_puppy_token/set_puppy_tokenfunctions directly,which creates merge conflicts and mixes organization-specific logic into
the open-source core.
This hook lets the plugin layer own the credential backend entirely.
Changes
config.py(+26 lines)register_puppy_token_provider(*, getter, setter)— registers customget/set functions for the puppy_token credential
get_puppy_token()— delegates to registered provider, falls back toget_value('puppy_token')when none is registeredset_puppy_token()— same patternZero breaking changes. When no provider is registered (the default),
behavior is identical to the current code.
tests/test_config_and_storage_edge_cases.py(+40 lines)Three new tests:
Usage (downstream plugin example)