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

SA-3040: Add/Remove-JCCloudDirectory Member Functions #554

Merged
merged 26 commits into from
Jan 17, 2024

Conversation

gweinjc
Copy link
Contributor

@gweinjc gweinjc commented Jan 9, 2024

Issues

  • SA-3040 - Add/Remove-JCCloudDirectory Member Functions

What does this solve?

This introduces the following functions:

  • Add-JCOffice365Member
  • Add-JCGsuiteMember
  • Remove-JCOffice365Member
  • Remove-JCGsuiteMember

Currently, admins need to utilize the Add/Remove-JCAssociation functions to adjust their memberships to these groups. With the introduction of the Get/Set-JCCloudDirectory functions, it would make it easier on the admins to programatically adjust their CloudDirectory memberships via easy and intuitive functions.

Is there anything particularly tricky?

N/A

How should this be tested?

Pester test suites have been created for each of the functions. However we should test to ensure that correct information is being passed into the function, example:

  1. Add-JCOffice365Member -ID <Office365InstanceID> -Username John.Doe -UserID <userID> | This should throw, only one property should be passed per call (either username OR userid, not both)
  2. Add-JCOffice365Member -ID <Office365InstanceID> -GroupName Office365Users -GroupID <groupID> | This should throw, only one property should be passed per call (either groupName OR groupID, not both)
  3. Add-JCOffice365Member -ID <Office365InstanceID> -Username John.Doe -GroupName 'Office365Users' | This should throw. Cannot specify both user and usergroup at the same time

These 3 exceptions should be present for all 4 functions

@gweinjc gweinjc requested a review from a team as a code owner January 9, 2024 21:17
@gweinjc gweinjc added minor minor version release PowerShell Module Release for JumpCloud PowerShell Module labels Jan 9, 2024
Copy link
Contributor

@jworkmanjc jworkmanjc left a comment

Choose a reason for hiding this comment

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

Overall I think this is really good, I think we do need to make a change in the data that we are gathering in each function. I'm okay to debate it and come up with a team solution if you feel one way or another but I'd argue we shouldn't be building hash objects for users and usergroups.

Copy link
Contributor

@kmaranionjc kmaranionjc left a comment

Choose a reason for hiding this comment

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

Nice work overall, like Joe stated on his comments, Get-DynamicHash is inefficient for small pulls but something like Search should do.

@gweinjc gweinjc requested a review from a team as a code owner January 16, 2024 23:12
Copy link
Contributor

@jworkmanjc jworkmanjc left a comment

Choose a reason for hiding this comment

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

Thanks for all the changes, just one last function (Remove-JCGsuiteMember) needs that re-work for user/ group hash but otherwise this looks correct. Thanks for the revision

Copy link
Contributor

@kmaranionjc kmaranionjc left a comment

Choose a reason for hiding this comment

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

Thanks for the work. Tests are good on my end.

Copy link
Contributor

@jworkmanjc jworkmanjc left a comment

Choose a reason for hiding this comment

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

Thanks for the changes! Everything looks great!

@gweinjc gweinjc merged commit 7d41448 into master Jan 17, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor minor version release PowerShell Module Release for JumpCloud PowerShell Module
Development

Successfully merging this pull request may close these issues.

3 participants