Skip to content
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

(GH-154) Fix canonicalization in get method for DSC Base Provider #157

Merged
merged 1 commit into from
Jun 21, 2021
Merged

(GH-154) Fix canonicalization in get method for DSC Base Provider #157

merged 1 commit into from
Jun 21, 2021

Conversation

michaeltlombardi
Copy link
Contributor

Prior to this commit the call to canonicalize for a retrieved resource would return the previously cached canonical value for the specified name hash; in other words, it would return the canonicalized should value. The strict check for retrieved data from get validates that
calling canonicalize does not change the result, as it is meant to munge the manifest input into a state that matches what get will return.

We have been (ab?)using this functionality to force the manifest values to be case insensitive but case preserving. We do not want to munge the return data from the get method.

This commit modifies the logic for handling canonicalizing a resource hash to only munge if no entry for the namehash was found in the cache; otherwise, it returns the data as-is.

This can only happen when a resource has already had its should hash canonicalized during catalogue compilation and a strict check is being applied to the data returned from get.

Prior to this commit the call to canonicalize for a retrieved resource
would return the previously cached canonical value for the specified
name hash; in other words, it would return the canonicalized *should*
value. The strict check for retrieved data from get validates that
calling canonicalize does *not* change the result, as it is meant to
munge the manifest input into a state that matches what get will return.

We have been (ab?)using this functionality to force the manifest values
to be case insensitive but case preserving. We do *not* want to munge
the return data from the get method.

This commit modifies the logic for handling canonicalizing a resource
hash to only munge if no entry for the namehash was found in the cache;
otherwise, it returns the data as-is.

This can *only* happen when a resource has already had its should hash
canonicalized during catalogue compilation and a strict check is being
applied to the data returned from get.
@michaeltlombardi michaeltlombardi requested a review from a team as a code owner June 19, 2021 05:49
@michaeltlombardi michaeltlombardi changed the title (GH-154) Fix canonicalization in get for DSC (GH-154) Fix canonicalization in get method for DSC Base Provider Jun 21, 2021
@jpogran jpogran merged commit 8f46ecb into puppetlabs:main Jun 21, 2021
@michaeltlombardi michaeltlombardi deleted the gh-154/main/fix-get-canonicalize branch June 22, 2021 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants