Commit ce3d9c1
committed
Backfill auth bypass ids onto existing draft edition assets
The preceding commits fix auth bypass id propagation going forward for
call for evidence response forms and cropped images, but existing
pre-publication editions already carry an auth_bypass_id whose value was
never written to some of their assets in Asset Manager - cropped image
assets, and call for evidence response form (and outcome attachment)
assets. As a result the preview link for those drafts does not grant
access to the affected assets.
This data migration propagates each pre-publication edition's existing
auth_bypass_id to its image assets, and - for call for evidence - its
response form and outcome attachment assets, bringing them into a
consistent state before the rest of the preview token work is built on
top.
It enqueues AssetManagerUpdateAssetJob directly rather than reusing
EditionAuthBypassUpdater, because that service regenerates the token
(set_auth_bypass_id). Minting a new id would invalidate any preview link
publishers have already shared, which is the opposite of what the
backfill needs - we want to preserve the existing id and only repair the
assets.1 parent 7ec3011 commit ce3d9c1
1 file changed
Lines changed: 48 additions & 0 deletions
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
0 commit comments