Commit 1a134d7
Harden Entra marketplace access: cache scoping, race guards, error handling
Address rubber-duck review findings on the Entra ID marketplace path:
- Scope the cached access verdict to the marketplace it was computed against
(authProvider + accountId + serviceUrl), rejecting stale caches on any mismatch.
- Guard cache application and background validation with a monotonic epoch so a
session/account/config change mid-validation supersedes an in-flight result.
- Register session/account listeners before applying the cache, and the config
listener before initial validation, closing startup TOCTOU windows.
- Route transient auth-service and marketplace-fetch failures to Unreachable
instead of leaving a configured marketplace on a blank Unavailable view.
- Split 401 (missing/expired token -> RequiresSignIn, not cached) from 403
(durable denial -> AccessDenied, cached ineligible).
- Never follow redirects on token-bearing requests; only send the Entra token to
an HTTPS same-origin target; reject non-2xx and non-manifest 200 responses
before parsing.
- Restore the galleryservice:custom:marketplace telemetry on the GitHub path and
drop the unused server-provided eligibility reason from persisted cache.
Expand unit coverage to 45 tests across provider routing, eligibility, caching,
error classification, and the epoch race paths.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 06027d3 commit 1a134d7
7 files changed
Lines changed: 1150 additions & 143 deletions
File tree
- build/lib/policies
- src/vs
- base/common
- platform/extensionManagement/common
- workbench
- contrib/extensions/browser
- services/extensionManagement
- electron-browser
- test/electron-browser
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
121 | 130 | | |
122 | 131 | | |
123 | 132 | | |
| |||
Lines changed: 23 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
73 | 87 | | |
74 | 88 | | |
75 | 89 | | |
| |||
103 | 117 | | |
104 | 118 | | |
105 | 119 | | |
106 | | - | |
107 | | - | |
108 | | - | |
| 120 | + | |
| 121 | + | |
109 | 122 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
114 | 128 | | |
115 | | - | |
| 129 | + | |
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
| 333 | + | |
| 334 | + | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
| 338 | + | |
337 | 339 | | |
338 | 340 | | |
339 | 341 | | |
| |||
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
345 | | - | |
| 347 | + | |
346 | 348 | | |
347 | 349 | | |
348 | 350 | | |
| |||
2132 | 2134 | | |
2133 | 2135 | | |
2134 | 2136 | | |
| 2137 | + | |
2135 | 2138 | | |
2136 | 2139 | | |
2137 | | - | |
| 2140 | + | |
2138 | 2141 | | |
2139 | 2142 | | |
2140 | 2143 | | |
2141 | | - | |
| 2144 | + | |
2142 | 2145 | | |
2143 | 2146 | | |
2144 | 2147 | | |
| |||
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
146 | 151 | | |
147 | 152 | | |
148 | 153 | | |
| |||
187 | 192 | | |
188 | 193 | | |
189 | 194 | | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
190 | 205 | | |
191 | 206 | | |
192 | 207 | | |
| |||
1153 | 1168 | | |
1154 | 1169 | | |
1155 | 1170 | | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1156 | 1177 | | |
1157 | 1178 | | |
1158 | 1179 | | |
| |||
0 commit comments