@occam-scaly/scaly-cli 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/scaly.js +2 -2
- package/lib/scaly-plan.js +19 -16
- package/package.json +1 -1
package/bin/scaly.js
CHANGED
|
@@ -2992,9 +2992,9 @@ async function runDiagnoseApp(rest) {
|
|
|
2992
2992
|
}
|
|
2993
2993
|
if (/User pool .* does not exist/i.test(text)) {
|
|
2994
2994
|
findings.push({
|
|
2995
|
-
code: '
|
|
2995
|
+
code: 'USER_GROUPS_POOL_MISSING',
|
|
2996
2996
|
severity: 'medium',
|
|
2997
|
-
hint:
|
|
2997
|
+
hint: "User Groups is misconfigured for this account; contact support to repair the account's identity resources."
|
|
2998
2998
|
});
|
|
2999
2999
|
}
|
|
3000
3000
|
if (/ResourceAlreadyExistsException/i.test(text)) {
|
package/lib/scaly-plan.js
CHANGED
|
@@ -127,6 +127,11 @@ async function buildPlan({ config, env, appName }) {
|
|
|
127
127
|
const pool = a && a.auth && a.auth.userPool;
|
|
128
128
|
if (typeof pool === 'string' && pool.trim()) requestedAuthPools.add(pool);
|
|
129
129
|
}
|
|
130
|
+
if (requestedAuthPools.size) {
|
|
131
|
+
warnings.push(
|
|
132
|
+
"app.auth.userPool is deprecated and ignored. Scaly uses the account's User Groups automatically; configure only app.auth.groups."
|
|
133
|
+
);
|
|
134
|
+
}
|
|
130
135
|
|
|
131
136
|
let stackOpId = null;
|
|
132
137
|
if (!currentStack) {
|
|
@@ -297,9 +302,11 @@ async function buildPlan({ config, env, appName }) {
|
|
|
297
302
|
Array.isArray(existingUserPools) &&
|
|
298
303
|
existingUserPools.length > 1
|
|
299
304
|
) {
|
|
300
|
-
|
|
301
|
-
`Multiple
|
|
305
|
+
const e = new Error(
|
|
306
|
+
`Multiple User Groups pools exist in this account (${existingUserPools.length}). Scaly supports exactly one user pool per account; contact support to repair this account before continuing.`
|
|
302
307
|
);
|
|
308
|
+
e.code = 'USER_GROUPS_POOL_DUPLICATE';
|
|
309
|
+
throw e;
|
|
303
310
|
}
|
|
304
311
|
}
|
|
305
312
|
|
|
@@ -321,26 +328,16 @@ async function buildPlan({ config, env, appName }) {
|
|
|
321
328
|
|
|
322
329
|
if (!currentAddOn) {
|
|
323
330
|
if (apiType === 'COGNITO') {
|
|
324
|
-
const allowMultiple =
|
|
325
|
-
addOn.allow_multiple_user_pools === true ||
|
|
326
|
-
addOn.allowMultipleUserPools === true ||
|
|
327
|
-
config?.account?.allow_multiple_user_pools === true ||
|
|
328
|
-
config?.account?.allowMultipleUserPools === true;
|
|
329
|
-
|
|
330
331
|
const existing =
|
|
331
332
|
Array.isArray(existingUserPools) && existingUserPools.length
|
|
332
|
-
? existingUserPools
|
|
333
|
+
? existingUserPools.find((p) => p && p.name === 'users') ||
|
|
334
|
+
existingUserPools[0]
|
|
333
335
|
: null;
|
|
334
336
|
|
|
335
|
-
if (existing
|
|
337
|
+
if (existing) {
|
|
336
338
|
warnings.push(
|
|
337
|
-
`User
|
|
339
|
+
`User Groups is provisioned automatically per account. Ignoring configured user_groups add-on '${addOn.name}' and using existing '${existing.name}'.`
|
|
338
340
|
);
|
|
339
|
-
if (requestedAuthPools.has(addOn.name)) {
|
|
340
|
-
warnings.push(
|
|
341
|
-
`app.auth.userPool is set to '${addOn.name}'. Consider changing it to '${existing.name}' to keep existing users.`
|
|
342
|
-
);
|
|
343
|
-
}
|
|
344
341
|
ops.push({
|
|
345
342
|
id: `op_addon_noop_${existing.name}`,
|
|
346
343
|
kind: 'addon',
|
|
@@ -356,6 +353,12 @@ async function buildPlan({ config, env, appName }) {
|
|
|
356
353
|
});
|
|
357
354
|
continue;
|
|
358
355
|
}
|
|
356
|
+
|
|
357
|
+
const e = new Error(
|
|
358
|
+
'User Groups pool is missing for this account. Scaly provisions it automatically at account creation; contact support to repair this account.'
|
|
359
|
+
);
|
|
360
|
+
e.code = 'USER_GROUPS_POOL_MISSING';
|
|
361
|
+
throw e;
|
|
359
362
|
}
|
|
360
363
|
|
|
361
364
|
const desired = { name: addOn.name, type: apiType, accountId };
|