Allow file content that looks like a checksum.#170
Open
jeremie-pierson wants to merge 11 commits intoOpenVoxProject:mainfrom
Open
Allow file content that looks like a checksum.#170jeremie-pierson wants to merge 11 commits intoOpenVoxProject:mainfrom
jeremie-pierson wants to merge 11 commits intoOpenVoxProject:mainfrom
Conversation
Author
|
I'll correct the new rubocop offense. |
Author
|
@bastelfreak Should I add some tests ? |
added 4 commits
September 1, 2025 13:42
Currently, if a file has a content attribute set to something that looks like a checksum, it will display a deprecation warning and then probably throw an error, as the checksum-link string won't match anything in filebuckets. This code is apparently intended to allow a checksum to be passed instead of actual content, with the effect of replacing file content if it doesn't match the checksum. It appears that this mecanism is replaced by "static catalogs" and was scheduled for removal in Puppet 7. As it is no longer documented (because deprecated), it is surprising to stumble upon the behavior by just having file content that looks like a checksum. I had to work around this in a real usecase involving some proprietary software that uses the same syntax for value to be encrypted at startup. This commit introduces a new setting "use_checksum_in_file_content" that default to true, preserving current behavior. If set to false, it will never look for checksums in file contents. This setting should probably be set to false by default in the next major release.
This is a bit less nice because the nested if allowed another comment, but hey, Rubocop.
f8bdf9a to
a9ca544
Compare
Contributor
|
in all honesty, this was deprecated seven years ago and I've never seen anyone actually use it. I vote we just remove the functionality. |
Author
OK, I'll update this PR to remove the functionality instead of adding another config item :-) |
It was possible, in the distant past, to set a file's content to a checksum and have Puppet automagically fetch file content from filebucket. This functionality is long deprecated, and was once scheduled for removal in Puppet 7. I'm not even sure it's working today. This commit disables the functionality entirely.
Author
|
Let's hope I didn't let tests for the functionality slip through... We'll see soon enough I guess 😅 |
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.
This pull request is intended to fix #169 . Also this is my first pull request on github.
Currently, if a file has a content attribute set to something that looks like a checksum, it will display a deprecation warning and then probably throw an error, as the checksum-like string won't match anything in filebuckets.
This code is apparently intended to allow a checksum to be passed instead of actual content, with the effect of replacing file content if it doesn't match the checksum. It appears that this mecanism is replaced by "static catalogs" and was scheduled for removal in Puppet 7.
As it is no longer documented (because deprecated), it is surprising to stumble upon the behavior by just having file content that looks like a checksum. I had to work around this in a real usecase involving some proprietary software that uses the same syntax for values to be encrypted at startup.
This commit introduces a new setting "use_checksum_in_file_content" that default to true, preserving current behavior. If set to false, it will never look for checksums in file contents.
This setting should probably be set to false by default in the next major release.