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

AADGroup: Add properties MemberOf and AssignedToRole #2301

Closed
salbeck-sit opened this issue Sep 20, 2022 · 4 comments
Closed

AADGroup: Add properties MemberOf and AssignedToRole #2301

salbeck-sit opened this issue Sep 20, 2022 · 4 comments
Assignees
Labels
Enhancement New feature or request Entra ID

Comments

@salbeck-sit
Copy link
Contributor

Description

For a group that is created with IsAssignableToRole, it would be helpful to also be able to assign it to one or more AAD roles and subsequently to maintain such role-assignments. Therefore, an additional property AssignedToRole is proposed

Also, it would be nice to be able to build and maintain security-groups that are intended as role-groups, ie members of a role-group are recursively members of one or more security-groups. Therefore, an additional property MemberOf is proposed

Proposed properties

MemberOf
AssignedToRole

Special considerations or limitations

I have already written the necessary addition to the DSC-resource (based off of an earlier version and retro-fitted to the current dev-version of the DSC-resource) and tested it against a test-tenant.

However, since I'm not really at home with Pester, I'm contemplating how unit-tests could - and/or should - be written to verify that the new functionality works as intended. It gets complicated quickly as there's a need for mocking additional groups and one or more directory roles, so it tends to become more similar to a kind of integration-test. Please advise..

@salbeck-sit
Copy link
Contributor Author

I think I have the unit-tests sorted by using -ParameterFilter in the Get-MgGroup mocks. Tests include whether a group is a member of another group and whether a group is assigned to the correct AAD-role. I'll run the test-harness and report back

@salbeck-sit
Copy link
Contributor Author

Unit-testing is now under wraps. It isn't pretty but the power of Pester really shows.

@salbeck-sit
Copy link
Contributor Author

PR #2316 created

NikCharlebois added a commit that referenced this issue Sep 29, 2022
@salbeck-sit
Copy link
Contributor Author

Closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Entra ID
Projects
None yet
Development

No branches or pull requests

2 participants