-
Notifications
You must be signed in to change notification settings - Fork 224
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
SqlServerRole: Add support for nested roles and remove case-sensitive checks #1453
SqlServerRole: Add support for nested roles and remove case-sensitive checks #1453
Conversation
Working on getting the new CI pipeline working, so the tests won't pass yet. I will review this and test manually. But would like to merge this once I got the new CI pipeline in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @nabrond)
DSCResources/MSFT_SqlServerRole/MSFT_SqlServerRole.psm1, line 501 at r1 (raw file):
.Contains
Maybe we should not use case sensitive here either?
DSCResources/MSFT_SqlServerRole/MSFT_SqlServerRole.psm1, line 562 at r1 (raw file):
.Contains
Maybe we should not use case sensitive here either?
The new CI pipeline has merged. This changed the folder structure, and also removed the dev branch. Please rebase against the master branch, and make sure to get your changes into the the file in the new location (under Read more here about the new coding workflow: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 7 files reviewed, 2 unresolved discussions (waiting on @johlju)
DSCResources/MSFT_SqlServerRole/MSFT_SqlServerRole.psm1, line 501 at r1 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
.Contains
Maybe we should not use case sensitive here either?
My testing showed that these were not case sensitive, but I updated the code to avoid future confusion.
DSCResources/MSFT_SqlServerRole/MSFT_SqlServerRole.psm1, line 562 at r1 (raw file):
My testing showed that these were not case sensitive, but I updated the code to avoid future confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ran into some issues with the CI conversion and my local git repo. Refactored a bit to get away from the Contains() calls in the add/drop functions.
Reviewable status: 0 of 7 files reviewed, 2 unresolved discussions (waiting on @johlju)
@nabrond What issues did you run into? Something I should document in the contribution guidelines? |
@nabrond could you please rebase against branch master so we get rid of already merged commits (those that already been merged in other PR's) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased and pushed my branch again. Most of my issues were git-related. I never maintained master
in my fork as everything was previously based off dev
. Trying to get that back in-sync is still proving challenging, I continually encounter disconnected HEAD scenarios. I think once this PR is complete, I will recreate my copy of the repository for future work.
Reviewable status: 0 of 4 files reviewed, 2 unresolved discussions (waiting on @johlju)
I thought |
There are still issues with the rebase. The PR wants to remove things from the change log.
|
You could also just delete the local master branch |
- Changes to SqlSetup - Fix typo in SqlSetup strings (issue #1419).
…nd fix hashtables (#1447) - Changes to SqlServerDsc - Add .gitattributes file to checkout file correctly with CRLF. - Updated .vscode/analyzersettings.psd1 file to correct use PSSA rules and custom rules in VS Code. - Fix hashtables to align with style guideline (issue #1437). - Changes to SqlServerMaxDop - Fix line endings in code which did not use the correct format.
…SqlDscServerRoleMember functions to support new function; Fix issue with localized string formatting.
This reverts commit 61b01b6. and should resolve inconsistencies from rebase.
@johlju, I took at look at my git history for this branch and reverted the change that I think introduced the problems with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 7 files at r2, 3 of 4 files at r5, 1 of 1 files at r6.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @nabrond)
a discussion (no related file):
Could you please add a integration tests that tests the nested roles? That adds a role into a role, and then removes the role from the role?
tests/Unit/MSFT_SqlServerRole.Tests.ps1, line 1146 at r6 (raw file):
speciifying
Typo
@nabrond Awesome work on this! 😃 Thank you! Would just love to have an integration tests, and I found a little typo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 6 files reviewed, 2 unresolved discussions (waiting on @johlju)
a discussion (no related file):
Previously, johlju (Johan Ljunggren) wrote…
Could you please add a integration tests that tests the nested roles? That adds a role into a role, and then removes the role from the role?
@johlju Integration tests added.
tests/Unit/MSFT_SqlServerRole.Tests.ps1, line 1146 at r6 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
speciifying
Typo
Done.
@nabrond I will continue the review tomorrow but a quick question in regards to the case-sensitivity. If are SQL instance is using a case-sensitive collation would that make it possible to have logins and users with different casing? 🤔 When looking at this now I thought that this might break existing use-cases by removing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r7, 1 of 1 files at r8.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @nabrond)
CHANGELOG.md, line 39 at r8 (raw file):
Removed use of case-sensitive Contains() function when evalutating role membership. ``
In regards to the question in the main PR thread. This will not be an issue wit case-sensitive collations? It is never possible to have the same name of a login or group but with different casings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved
CHANGELOG.md, line 39 at r8 (raw file):
Previously, johlju (Johan Ljunggren) wrote…
Removed use of case-sensitive Contains() function when evalutating role membership. ``
In regards to the question in the main PR thread. This will not be an issue wit case-sensitive collations? It is never possible to have the same name of a login or group but with different casings?
It is supported in SQL Server to have the same login with different casing (in sensitive collations). But it will fail when compiling the mof-file as mentioned here #1191.
@nabrond Thank you for the work on this! 😄 |
Pull Request (PR) description
Adds support to the resource for nesting server role membership. Fixes an issue where role membership tests were performed in a case-sensitive manner. Updated the unit test template to v1.2.4 and refactored mocks and test structure to decrease the runtime and resolve some false test results.
This Pull Request (PR) fixes the following issues
Task list
Entry should say what was changed, and how that affects users (if applicable).
and comment-based help.
This change is