Commit 3896444
committed
feat(cli-internal): escape hatch for unmapped cognito auth actions
resolveAuthAccess() silently dropped cognito-idp actions that
didn't match GROUPED_AUTH_PERMISSIONS or AUTH_ACTION_MAPPING.
Functions lost permissions they had in Gen1 (e.g., CreateGroup,
DeleteGroup, UpdateGroup, Describe*).
Add a third resolution tier: unmapped actions now generate
addToRolePolicy(new aws_iam.PolicyStatement({...})) escape
hatches in backend.ts, following the existing Kinesis grant
pattern.
Also removes AUTH_TRIGGER_ACTION_MAPPING and
resolveAuthTriggerAccess() introduced in the previous commit.
The auth trigger path (extractAuthTriggerCfnPermissions) now
feeds into the same resolveAuthAccess, and trigger-specific
actions like GetGroup/CreateGroup naturally fall through to
the escape hatch since they don't match any group or
individual mapping.
Changes:
- resolveAuthAccess returns { permissions, unmapped }
- ResolvedFunction gains unmappedAuthActions field
- New contributeAuthEscapeHatch() generates addToRolePolicy
- Remove AUTH_TRIGGER_ACTION_MAPPING + resolveAuthTriggerAccess
- Updated snapshots: fitness-tracker (Describe*), media-vault
(CreateGroup/DeleteGroup/UpdateGroup), store-locator
(GetGroup/CreateGroup)
All 12 generate snapshot tests and 135 test suites pass.
---
Prompt: implement escape hatch tier for unmapped cognito
auth actions in resolveAuthAccess, remove
AUTH_TRIGGER_ACTION_MAPPING, update snapshots1 parent ef60c18 commit 3896444
4 files changed
Lines changed: 190 additions & 35 deletions
File tree
- amplify-migration-apps
- fitness-tracker/_snapshot.post.generate/amplify
- media-vault/_snapshot.post.generate/amplify
- store-locator/_snapshot.post.generate/amplify
- packages/amplify-cli/src/commands/gen2-migration/generate/amplify/function
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
Lines changed: 93 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 112 | | |
118 | 113 | | |
119 | 114 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 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 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
123 | 159 | | |
124 | 160 | | |
125 | 161 | | |
126 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
127 | 168 | | |
128 | 169 | | |
129 | 170 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 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 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
133 | 215 | | |
134 | 216 | | |
135 | 217 | | |
| |||
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | | - | |
37 | 35 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 36 | + | |
| 37 | + | |
43 | 38 | | |
44 | 39 | | |
45 | 40 | | |
Lines changed: 88 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
176 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
177 | 185 | | |
178 | 186 | | |
179 | | - | |
| 187 | + | |
180 | 188 | | |
| 189 | + | |
181 | 190 | | |
182 | 191 | | |
183 | 192 | | |
| |||
194 | 203 | | |
195 | 204 | | |
196 | 205 | | |
| 206 | + | |
197 | 207 | | |
198 | 208 | | |
199 | 209 | | |
| |||
257 | 267 | | |
258 | 268 | | |
259 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
260 | 326 | | |
261 | 327 | | |
262 | 328 | | |
| |||
544 | 610 | | |
545 | 611 | | |
546 | 612 | | |
| 613 | + | |
547 | 614 | | |
548 | 615 | | |
549 | 616 | | |
550 | 617 | | |
551 | 618 | | |
552 | 619 | | |
553 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
554 | 627 | | |
555 | 628 | | |
556 | 629 | | |
| |||
589 | 662 | | |
590 | 663 | | |
591 | 664 | | |
592 | | - | |
593 | | - | |
| 665 | + | |
| 666 | + | |
594 | 667 | | |
595 | 668 | | |
596 | 669 | | |
| |||
601 | 674 | | |
602 | 675 | | |
603 | 676 | | |
604 | | - | |
605 | | - | |
| 677 | + | |
| 678 | + | |
606 | 679 | | |
607 | 680 | | |
608 | 681 | | |
609 | | - | |
| 682 | + | |
610 | 683 | | |
611 | 684 | | |
612 | 685 | | |
| |||
1077 | 1150 | | |
1078 | 1151 | | |
1079 | 1152 | | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | 1153 | | |
1085 | 1154 | | |
1086 | | - | |
1087 | | - | |
| 1155 | + | |
| 1156 | + | |
1088 | 1157 | | |
1089 | 1158 | | |
1090 | 1159 | | |
| |||
1096 | 1165 | | |
1097 | 1166 | | |
1098 | 1167 | | |
1099 | | - | |
| 1168 | + | |
| 1169 | + | |
1100 | 1170 | | |
| 1171 | + | |
1101 | 1172 | | |
1102 | 1173 | | |
1103 | 1174 | | |
1104 | | - | |
| 1175 | + | |
| 1176 | + | |
1105 | 1177 | | |
1106 | 1178 | | |
1107 | 1179 | | |
| |||
0 commit comments