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

Website binding certificate subject compare fails with multiple entries #413

Merged
merged 22 commits into from
Mar 16, 2019
Merged

Website binding certificate subject compare fails with multiple entries #413

merged 22 commits into from
Mar 16, 2019

Conversation

wh33ly
Copy link
Contributor

@wh33ly wh33ly commented Jan 30, 2019

Pull Request (PR) description

Website binding certificate subject compare fails with multiple entries
As described in the issue, this will fix an issue where the binding needs the correct certificate. Search for the certificate failed when a subject contains more then one property and the order differs from the original subject.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry under the Unreleased section of the change log in the README.md.
    Entry should say what was changed, and how that affects users (if applicable).
  • Resource documentation added/updated in README.md.
  • Resource parameter descriptions added/updated in README.md, schema.mof
    and comment-based help.
  • Localization strings added/updated in all localization files as appropriate.
  • Comment-based help added/updated.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Resource Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Resource Testing Guidelines.
  • New/changed code adheres to DSC Resource Style Guidelines and Best Practices.

This change is Reviewable

kwirkykat and others added 14 commits November 2, 2016 13:55
Merging release pull request
Release of version 1.16.0.0 of xWebAdministration
Release of version 1.17.0.0 of xWebAdministration
Release of version 1.18.0.0 of xWebAdministration
Release of version 1.19.0.0 of xWebAdministration
Release of version 1.20.0.0 of xWebAdministration
Release of version 2.0.0.0 of xWebAdministration
Release of version 2.1.0.0 of xWebAdministration
Release of version 2.2.0.0 of xWebAdministration
Release of version 2.3.0.0 of xWebAdministration
Release of version 2.4.0.0 of xWebAdministration
@msftclas
Copy link

msftclas commented Jan 30, 2019

CLA assistant check
All CLA requirements met.

@wh33ly
Copy link
Contributor Author

wh33ly commented Jan 30, 2019

I also added tests for the different scenario's I encountered

@codecov-io
Copy link

codecov-io commented Jan 30, 2019

Codecov Report

Merging #413 into dev will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #413   +/-   ##
=======================================
  Coverage   90.77%   90.77%           
=======================================
  Files          17       17           
  Lines        2438     2438           
=======================================
  Hits         2213     2213           
  Misses        225      225
Impacted Files Coverage Δ
DSCResources/Helper.psm1 90% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd15c1a...3abb213. Read the comment docs.

Copy link
Member

@regedit32 regedit32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, 1 of 1 files at r3.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @wh33ly)


README.md, line 319 at r3 (raw file):

* Helper: Fixed subject comparison for multiple entries

Can you also add the name of the function to be more specific?


DSCResources/Helper.psm1, line 168 at r3 (raw file):

        $certFilters += @('(@(Compare-Object -ReferenceObject (($_.Subject -split ", ").trim()|sort-object) -DifferenceObject (($subject -split ",").trim()|sort-object)| Where-Object -Property SideIndicator -eq "=>").Count -eq 0)')

There's a lot of logic in this one line and we should avoid extensive piping. Breaking this out will make it more readable and easier for debugging and testing. I see there are other older parts of this helper that are doing it this way, but we don't have to continue that practice.

@regedit32
Copy link
Member

@wh33ly Thanks for submitting a fix for this issue. Just small feedback provided and I think it'll be ready.

@regedit32 regedit32 added the waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. label Feb 13, 2019
Copy link
Contributor Author

@wh33ly wh33ly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @regedit32)


README.md, line 319 at r3 (raw file):

Previously, regedit32 (Reggie Gibson) wrote…
* Helper: Fixed subject comparison for multiple entries

Can you also add the name of the function to be more specific?

Updated the unreleased infomation


DSCResources/Helper.psm1, line 168 at r3 (raw file):

Previously, regedit32 (Reggie Gibson) wrote…
        $certFilters += @('(@(Compare-Object -ReferenceObject (($_.Subject -split ", ").trim()|sort-object) -DifferenceObject (($subject -split ",").trim()|sort-object)| Where-Object -Property SideIndicator -eq "=>").Count -eq 0)')

There's a lot of logic in this one line and we should avoid extensive piping. Breaking this out will make it more readable and easier for debugging and testing. I see there are other older parts of this helper that are doing it this way, but we don't have to continue that practice.

Thanks for your feedback.

Would you prefer something like this ? Or do you have another suggestion how to improve this. Breaking out makes it definitely more readable but there still is a lot of logic in one line.

I also broke out the other lines in the function

Copy link
Contributor Author

@wh33ly wh33ly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @regedit32)


README.md, line 319 at r3 (raw file):

Previously, wh33ly wrote…

Updated the unreleased infomation

Done.


DSCResources/Helper.psm1, line 168 at r3 (raw file):

Previously, wh33ly wrote…

Thanks for your feedback.

Would you prefer something like this ? Or do you have another suggestion how to improve this. Breaking out makes it definitely more readable but there still is a lot of logic in one line.

I also broke out the other lines in the function

Done.

Copy link
Contributor Author

@wh33ly wh33ly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated according to comments

Reviewable status: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @regedit32)

@wh33ly
Copy link
Contributor Author

wh33ly commented Feb 22, 2019

@regedit32 Think I'm done, is there anything from my side I need to do now ?

@stale
Copy link

stale bot commented Mar 8, 2019

Labeling this pull request (PR) as abandoned since it has gone 14 days or more since the last update. An abandoned PR can be continued by another contributor. The abandoned label will be removed if work on this PR is taken up again.

@stale stale bot added the abandoned The pull request has been abandoned. label Mar 8, 2019
@wh33ly
Copy link
Contributor Author

wh33ly commented Mar 8, 2019

@regedit32 Bump

@regedit32
Copy link
Member

@wh33ly Sorry for the delay, let me take a look today.

@regedit32 regedit32 merged commit 3ecc117 into dsccommunity:dev Mar 16, 2019
@kwirkykat kwirkykat removed abandoned The pull request has been abandoned. waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. labels Mar 16, 2019
@wh33ly wh33ly deleted the HotfixSubject branch March 18, 2019 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xWebsite: Certificate subject compare fails with multiple entries
5 participants