Commit 77840cc
committed
fix(cli): scope migrated private/protected S3 access to the caller identity
gen2-migration emitted Gen1 authenticated access on private/{entity_id}/* and
protected/{entity_id}/* using allow.authenticated, so the {entity_id} token was
not bound to the requesting user.
Map Gen1 authenticated access on private/ and protected/ to
allow.entity('identity') so {entity_id} resolves to the caller's Cognito
identity, matching the per-user scoping of the Gen1 configuration. protected/
retains allow.authenticated read access; public/* is unchanged.
Adds a test covering per-user scoping and updates the affected inline snapshots.1 parent f06e870 commit 77840cc
2 files changed
Lines changed: 75 additions & 9 deletions
File tree
- packages/amplify-cli/src
- __tests__/commands/gen2-migration/generate/amplify/storage
- commands/gen2-migration/generate/amplify/storage
Lines changed: 47 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
| |||
218 | 221 | | |
219 | 222 | | |
220 | 223 | | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
221 | 261 | | |
222 | 262 | | |
223 | 263 | | |
| |||
324 | 364 | | |
325 | 365 | | |
326 | 366 | | |
327 | | - | |
| 367 | + | |
| 368 | + | |
328 | 369 | | |
329 | 370 | | |
330 | | - | |
| 371 | + | |
331 | 372 | | |
332 | 373 | | |
333 | 374 | | |
| |||
402 | 443 | | |
403 | 444 | | |
404 | 445 | | |
| 446 | + | |
405 | 447 | | |
406 | 448 | | |
407 | 449 | | |
408 | 450 | | |
409 | | - | |
| 451 | + | |
410 | 452 | | |
411 | 453 | | |
412 | 454 | | |
| |||
Lines changed: 28 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
287 | 292 | | |
288 | 293 | | |
289 | 294 | | |
| |||
352 | 357 | | |
353 | 358 | | |
354 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
355 | 379 | | |
356 | 380 | | |
357 | 381 | | |
| |||
0 commit comments