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

Add support for PIM Group management #277

Merged
merged 30 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
fa7c2bf
Add support for PIM AAD Group assignments
oWretch Aug 11, 2023
d1561ee
Remove my hardcoded PIM Group ID
oWretch Aug 11, 2023
c2c0048
Complete test suite
oWretch Aug 11, 2023
9fe1a92
Add support for PIM AAD Group eligibility
oWretch Aug 11, 2023
06fa50b
Standardise constants between Assign and Eligible
oWretch Aug 11, 2023
8aec97f
Split into multiple clients
oWretch Aug 11, 2023
87d76f6
Split into multiple clients
oWretch Aug 11, 2023
f9fdd0c
Add support for PIM AAD Policies and Rules
oWretch Aug 11, 2023
2cd4573
Update tests to create PIM Group
oWretch Feb 25, 2024
763acd7
Update tests to create PIM Group
oWretch Feb 25, 2024
68322fe
Retry Role Management Policy list on 404
oWretch Feb 25, 2024
ac4a7cd
Update Role Management patches to expect 200 response
oWretch Feb 25, 2024
0fc0fab
Move ExpirationPattern Duration to a String
oWretch Feb 26, 2024
a5bc72e
Update tests to create PIM Group
oWretch Feb 25, 2024
98bc93a
Move constant references from pointers
oWretch Feb 28, 2024
00c94b6
Move constant references from pointers
oWretch Feb 28, 2024
80ed586
Move constant references from pointers
oWretch Feb 28, 2024
c017495
Add a test for duration property
oWretch Feb 29, 2024
a712ab5
Add User and Group IDs to UserSet
oWretch Mar 5, 2024
9d86990
Merge branch 'refs/heads/f/pim-rolemgmt-policy' into f/pim-groups
oWretch Mar 6, 2024
865e6ab
Merge branch 'refs/heads/f/pim-group-assign-schedule' into f/pim-groups
oWretch Mar 6, 2024
84ddcc0
Merge branch 'refs/heads/f/pim-group-eligible-schedule' into f/pim-gr…
oWretch Mar 6, 2024
3ffc157
Cleanup after merge
oWretch Mar 6, 2024
65f5632
Fix test error introduced by copy/pasta
oWretch Mar 6, 2024
e3e9473
Undo rename of RoleEligibilityScheduleRequestClient
oWretch Mar 21, 2024
a5a4224
Merge branch 'main' into f/pim-groups
manicminer Mar 25, 2024
6b481a9
Undo rename of RoleEligibilityScheduleRequestClient
oWretch Mar 26, 2024
f102a3a
Merge branch 'main' into f/pim-groups
manicminer Mar 27, 2024
f9fa370
linting
manicminer Mar 27, 2024
4f411cc
Merge branch 'main' into f/pim-groups
manicminer Mar 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 100 additions & 46 deletions internal/test/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,52 +91,61 @@ type Test struct {
Claims *claims.Claims
Token *oauth2.Token

AccessPackageAssignmentPolicyClient *msgraph.AccessPackageAssignmentPolicyClient
AccessPackageAssignmentRequestClient *msgraph.AccessPackageAssignmentRequestClient
AccessPackageCatalogClient *msgraph.AccessPackageCatalogClient
AccessPackageClient *msgraph.AccessPackageClient
AccessPackageResourceClient *msgraph.AccessPackageResourceClient
AccessPackageResourceRequestClient *msgraph.AccessPackageResourceRequestClient
AccessPackageResourceRoleScopeClient *msgraph.AccessPackageResourceRoleScopeClient
AdministrativeUnitsClient *msgraph.AdministrativeUnitsClient
ApplicationTemplatesClient *msgraph.ApplicationTemplatesClient
ApplicationsClient *msgraph.ApplicationsClient
AppRoleAssignedToClient *msgraph.AppRoleAssignedToClient
AuthenticationMethodsClient *msgraph.AuthenticationMethodsClient
AuthenticationStrengthPoliciesClient *msgraph.AuthenticationStrengthPoliciesClient
B2CUserFlowClient *msgraph.B2CUserFlowClient
ClaimsMappingPolicyClient *msgraph.ClaimsMappingPolicyClient
ConditionalAccessPoliciesClient *msgraph.ConditionalAccessPoliciesClient
ConnectedOrganizationClient *msgraph.ConnectedOrganizationClient
DelegatedPermissionGrantsClient *msgraph.DelegatedPermissionGrantsClient
DirectoryAuditReportsClient *msgraph.DirectoryAuditReportsClient
DirectoryObjectsClient *msgraph.DirectoryObjectsClient
DirectoryRoleTemplatesClient *msgraph.DirectoryRoleTemplatesClient
DirectoryRolesClient *msgraph.DirectoryRolesClient
DomainsClient *msgraph.DomainsClient
EntitlementRoleAssignmentsClient *msgraph.EntitlementRoleAssignmentsClient
EntitlementRoleDefinitionsClient *msgraph.EntitlementRoleDefinitionsClient
GroupsAppRoleAssignmentsClient *msgraph.AppRoleAssignmentsClient
GroupsClient *msgraph.GroupsClient
IdentityProvidersClient *msgraph.IdentityProvidersClient
InvitationsClient *msgraph.InvitationsClient
MeClient *msgraph.MeClient
NamedLocationsClient *msgraph.NamedLocationsClient
ReportsClient *msgraph.ReportsClient
RoleAssignmentsClient *msgraph.RoleAssignmentsClient
RoleDefinitionsClient *msgraph.RoleDefinitionsClient
RoleEligibilityScheduleRequestClient *msgraph.RoleEligibilityScheduleRequestClient
SchemaExtensionsClient *msgraph.SchemaExtensionsClient
ServicePrincipalsAppRoleAssignmentsClient *msgraph.AppRoleAssignmentsClient
ServicePrincipalsClient *msgraph.ServicePrincipalsClient
SignInReportsClient *msgraph.SignInReportsClient
SynchronizationJobClient *msgraph.SynchronizationJobClient
TermsOfUseAgreementClient *msgraph.TermsOfUseAgreementClient
TokenIssuancePolicyClient *msgraph.TokenIssuancePolicyClient
UserFlowAttributesClient *msgraph.UserFlowAttributesClient
UsersAppRoleAssignmentsClient *msgraph.AppRoleAssignmentsClient
UsersClient *msgraph.UsersClient
WindowsAutopilotDeploymentProfilesClient *msgraph.WindowsAutopilotDeploymentProfilesClient
AccessPackageAssignmentPolicyClient *msgraph.AccessPackageAssignmentPolicyClient
AccessPackageAssignmentRequestClient *msgraph.AccessPackageAssignmentRequestClient
AccessPackageCatalogClient *msgraph.AccessPackageCatalogClient
AccessPackageClient *msgraph.AccessPackageClient
AccessPackageResourceClient *msgraph.AccessPackageResourceClient
AccessPackageResourceRequestClient *msgraph.AccessPackageResourceRequestClient
AccessPackageResourceRoleScopeClient *msgraph.AccessPackageResourceRoleScopeClient
AdministrativeUnitsClient *msgraph.AdministrativeUnitsClient
ApplicationTemplatesClient *msgraph.ApplicationTemplatesClient
ApplicationsClient *msgraph.ApplicationsClient
AppRoleAssignedToClient *msgraph.AppRoleAssignedToClient
AuthenticationMethodsClient *msgraph.AuthenticationMethodsClient
AuthenticationStrengthPoliciesClient *msgraph.AuthenticationStrengthPoliciesClient
B2CUserFlowClient *msgraph.B2CUserFlowClient
ClaimsMappingPolicyClient *msgraph.ClaimsMappingPolicyClient
ConditionalAccessPoliciesClient *msgraph.ConditionalAccessPoliciesClient
ConnectedOrganizationClient *msgraph.ConnectedOrganizationClient
DelegatedPermissionGrantsClient *msgraph.DelegatedPermissionGrantsClient
DirectoryAuditReportsClient *msgraph.DirectoryAuditReportsClient
DirectoryObjectsClient *msgraph.DirectoryObjectsClient
DirectoryRoleTemplatesClient *msgraph.DirectoryRoleTemplatesClient
DirectoryRolesClient *msgraph.DirectoryRolesClient
DomainsClient *msgraph.DomainsClient
EntitlementRoleAssignmentsClient *msgraph.EntitlementRoleAssignmentsClient
EntitlementRoleDefinitionsClient *msgraph.EntitlementRoleDefinitionsClient
GroupsAppRoleAssignmentsClient *msgraph.AppRoleAssignmentsClient
GroupsClient *msgraph.GroupsClient
IdentityProvidersClient *msgraph.IdentityProvidersClient
InvitationsClient *msgraph.InvitationsClient
MeClient *msgraph.MeClient
NamedLocationsClient *msgraph.NamedLocationsClient
PrivilegedAccessGroupAssignmentScheduleClient *msgraph.PrivilegedAccessGroupAssignmentScheduleClient
PrivilegedAccessGroupAssignmentScheduleInstancesClient *msgraph.PrivilegedAccessGroupAssignmentScheduleInstancesClient
PrivilegedAccessGroupAssignmentScheduleRequestsClient *msgraph.PrivilegedAccessGroupAssignmentScheduleRequestsClient
PrivilegedAccessGroupEligibilityScheduleClient *msgraph.PrivilegedAccessGroupEligibilityScheduleClient
PrivilegedAccessGroupEligibilityScheduleInstancesClient *msgraph.PrivilegedAccessGroupEligibilityScheduleInstancesClient
PrivilegedAccessGroupEligibilityScheduleRequestsClient *msgraph.PrivilegedAccessGroupEligibilityScheduleRequestsClient
ReportsClient *msgraph.ReportsClient
RoleAssignmentsClient *msgraph.RoleAssignmentsClient
RoleDefinitionsClient *msgraph.RoleDefinitionsClient
RoleEligibilityScheduleRequestClient *msgraph.RoleEligibilityScheduleRequestClient
RoleManagementPolicyClient *msgraph.RoleManagementPolicyClient
RoleManagementPolicyAssignmentClient *msgraph.RoleManagementPolicyAssignmentClient
RoleManagementPolicyRuleClient *msgraph.RoleManagementPolicyRuleClient
SchemaExtensionsClient *msgraph.SchemaExtensionsClient
ServicePrincipalsAppRoleAssignmentsClient *msgraph.AppRoleAssignmentsClient
ServicePrincipalsClient *msgraph.ServicePrincipalsClient
SignInReportsClient *msgraph.SignInReportsClient
SynchronizationJobClient *msgraph.SynchronizationJobClient
TermsOfUseAgreementClient *msgraph.TermsOfUseAgreementClient
TokenIssuancePolicyClient *msgraph.TokenIssuancePolicyClient
UserFlowAttributesClient *msgraph.UserFlowAttributesClient
UsersAppRoleAssignmentsClient *msgraph.AppRoleAssignmentsClient
UsersClient *msgraph.UsersClient
WindowsAutopilotDeploymentProfilesClient *msgraph.WindowsAutopilotDeploymentProfilesClient
}

