File tree Expand file tree Collapse file tree
rust/user-info-fetcher/src/backend Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,9 +27,9 @@ All notable changes to this project will be documented in this file.
2727
2828### Fixed
2929
30- - The Entra user-info-fetcher backend now follows Microsoft Graph's ` @odata.nextLink ` pagination,
31- so users with more group memberships than fit on a single response page receive their complete
32- group list. Following the link is bounded to 100 pages as a safeguard ([ #859 ] ).
30+ - The user-info-fetcher Entra backend now follows Microsoft Graph's ` @odata.nextLink ` pagination
31+ links - up to 100 times - to fetch 999 group memberships per result page, resulting in a maximum
32+ of 99900 fetched memberships for a single user ([ #859 ] ).
3333
3434### Removed
3535
Original file line number Diff line number Diff line change @@ -230,6 +230,19 @@ impl ResolvedEntraBackend {
230230 let mut pages_remaining = MAX_GROUP_PAGES ;
231231
232232 while let Some ( url) = next_url {
233+ // Bound the loop so we can't run into an infinite loop for any reason
234+ if pages_remaining == 0 {
235+ tracing:: warn!(
236+ user. id = %user_info. id,
237+ max_pages = MAX_GROUP_PAGES ,
238+ "reached the maximum number of Entra group membership pages; \
239+ the resolved group list may be incomplete"
240+ ) ;
241+
242+ break ;
243+ }
244+ pages_remaining -= 1 ;
245+
233246 let response = send_json_request :: < GroupMembershipResponse > (
234247 self . http_client . get ( url) . bearer_auth ( & authn. access_token ) ,
235248 )
@@ -245,20 +258,6 @@ impl ResolvedEntraBackend {
245258 . next_link
246259 . map ( |next_link| entra_backend. next_page ( & next_link) )
247260 . transpose ( ) ?;
248-
249- // Bound the loop so we can't run into an infinite loop for any reason
250- pages_remaining -= 1 ;
251- if pages_remaining == 0 {
252- if next_url. is_some ( ) {
253- tracing:: warn!(
254- user. id = %user_info. id,
255- max_pages = MAX_GROUP_PAGES ,
256- "reached the maximum number of Entra group membership pages; \
257- the resolved group list may be incomplete"
258- ) ;
259- }
260- break ;
261- }
262261 }
263262
264263 Ok ( UserInfo {
You can’t perform that action at this time.
0 commit comments