pjfebbraro / terraform-provider-azureadb2cief

Mozilla Public License 2.0
1 stars 3 forks source link

Diff always changes #1

Closed bilby91 closed 2 years ago

bilby91 commented 2 years ago

Hello @pjfebbraro ,

First of all, thanks so much for building this module, I stumble upon your repo after implementing IEF with null_resources and bash :)

I noticed that for some reason, every time I perform an apply, there are some formatting changes in the XML. I wonder if this is fixed with the commit https://github.com/pjfebbraro/terraform-provider-azureadb2cief/commit/797377ab1a3c969265c4fdd297fa0bfcd88cc8bb

If so, is there any plan for releasing that change?

Thanks so much for creating this module!

pjfebbraro commented 2 years ago

Hello, The change in commit 797377a will fix an issue where terraform plan is reporting false positives for certain fields because the case was changing for a field value. For example uploading a value of 'enc' for a key type would be repeated back by the api as 'ENC'. It does not impact the trust framework policy XML. The diff suppress function for that is in util.XmlDiff. It is a bit tricky to avoid false positives in the XML diff in terraform plan because of the variety of formatting changes that can happen with large XML files when they are uploaded and repeated back by the api. If you share your XML that is causing the problem, I can check to see if there is something about it that can be handled by util.XmlDiff. Thanks, Pete

bilby91 commented 2 years ago

@pjfebbraro Thanks for the quick response.

These are the kind of diffs that I'm seeing.

-         <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub" />
+         <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
</BasePolicy>
+ 
<UserJourneys>

For some reason that I'm unaware, adding <?xml version="1.0" encoding="utf-8" ?> at the top of the XML seems to be root cause triggering the issue. I have removed it and the diffs are clean now.