func NewTest(t *testing.T) (c *Test) {
Expand Down Expand Up @@ -345,6 +354,36 @@ func NewTest(t *testing.T) (c *Test) {
c.NamedLocationsClient.BaseClient.Endpoint = *endpoint
c.NamedLocationsClient.BaseClient.RetryableClient.RetryMax = retry

c.PrivilegedAccessGroupAssignmentScheduleClient = msgraph.NewPrivilegedAccessGroupAssignmentScheduleClient()
c.PrivilegedAccessGroupAssignmentScheduleClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.PrivilegedAccessGroupAssignmentScheduleClient.BaseClient.Endpoint = *endpoint
c.PrivilegedAccessGroupAssignmentScheduleClient.BaseClient.RetryableClient.RetryMax = retry

c.PrivilegedAccessGroupAssignmentScheduleInstancesClient = msgraph.NewPrivilegedAccessGroupAssignmentScheduleInstancesClient()
c.PrivilegedAccessGroupAssignmentScheduleInstancesClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.PrivilegedAccessGroupAssignmentScheduleInstancesClient.BaseClient.Endpoint = *endpoint
c.PrivilegedAccessGroupAssignmentScheduleInstancesClient.BaseClient.RetryableClient.RetryMax = retry

c.PrivilegedAccessGroupAssignmentScheduleRequestsClient = msgraph.NewPrivilegedAccessGroupAssignmentScheduleRequestsClient()
c.PrivilegedAccessGroupAssignmentScheduleRequestsClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.PrivilegedAccessGroupAssignmentScheduleRequestsClient.BaseClient.Endpoint = *endpoint
c.PrivilegedAccessGroupAssignmentScheduleRequestsClient.BaseClient.RetryableClient.RetryMax = retry

c.PrivilegedAccessGroupEligibilityScheduleClient = msgraph.NewPrivilegedAccessGroupEligibilityScheduleClient()
c.PrivilegedAccessGroupEligibilityScheduleClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.PrivilegedAccessGroupEligibilityScheduleClient.BaseClient.Endpoint = *endpoint
c.PrivilegedAccessGroupEligibilityScheduleClient.BaseClient.RetryableClient.RetryMax = retry

c.PrivilegedAccessGroupEligibilityScheduleInstancesClient = msgraph.NewPrivilegedAccessGroupEligibilityScheduleInstancesClient()
c.PrivilegedAccessGroupEligibilityScheduleInstancesClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.PrivilegedAccessGroupEligibilityScheduleInstancesClient.BaseClient.Endpoint = *endpoint
c.PrivilegedAccessGroupEligibilityScheduleInstancesClient.BaseClient.RetryableClient.RetryMax = retry

c.PrivilegedAccessGroupEligibilityScheduleRequestsClient = msgraph.NewPrivilegedAccessGroupEligibilityScheduleRequestsClient()
c.PrivilegedAccessGroupEligibilityScheduleRequestsClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.PrivilegedAccessGroupEligibilityScheduleRequestsClient.BaseClient.Endpoint = *endpoint
c.PrivilegedAccessGroupEligibilityScheduleRequestsClient.BaseClient.RetryableClient.RetryMax = retry

c.ReportsClient = msgraph.NewReportsClient()
c.ReportsClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.ReportsClient.BaseClient.Endpoint = *endpoint
Expand All @@ -365,6 +404,21 @@ func NewTest(t *testing.T) (c *Test) {
c.RoleEligibilityScheduleRequestClient.BaseClient.Endpoint = *endpoint
c.RoleEligibilityScheduleRequestClient.BaseClient.RetryableClient.RetryMax = retry

c.RoleManagementPolicyClient = msgraph.NewRoleManagementPolicyClient()
c.RoleManagementPolicyClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.RoleManagementPolicyClient.BaseClient.Endpoint = *endpoint
c.RoleManagementPolicyClient.BaseClient.RetryableClient.RetryMax = retry

c.RoleManagementPolicyAssignmentClient = msgraph.NewRoleManagementPolicyAssignmentClient()
c.RoleManagementPolicyAssignmentClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.RoleManagementPolicyAssignmentClient.BaseClient.Endpoint = *endpoint
c.RoleManagementPolicyAssignmentClient.BaseClient.RetryableClient.RetryMax = retry

c.RoleManagementPolicyRuleClient = msgraph.NewRoleManagementPolicyRuleClient()
c.RoleManagementPolicyRuleClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.RoleManagementPolicyRuleClient.BaseClient.Endpoint = *endpoint
c.RoleManagementPolicyRuleClient.BaseClient.RetryableClient.RetryMax = retry

c.SchemaExtensionsClient = msgraph.NewSchemaExtensionsClient()
c.SchemaExtensionsClient.BaseClient.Authorizer = c.Connections["default"].Authorizer
c.SchemaExtensionsClient.BaseClient.Endpoint = *endpoint
Expand Down
Loading
Loading