From 1bc36c08e579f58e83ccc1d936955ad10e732baa Mon Sep 17 00:00:00 2001 From: Juan Pablo Garcia Ripa Date: Fri, 21 Feb 2025 17:46:22 +0100 Subject: [PATCH] chore: update docs and api-report Signed-off-by: Juan Pablo Garcia Ripa --- docs/integrations/azure/org.md | 20 +++++++++++++++++++ .../catalog-backend-module-msgraph/README.md | 6 ++++++ .../report.api.md | 8 ++++++++ 3 files changed, 34 insertions(+) diff --git a/docs/integrations/azure/org.md b/docs/integrations/azure/org.md index 068aa70101..4b6708094e 100644 --- a/docs/integrations/azure/org.md +++ b/docs/integrations/azure/org.md @@ -125,6 +125,17 @@ microsoftGraphOrg: In addition to these groups, one additional group will be created for your organization. All imported groups will be a child of this group. +By default the provider will get groups using the msgraph `/group` endpoint, but it is possible to use different endpoints by setting the `path` configuration. All the endpoint containing `/microsoft.graph.group` will return the right type of group object. + +```yaml +microsoftGraphOrg: + providerId: + group: + filter: securityEnabled eq false and mailEnabled eq true and groupTypes/any(c:c+eq+'Unified') + search: '"description:One" AND ("displayName:Video" OR "displayName:Drive")' + path: /groups/{someRootGroup}/transitiveMembers/microsoft.graph.group # This will get all the groups that are members of the group {someRootGroup} on all levels +``` + ### Users There are two modes for importing users - You can import all user objects matching a `filter`. @@ -148,6 +159,15 @@ microsoftGraphOrg: search: '"description:One" AND ("displayName:Video" OR "displayName:Drive")' ``` +By default the provider will get user using the msgraph `/user` endpoint, but it is possible to use different endpoints by setting the `path` configuration. All the endpoint containing `/microsoft.graph.user` will return the right type of user object. + +```yaml +microsoftGraphOrg: + providerId: + user: + path: /groups/{someRootGroup}/transitiveMembers/microsoft.graph.user # This will get all the users that are members of the group {someRootGroup} on all levels +``` + ### User photos By default, the photos of users will be fetched and added to each user entity. For huge organizations this may be unfeasible, as it will take a _very_ long time, and can be disabled by setting `loadPhotos` to `false`: diff --git a/plugins/catalog-backend-module-msgraph/README.md b/plugins/catalog-backend-module-msgraph/README.md index 7ee416ecd4..8e8c84de37 100644 --- a/plugins/catalog-backend-module-msgraph/README.md +++ b/plugins/catalog-backend-module-msgraph/README.md @@ -58,6 +58,8 @@ catalog: loadPhotos: true # See https://docs.microsoft.com/en-us/graph/api/resources/schemaextension?view=graph-rest-1.0 select: ['id', 'displayName', 'description'] + # Optional /users by default but allow to query users from different msgraph endpoints + path: /users # Optional configuration block userGroupMember: # Optional filter for users, use group membership to get users. @@ -69,6 +71,8 @@ catalog: # (Search for groups and fetch their members.) # This and userFilter are mutually exclusive, only one can be specified search: '"description:One" AND ("displayName:Video" OR "displayName:Drive")' + # Optional /groups by default but allow to query groups from different msgraph endpoints + path: /groups # Optional configuration block group: # Optional parameter to include the expanded resource or collection referenced @@ -87,6 +91,8 @@ catalog: # in order to add extra information to your groups that can be used on your custom groupTransformers # See https://docs.microsoft.com/en-us/graph/api/resources/schemaextension?view=graph-rest-1.0 select: ['id', 'displayName', 'description'] + # Optional /groups by default but allow to query groups from different msgraph endpoints + path: /groups schedule: # optional; same options as in TaskScheduleDefinition # supports cron, ISO duration, "human duration" as used in code frequency: { hours: 1 } diff --git a/plugins/catalog-backend-module-msgraph/report.api.md b/plugins/catalog-backend-module-msgraph/report.api.md index 912ca16e85..02d3949d04 100644 --- a/plugins/catalog-backend-module-msgraph/report.api.md +++ b/plugins/catalog-backend-module-msgraph/report.api.md @@ -92,6 +92,7 @@ export class MicrosoftGraphClient { getGroups( query?: ODataQuery, queryMode?: 'basic' | 'advanced', + path?: string, ): AsyncIterable; getGroupUserMembers( groupId: string, @@ -108,6 +109,7 @@ export class MicrosoftGraphClient { getUsers( query?: ODataQuery, queryMode?: 'basic' | 'advanced', + path?: string, ): AsyncIterable; requestApi( path: string, @@ -239,12 +241,15 @@ export type MicrosoftGraphProviderConfig = { userFilter?: string; userSelect?: string[]; userExpand?: string; + userPath?: string; userGroupMemberFilter?: string; userGroupMemberSearch?: string; + userGroupMemberPath?: string; groupExpand?: string; groupFilter?: string; groupSearch?: string; groupSelect?: string[]; + groupPath?: string; groupIncludeSubGroups?: boolean; queryMode?: 'basic' | 'advanced'; loadUserPhotos?: boolean; @@ -287,13 +292,16 @@ export function readMicrosoftGraphOrg( userExpand?: string; userFilter?: string; userSelect?: string[]; + userPath?: string; loadUserPhotos?: boolean; userGroupMemberSearch?: string; userGroupMemberFilter?: string; + userGroupMemberPath?: string; groupExpand?: string; groupSearch?: string; groupFilter?: string; groupSelect?: string[]; + groupPath?: string; groupIncludeSubGroups?: boolean; queryMode?: 'basic' | 'advanced'; userTransformer?: UserTransformer;