Commit 128b6ba
committed
fix: follow the next-page cursor when paginating via the request executor
The resilient list_applications/list_group_apps path fetches pages through the
request executor, which returns the raw aiohttp response. extract_after_cursor
only understood the typed-SDK shapes (ApiResponse.headers / OktaAPIResponse._next),
so on the executor response it found no cursor and pagination stopped after the
first page — listings silently truncated to one page (e.g. fetch_all returned only
20 items) on accounts/groups with more.
Root cause: Okta returns 'self' and 'next' as SEPARATE Link headers, so a multidict
headers.get('Link') yields only 'self'. aiohttp already parses them into .links
(rel-keyed), which is what the SDK itself uses (OktaAPIResponse.extract_pagination).
extract_after_cursor now reads response.links['next'] first (raw executor response),
then falls back to a Link-header string via .headers / get_headers() / _resp_headers
(ApiResponse and other shapes), then the SDK v2 has_next()/_next path. Adds tests for
the aiohttp .links shape and the header-accessor fallbacks.
Refs #481 parent 83b44fc commit 128b6ba
2 files changed
Lines changed: 80 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
30 | 68 | | |
31 | 69 | | |
32 | | - | |
| 70 | + | |
33 | 71 | | |
34 | | - | |
| 72 | + | |
35 | 73 | | |
36 | | - | |
| 74 | + | |
37 | 75 | | |
38 | 76 | | |
39 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
109 | 146 | | |
110 | 147 | | |
111 | 148 | | |
| |||
0 commit comments