Commit 95b347e
fix(lockdown): drop fixed-age expiry, keep per-identity cache isolation
The cache's idle/sliding TTL is cache2go's documented behaviour and was
deliberate in both the original hand-rolled cache and the cache2go
migration: a hot repo keeps serving from cache and only idle entries are
reclaimed. Replacing it with a fixed max age traded that away for a
periodic refetch on every hot repo, which is a freshness change rather
than the isolation fix this issue is about.
Remove createdAt, the injected clock, entryExpired, the createdAt
preservation on entry updates, and the tests that only existed to prove
bounded non-sliding expiry. Restore the original sliding semantics.
Keep the per-caller isolation, which is the actual defect: entries were
keyed on owner/repo alone in a process-wide table, so a trust decision
computed under one caller's credentials could be served to another
caller whose own credentials were never checked. Entry keys now carry a
SHA-256 digest of the request identity, inside a single bounded table.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent acd2afc commit 95b347e
2 files changed
Lines changed: 32 additions & 123 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | 39 | | |
44 | 40 | | |
45 | 41 | | |
| |||
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
59 | | - | |
60 | | - | |
61 | | - | |
| 55 | + | |
| 56 | + | |
62 | 57 | | |
63 | 58 | | |
64 | 59 | | |
| |||
92 | 87 | | |
93 | 88 | | |
94 | 89 | | |
95 | | - | |
| 90 | + | |
96 | 91 | | |
97 | 92 | | |
98 | 93 | | |
| |||
217 | 212 | | |
218 | 213 | | |
219 | 214 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
| 215 | + | |
| 216 | + | |
247 | 217 | | |
248 | 218 | | |
249 | | - | |
| 219 | + | |
250 | 220 | | |
251 | 221 | | |
252 | 222 | | |
253 | | - | |
254 | | - | |
255 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
256 | 242 | | |
257 | 243 | | |
| 244 | + | |
| 245 | + | |
258 | 246 | | |
259 | 247 | | |
260 | 248 | | |
| |||
269 | 257 | | |
270 | 258 | | |
271 | 259 | | |
272 | | - | |
273 | 260 | | |
274 | 261 | | |
275 | 262 | | |
| |||
278 | 265 | | |
279 | 266 | | |
280 | 267 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | 268 | | |
299 | 269 | | |
300 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 118 | + | |
122 | 119 | | |
123 | 120 | | |
124 | 121 | | |
125 | 122 | | |
126 | 123 | | |
127 | 124 | | |
128 | | - | |
| 125 | + | |
129 | 126 | | |
130 | 127 | | |
131 | 128 | | |
| |||
134 | 131 | | |
135 | 132 | | |
136 | 133 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | 134 | | |
196 | 135 | | |
197 | 136 | | |
| |||
272 | 211 | | |
273 | 212 | | |
274 | 213 | | |
275 | | - | |
276 | | - | |
| 214 | + | |
| 215 | + | |
277 | 216 | | |
278 | 217 | | |
279 | 218 | | |
| |||
296 | 235 | | |
297 | 236 | | |
298 | 237 | | |
299 | | - | |
| 238 | + | |
300 | 239 | | |
301 | 240 | | |
302 | 241 | | |
| |||
0 commit comments