EntraIDConnector Package Methods and Functions
CreateEntraIDConnector
CreateEntraIDConnector creates a new EntraIDConnector instance based on the parameters passed in.
Parameters:
Each parameter corresponds to a field in the EntraIDConnector struct.
Returns:
*EntraIDConnector: A new instance based on the parameters.
AuthenticatedRequest
AuthenticatedRequest makes an authenticated HTTP request with the given url, request type, content type, and body of the request.
Parameters:
ctx: Context for the request.
url: The URL to send the request to.
requestType: GET or POST.
contentType: application/json ect.
contents: Body of the request.
Returns:
*http.Response: A HTTP reponse from the request.
error: Any errors from the method.
AuthenticatedGetRequest
AuthenticatedGetRequest calls AuthenticatedRequest and passes in GET as the request type.
Parameters:
ctx: Context of the request.
url: The URL for the request.
Returns:
*http.Response: The response from the HTTP request.
error: Any errors from the method.
AuthenticatedPostRequest
AuthenticatedPostRequest calls AuthenticatedRequest and passes in POST as the request type.
Parameters:
ctx: Context of the request.
url: The URL for the request.
contents: The body of the POST request.
Returns:
*http.Response: The response from the HTTP request.
error: Any errors from the method.
BulkRequest
BulkRequest makes a POST request to a bulkUpload Microsoft API.
Parameters:
ctx: Context of the request.
contents: The body of the POST request.
Returns:
*http.Response: The response from the HTTP request.
error: Any errors from the method.
GetProvisioningLogs
GetProvisioningLogs fetches the provisioning logs by making a GET request to the graph.microsoft.com/v1.0/auditLogs/provisioningEvents Microsoft endpoint. Checks the provisioning logs filter.
Parameters:
ctx: Context of the request.
filter: If filter is nil, a new provisioning logs filter will be created and attached to the query.
Returns:
*http.Response: The response from the HTTP request.
error: Any errors from the method.
ValidateMembershipRule
ValidateMembershipRule makes a POST request to the graph.microsoft.com/beta/directoryObjects/validateProperties Microsoft endpoint to see if a group has a particular membershipRule.
Parameters:
ctx: Context of the request.
membershipRule: The rule you are checking.
Returns:
bool: Validated or Not.
error: Any errors from the method.
CreateDynamicGroup
CreateDynamicGroup makes a POST request to the graph.microsoft.com/v1.0/groups Microsoft endpoint to create a dynamic group.
Parameters:
ctx: Context of the request.
displayName: Parameter for the request.
description: Parameter for the request.
membershipRule: Parameter for the request.
securityEnabled: Parameter for the request.
mailEnabled: Parameter for the request.
Returns:
*http.Response: The response from the HTTP request.
error: Any errors from the method.
GetAllGroups
GetAllGroups makes a GET request to the graph.microsoft.com/v1.0/groups Microsoft endpoint to fetch all groups.
Parameters:
ctx: Context of the request.
Returns:
[]models.Group: A slice of a Group struct that describes a group.
error: Any errors from the method.
GetDynamicGroups
GetDynamicGroups fetches dynamic groups from the graph.microsoft.com/v1.0/groups Microsoft endpoint.
Parameters:
ctx: Context of the request.
Returns:
[]models.Group: A slice of a Group struct that describes a group.
error: Any errors from the method.
GetAllUsers
GetAllUsers retrieves all users with mandatory fields and additional specified fields.
Parameters:
fields: Mandatory fields: id, userPrincipalName, groupMemberships. Additional fields can be specified via the 'fields' parameter.
ctx: Context of the request.
Returns:
[]models.User: A slice of Users.
error: Any errors from the method.