auth0-deploy-cli 7.6.0 → 7.8.0
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/.eslintrc +7 -41
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +3 -1
- package/.prettierignore +10 -0
- package/.prettierrc.json +4 -0
- package/CHANGELOG.md +222 -7
- package/CONTRIBUTING.md +2 -2
- package/README.md +3 -0
- package/lib/args.d.ts +29 -0
- package/lib/args.js +16 -15
- package/lib/commands/export.d.ts +2 -0
- package/lib/commands/export.js +3 -3
- package/lib/commands/import.d.ts +2 -0
- package/lib/commands/import.js +6 -6
- package/lib/commands/index.d.ts +9 -0
- package/lib/commands/index.js +1 -1
- package/lib/configFactory.d.ts +7 -0
- package/lib/configFactory.js +5 -1
- package/lib/context/defaults.d.ts +1 -0
- package/lib/context/defaults.js +4 -3
- package/lib/context/directory/handlers/actions.d.ts +6 -0
- package/lib/context/directory/handlers/actions.js +3 -3
- package/lib/context/directory/handlers/attackProtection.d.ts +10 -0
- package/lib/context/directory/handlers/attackProtection.js +7 -7
- package/lib/context/directory/handlers/branding.d.ts +6 -0
- package/lib/context/directory/handlers/branding.js +6 -5
- package/lib/context/directory/handlers/clientGrants.d.ts +6 -0
- package/lib/context/directory/handlers/clientGrants.js +3 -2
- package/lib/context/directory/handlers/clients.d.ts +6 -0
- package/lib/context/directory/handlers/clients.js +1 -1
- package/lib/context/directory/handlers/connections.d.ts +6 -0
- package/lib/context/directory/handlers/connections.js +4 -2
- package/lib/context/directory/handlers/databases.d.ts +6 -0
- package/lib/context/directory/handlers/databases.js +13 -7
- package/lib/context/directory/handlers/emailProvider.d.ts +6 -0
- package/lib/context/directory/handlers/emailProvider.js +3 -2
- package/lib/context/directory/handlers/emailTemplates.d.ts +6 -0
- package/lib/context/directory/handlers/emailTemplates.js +2 -2
- package/lib/context/directory/handlers/guardianFactorProviders.d.ts +6 -0
- package/lib/context/directory/handlers/guardianFactorProviders.js +3 -2
- package/lib/context/directory/handlers/guardianFactorTemplates.d.ts +6 -0
- package/lib/context/directory/handlers/guardianFactorTemplates.js +3 -2
- package/lib/context/directory/handlers/guardianFactors.d.ts +6 -0
- package/lib/context/directory/handlers/guardianFactors.js +3 -2
- package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.d.ts +6 -0
- package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.js +1 -1
- package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.d.ts +6 -0
- package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.js +1 -1
- package/lib/context/directory/handlers/guardianPolicies.d.ts +6 -0
- package/lib/context/directory/handlers/guardianPolicies.js +1 -1
- package/lib/context/directory/handlers/hooks.d.ts +6 -0
- package/lib/context/directory/handlers/hooks.js +2 -2
- package/lib/context/directory/handlers/index.d.ts +12 -0
- package/lib/context/directory/handlers/index.js +3 -2
- package/lib/context/directory/handlers/migrations.d.ts +6 -0
- package/lib/context/directory/handlers/organizations.d.ts +6 -0
- package/lib/context/directory/handlers/organizations.js +1 -1
- package/lib/context/directory/handlers/pages.d.ts +6 -0
- package/lib/context/directory/handlers/pages.js +2 -2
- package/lib/context/directory/handlers/resourceServers.d.ts +6 -0
- package/lib/context/directory/handlers/resourceServers.js +3 -2
- package/lib/context/directory/handlers/roles.d.ts +6 -0
- package/lib/context/directory/handlers/roles.js +1 -1
- package/lib/context/directory/handlers/rules.d.ts +6 -0
- package/lib/context/directory/handlers/rules.js +2 -2
- package/lib/context/directory/handlers/rulesConfigs.d.ts +6 -0
- package/lib/context/directory/handlers/rulesConfigs.js +3 -2
- package/lib/context/directory/handlers/tenant.d.ts +10 -0
- package/lib/context/directory/handlers/tenant.js +3 -2
- package/lib/context/directory/handlers/triggers.d.ts +6 -0
- package/lib/context/directory/index.d.ts +17 -0
- package/lib/context/directory/index.js +21 -18
- package/lib/context/index.d.ts +4 -0
- package/lib/context/index.js +83 -61
- package/lib/context/yaml/handlers/actions.d.ts +6 -0
- package/lib/context/yaml/handlers/actions.js +9 -6
- package/lib/context/yaml/handlers/attackProtection.d.ts +6 -0
- package/lib/context/yaml/handlers/attackProtection.js +1 -1
- package/lib/context/yaml/handlers/branding.d.ts +6 -0
- package/lib/context/yaml/handlers/branding.js +5 -4
- package/lib/context/yaml/handlers/clientGrants.d.ts +6 -0
- package/lib/context/yaml/handlers/clientGrants.js +2 -2
- package/lib/context/yaml/handlers/clients.d.ts +6 -0
- package/lib/context/yaml/handlers/clients.js +6 -4
- package/lib/context/yaml/handlers/connections.d.ts +6 -0
- package/lib/context/yaml/handlers/connections.js +7 -5
- package/lib/context/yaml/handlers/databases.d.ts +6 -0
- package/lib/context/yaml/handlers/databases.js +12 -8
- package/lib/context/yaml/handlers/emailProvider.d.ts +6 -0
- package/lib/context/yaml/handlers/emailProvider.js +4 -3
- package/lib/context/yaml/handlers/emailTemplates.d.ts +6 -0
- package/lib/context/yaml/handlers/emailTemplates.js +3 -3
- package/lib/context/yaml/handlers/guardianFactorProviders.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianFactorProviders.js +1 -1
- package/lib/context/yaml/handlers/guardianFactorTemplates.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianFactorTemplates.js +1 -1
- package/lib/context/yaml/handlers/guardianFactors.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianFactors.js +1 -1
- package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.js +1 -1
- package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.js +1 -1
- package/lib/context/yaml/handlers/guardianPolicies.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianPolicies.js +1 -1
- package/lib/context/yaml/handlers/hooks.d.ts +6 -0
- package/lib/context/yaml/handlers/hooks.js +4 -3
- package/lib/context/yaml/handlers/index.d.ts +12 -0
- package/lib/context/yaml/handlers/index.js +3 -2
- package/lib/context/yaml/handlers/migrations.d.ts +6 -0
- package/lib/context/yaml/handlers/organizations.d.ts +6 -0
- package/lib/context/yaml/handlers/organizations.js +3 -3
- package/lib/context/yaml/handlers/pages.d.ts +6 -0
- package/lib/context/yaml/handlers/pages.js +3 -3
- package/lib/context/yaml/handlers/resourceServers.d.ts +6 -0
- package/lib/context/yaml/handlers/resourceServers.js +2 -2
- package/lib/context/yaml/handlers/roles.d.ts +6 -0
- package/lib/context/yaml/handlers/roles.js +3 -3
- package/lib/context/yaml/handlers/rules.d.ts +6 -0
- package/lib/context/yaml/handlers/rules.js +3 -3
- package/lib/context/yaml/handlers/rulesConfigs.d.ts +6 -0
- package/lib/context/yaml/handlers/rulesConfigs.js +2 -2
- package/lib/context/yaml/handlers/tenant.d.ts +6 -0
- package/lib/context/yaml/handlers/tenant.js +4 -3
- package/lib/context/yaml/handlers/triggers.d.ts +6 -0
- package/lib/context/yaml/handlers/triggers.js +2 -2
- package/lib/context/yaml/index.d.ts +13 -0
- package/lib/context/yaml/index.js +31 -23
- package/lib/index.d.ts +88 -0
- package/lib/index.js +25 -17
- package/lib/logger.d.ts +2 -0
- package/lib/logger.js +8 -17
- package/lib/readonly.d.ts +2 -0
- package/lib/readonly.js +11 -16
- package/lib/sessionDurationsToMinutes.d.ts +7 -0
- package/lib/sessionDurationsToMinutes.js +15 -0
- package/lib/tools/auth0/client.d.ts +2 -0
- package/lib/tools/auth0/client.js +12 -12
- package/lib/tools/auth0/handlers/actions.d.ts +95 -0
- package/lib/tools/auth0/handlers/actions.js +22 -24
- package/lib/tools/auth0/handlers/attackProtection.d.ts +28 -0
- package/lib/tools/auth0/handlers/attackProtection.js +14 -17
- package/lib/tools/auth0/handlers/branding.d.ts +27 -0
- package/lib/tools/auth0/handlers/branding.js +13 -9
- package/lib/tools/auth0/handlers/clientGrants.d.ts +32 -0
- package/lib/tools/auth0/handlers/clientGrants.js +17 -10
- package/lib/tools/auth0/handlers/clients.d.ts +23 -0
- package/lib/tools/auth0/handlers/clients.js +15 -8
- package/lib/tools/auth0/handlers/connections.d.ts +54 -0
- package/lib/tools/auth0/handlers/connections.js +30 -10
- package/lib/tools/auth0/handlers/databases.d.ts +36 -0
- package/lib/tools/auth0/handlers/databases.js +25 -13
- package/lib/tools/auth0/handlers/default.d.ts +54 -0
- package/lib/tools/auth0/handlers/default.js +62 -36
- package/lib/tools/auth0/handlers/emailProvider.d.ts +11 -0
- package/lib/tools/auth0/handlers/emailTemplates.d.ts +26 -0
- package/lib/tools/auth0/handlers/emailTemplates.js +8 -10
- package/lib/tools/auth0/handlers/guardianFactorProviders.d.ts +25 -0
- package/lib/tools/auth0/handlers/guardianFactorProviders.js +3 -3
- package/lib/tools/auth0/handlers/guardianFactorTemplates.d.ts +21 -0
- package/lib/tools/auth0/handlers/guardianFactorTemplates.js +3 -3
- package/lib/tools/auth0/handlers/guardianFactors.d.ts +21 -0
- package/lib/tools/auth0/handlers/guardianFactors.js +3 -3
- package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.d.ts +21 -0
- package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js +11 -10
- package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.d.ts +18 -0
- package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js +10 -9
- package/lib/tools/auth0/handlers/guardianPolicies.d.ts +23 -0
- package/lib/tools/auth0/handlers/guardianPolicies.js +5 -4
- package/lib/tools/auth0/handlers/hooks.d.ts +58 -0
- package/lib/tools/auth0/handlers/hooks.js +34 -21
- package/lib/tools/auth0/handlers/index.d.ts +129 -0
- package/lib/tools/auth0/handlers/index.js +31 -27
- package/lib/tools/auth0/handlers/migrations.d.ts +15 -0
- package/lib/tools/auth0/handlers/migrations.js +3 -2
- package/lib/tools/auth0/handlers/organizations.d.ts +51 -0
- package/lib/tools/auth0/handlers/organizations.js +62 -32
- package/lib/tools/auth0/handlers/pages.d.ts +42 -0
- package/lib/tools/auth0/handlers/pages.js +20 -14
- package/lib/tools/auth0/handlers/prompts.d.ts +11 -0
- package/lib/tools/auth0/handlers/prompts.js +1 -0
- package/lib/tools/auth0/handlers/resourceServers.d.ts +51 -0
- package/lib/tools/auth0/handlers/resourceServers.js +22 -14
- package/lib/tools/auth0/handlers/roles.d.ts +48 -0
- package/lib/tools/auth0/handlers/roles.js +56 -32
- package/lib/tools/auth0/handlers/rules.d.ts +55 -0
- package/lib/tools/auth0/handlers/rules.js +53 -36
- package/lib/tools/auth0/handlers/rulesConfigs.d.ts +25 -0
- package/lib/tools/auth0/handlers/rulesConfigs.js +12 -6
- package/lib/tools/auth0/handlers/tenant.d.ts +11 -0
- package/lib/tools/auth0/handlers/tenant.js +8 -4
- package/lib/tools/auth0/handlers/triggers.d.ts +35 -0
- package/lib/tools/auth0/handlers/triggers.js +12 -13
- package/lib/tools/auth0/index.d.ts +15 -0
- package/lib/tools/auth0/index.js +15 -31
- package/lib/tools/auth0/schema.d.ts +15 -0
- package/lib/tools/auth0/schema.js +7 -27
- package/lib/tools/calculateChanges.d.ts +26 -0
- package/lib/tools/calculateChanges.js +12 -7
- package/lib/tools/constants.d.ts +71 -0
- package/lib/tools/constants.js +164 -161
- package/lib/tools/deploy.d.ts +3 -0
- package/lib/tools/deploy.js +3 -3
- package/lib/tools/index.d.ts +82 -0
- package/lib/tools/index.js +1 -1
- package/lib/tools/utils.d.ts +18 -0
- package/lib/tools/utils.js +68 -10
- package/lib/tools/validationError.d.ts +5 -0
- package/lib/tools/{ValidationError.js → validationError.js} +3 -1
- package/lib/types.d.ts +255 -0
- package/lib/types.js +2 -0
- package/lib/utils.d.ts +66 -0
- package/lib/utils.js +18 -25
- package/package.json +16 -7
- package/tsconfig.json +3 -4
- package/typescript-migration-progress.sh +1 -1
- package/lib/tools/logger.js +0 -15
|
@@ -25,11 +25,11 @@ function parse(context) {
|
|
|
25
25
|
const markupFile = path_1.default.join(templateDefinition.body);
|
|
26
26
|
return {
|
|
27
27
|
template: templateDefinition.template,
|
|
28
|
-
body: (0, tools_1.loadFileAndReplaceKeywords)(markupFile, context.mappings)
|
|
28
|
+
body: (0, tools_1.loadFileAndReplaceKeywords)(markupFile, context.mappings),
|
|
29
29
|
};
|
|
30
30
|
});
|
|
31
31
|
return {
|
|
32
|
-
branding: Object.assign(Object.assign({}, branding), { templates })
|
|
32
|
+
branding: Object.assign(Object.assign({}, branding), { templates }),
|
|
33
33
|
};
|
|
34
34
|
});
|
|
35
35
|
}
|
|
@@ -59,7 +59,8 @@ function dump(context) {
|
|
|
59
59
|
return { branding };
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
|
|
62
|
+
const brandingHandler = {
|
|
63
63
|
parse,
|
|
64
|
-
dump
|
|
64
|
+
dump,
|
|
65
65
|
};
|
|
66
|
+
exports.default = brandingHandler;
|
|
@@ -14,7 +14,7 @@ function parse(context) {
|
|
|
14
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15
15
|
// nothing to do, set default empty
|
|
16
16
|
return {
|
|
17
|
-
clientGrants: context.assets.clientGrants
|
|
17
|
+
clientGrants: context.assets.clientGrants,
|
|
18
18
|
};
|
|
19
19
|
});
|
|
20
20
|
}
|
|
@@ -30,7 +30,7 @@ function dump(context) {
|
|
|
30
30
|
const dumpGrant = Object.assign({}, grant);
|
|
31
31
|
dumpGrant.client_id = (0, utils_1.convertClientIdToName)(dumpGrant.client_id, context.assets.clients);
|
|
32
32
|
return dumpGrant;
|
|
33
|
-
})
|
|
33
|
+
}),
|
|
34
34
|
};
|
|
35
35
|
});
|
|
36
36
|
}
|
|
@@ -35,8 +35,8 @@ function parse(context) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
return client;
|
|
38
|
-
})
|
|
39
|
-
]
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
40
|
};
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -45,7 +45,8 @@ function dump(context) {
|
|
|
45
45
|
// Save custom_login_page to a separate html file
|
|
46
46
|
const clientsFolder = path_1.default.join(context.basePath, tools_1.constants.CLIENTS_DIRECTORY);
|
|
47
47
|
return {
|
|
48
|
-
clients: [
|
|
48
|
+
clients: [
|
|
49
|
+
...context.assets.clients.map((client) => {
|
|
49
50
|
if (client.custom_login_page) {
|
|
50
51
|
const clientName = (0, utils_1.sanitize)(client.name);
|
|
51
52
|
const html = client.custom_login_page;
|
|
@@ -56,7 +57,8 @@ function dump(context) {
|
|
|
56
57
|
client.custom_login_page = `./${clientName}_custom_login_page.html`;
|
|
57
58
|
}
|
|
58
59
|
return (0, utils_1.clearClientArrays)(client);
|
|
59
|
-
})
|
|
60
|
+
}),
|
|
61
|
+
],
|
|
60
62
|
};
|
|
61
63
|
});
|
|
62
64
|
}
|
|
@@ -36,15 +36,15 @@ function parse(context) {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
return connection;
|
|
39
|
-
})
|
|
40
|
-
]
|
|
39
|
+
}),
|
|
40
|
+
],
|
|
41
41
|
};
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
const getFormattedOptions = (connection, clients) => {
|
|
45
45
|
try {
|
|
46
46
|
return {
|
|
47
|
-
options: Object.assign(Object.assign({}, connection.options), { idpinitiated: Object.assign(Object.assign({}, connection.options.idpinitiated), { client_id: (0, utils_1.convertClientIdToName)(connection.options.idpinitiated.client_id, clients) }) })
|
|
47
|
+
options: Object.assign(Object.assign({}, connection.options), { idpinitiated: Object.assign(Object.assign({}, connection.options.idpinitiated), { client_id: (0, utils_1.convertClientIdToName)(connection.options.idpinitiated.client_id, clients) }) }),
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
catch (e) {
|
|
@@ -60,7 +60,9 @@ function dump(context) {
|
|
|
60
60
|
// nothing to do, set default if empty
|
|
61
61
|
return {
|
|
62
62
|
connections: connections.map((connection) => {
|
|
63
|
-
const dumpedConnection = Object.assign(Object.assign(Object.assign({}, connection), getFormattedOptions(connection, context.assets.clients)), (connection.enabled_clients && {
|
|
63
|
+
const dumpedConnection = Object.assign(Object.assign(Object.assign({}, connection), getFormattedOptions(connection, context.assets.clients)), (connection.enabled_clients && {
|
|
64
|
+
enabled_clients: (0, utils_1.mapClientID2NameSorted)(connection.enabled_clients, context.assets.clients),
|
|
65
|
+
}));
|
|
64
66
|
if (dumpedConnection.strategy === 'email') {
|
|
65
67
|
(0, utils_1.ensureProp)(connection, 'options.email.body');
|
|
66
68
|
const connectionsFolder = path_1.default.join(context.basePath, tools_1.constants.CONNECTIONS_DIRECTORY);
|
|
@@ -73,7 +75,7 @@ function dump(context) {
|
|
|
73
75
|
dumpedConnection.options.email.body = `./${connectionName}.html`;
|
|
74
76
|
}
|
|
75
77
|
return dumpedConnection;
|
|
76
|
-
})
|
|
78
|
+
}),
|
|
77
79
|
};
|
|
78
80
|
});
|
|
79
81
|
}
|
|
@@ -24,9 +24,9 @@ function parse(context) {
|
|
|
24
24
|
return {
|
|
25
25
|
databases: [
|
|
26
26
|
...context.assets.databases.map((database) => (Object.assign(Object.assign({}, database), { options: Object.assign(Object.assign({}, database.options), (database.options.customScripts && {
|
|
27
|
-
customScripts: Object.entries(database.options.customScripts).reduce((scripts, [name, script]) => (Object.assign(Object.assign({}, scripts), { [name]: context.loadFile(script) })), {})
|
|
28
|
-
})) })))
|
|
29
|
-
]
|
|
27
|
+
customScripts: Object.entries(database.options.customScripts).reduce((scripts, [name, script]) => (Object.assign(Object.assign({}, scripts), { [name]: context.loadFile(script) })), {}),
|
|
28
|
+
})) }))),
|
|
29
|
+
],
|
|
30
30
|
};
|
|
31
31
|
});
|
|
32
32
|
}
|
|
@@ -43,8 +43,12 @@ function dump(context) {
|
|
|
43
43
|
};
|
|
44
44
|
return {
|
|
45
45
|
databases: [
|
|
46
|
-
...databases.map((database) => (Object.assign(Object.assign(Object.assign({}, database), (database.enabled_clients && {
|
|
47
|
-
|
|
46
|
+
...databases.map((database) => (Object.assign(Object.assign(Object.assign({}, database), (database.enabled_clients && {
|
|
47
|
+
enabled_clients: (0, utils_1.mapClientID2NameSorted)(database.enabled_clients, context.assets.clients),
|
|
48
|
+
})), { options: Object.assign(Object.assign({}, database.options), (database.options.customScripts && {
|
|
49
|
+
customScripts: Object.entries(database.options.customScripts)
|
|
50
|
+
.sort(sortCustomScripts)
|
|
51
|
+
.reduce((scripts, [name, script]) => {
|
|
48
52
|
// Create Database folder
|
|
49
53
|
const dbName = (0, utils_1.sanitize)(database.name);
|
|
50
54
|
const dbFolder = path_1.default.join(context.basePath, 'databases', (0, utils_1.sanitize)(dbName));
|
|
@@ -56,9 +60,9 @@ function dump(context) {
|
|
|
56
60
|
fs_extra_1.default.writeFileSync(scriptFile, script);
|
|
57
61
|
scripts[name] = `./databases/${dbName}/${scriptName}.js`;
|
|
58
62
|
return scripts;
|
|
59
|
-
}, {})
|
|
60
|
-
})) })))
|
|
61
|
-
]
|
|
63
|
+
}, {}),
|
|
64
|
+
})) }))),
|
|
65
|
+
],
|
|
62
66
|
};
|
|
63
67
|
});
|
|
64
68
|
}
|
|
@@ -14,20 +14,21 @@ function parse(context) {
|
|
|
14
14
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15
15
|
// nothing to do, set default if empty
|
|
16
16
|
return {
|
|
17
|
-
emailProvider: Object.assign({}, context.assets.emailProvider || {})
|
|
17
|
+
emailProvider: Object.assign({}, (context.assets.emailProvider || {})),
|
|
18
18
|
};
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
function dump(context) {
|
|
22
|
+
var _a;
|
|
22
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
24
|
let { emailProvider } = context.assets;
|
|
24
|
-
const excludedDefaults = context.assets.exclude.defaults || [];
|
|
25
|
+
const excludedDefaults = ((_a = context.assets.exclude) === null || _a === void 0 ? void 0 : _a.defaults) || [];
|
|
25
26
|
if (emailProvider && !excludedDefaults.includes('emailProvider')) {
|
|
26
27
|
// Add placeholder for credentials as they cannot be exported
|
|
27
28
|
emailProvider = (0, defaults_1.emailProviderDefaults)(emailProvider);
|
|
28
29
|
}
|
|
29
30
|
return {
|
|
30
|
-
emailProvider: emailProvider || {}
|
|
31
|
+
emailProvider: emailProvider || {},
|
|
31
32
|
};
|
|
32
33
|
});
|
|
33
34
|
}
|
|
@@ -21,14 +21,14 @@ function parse(context) {
|
|
|
21
21
|
const emailTemplates = context.assets.emailTemplates || [];
|
|
22
22
|
return {
|
|
23
23
|
emailTemplates: [
|
|
24
|
-
...emailTemplates.map((et) => (Object.assign(Object.assign({}, et), { body: context.loadFile(et.body) })))
|
|
25
|
-
]
|
|
24
|
+
...emailTemplates.map((et) => (Object.assign(Object.assign({}, et), { body: context.loadFile(et.body) }))),
|
|
25
|
+
],
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
function dump(context) {
|
|
30
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
let emailTemplates = [...context.assets.emailTemplates || []];
|
|
31
|
+
let emailTemplates = [...(context.assets.emailTemplates || [])];
|
|
32
32
|
if (emailTemplates.length > 0) {
|
|
33
33
|
// Create Templates folder
|
|
34
34
|
const templatesFolder = path_1.default.join(context.basePath, 'emailTemplates');
|
|
@@ -13,7 +13,7 @@ function parseAndDump(context) {
|
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
// nothing to do, set default empty
|
|
15
15
|
return {
|
|
16
|
-
guardianFactorProviders: [...context.assets.guardianFactorProviders || []]
|
|
16
|
+
guardianFactorProviders: [...(context.assets.guardianFactorProviders || [])],
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@ function parseAndDump(context) {
|
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
// nothing to do, set default if empty
|
|
15
15
|
return {
|
|
16
|
-
guardianFactorTemplates: [...context.assets.guardianFactorTemplates || []]
|
|
16
|
+
guardianFactorTemplates: [...(context.assets.guardianFactorTemplates || [])],
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@ function parseAndDump(context) {
|
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
// nothing to do, set default if empty
|
|
15
15
|
return {
|
|
16
|
-
guardianFactors: [...context.assets.guardianFactors || []]
|
|
16
|
+
guardianFactors: [...(context.assets.guardianFactors || [])],
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { YAMLHandler } from '.';
|
|
2
|
+
declare type ParsedGuardianFactorMessageTypes = {
|
|
3
|
+
guardianPhoneFactorMessageTypes: unknown;
|
|
4
|
+
};
|
|
5
|
+
declare const guardianPhoneFactorMessageTypesHandler: YAMLHandler<ParsedGuardianFactorMessageTypes>;
|
|
6
|
+
export default guardianPhoneFactorMessageTypesHandler;
|
|
@@ -13,7 +13,7 @@ function parseAndDump(context) {
|
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
// nothing to do, set default if empty
|
|
15
15
|
return {
|
|
16
|
-
guardianPhoneFactorMessageTypes: Object.assign({}, context.assets.guardianPhoneFactorMessageTypes || {})
|
|
16
|
+
guardianPhoneFactorMessageTypes: Object.assign({}, (context.assets.guardianPhoneFactorMessageTypes || {})),
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { YAMLHandler } from '.';
|
|
2
|
+
declare type ParsedGuardianPhoneFactorSelectedProvider = {
|
|
3
|
+
guardianPhoneFactorSelectedProvider: unknown;
|
|
4
|
+
};
|
|
5
|
+
declare const guardianPhoneFactorSelectedProviderHandler: YAMLHandler<ParsedGuardianPhoneFactorSelectedProvider>;
|
|
6
|
+
export default guardianPhoneFactorSelectedProviderHandler;
|
|
@@ -13,7 +13,7 @@ function parseAndDump(context) {
|
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
// nothing to do, set default empty
|
|
15
15
|
return {
|
|
16
|
-
guardianPhoneFactorSelectedProvider: Object.assign({}, context.assets.guardianPhoneFactorSelectedProvider || {})
|
|
16
|
+
guardianPhoneFactorSelectedProvider: Object.assign({}, (context.assets.guardianPhoneFactorSelectedProvider || {})),
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@ function parseAndDump(context) {
|
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
// nothing to do, set default if empty
|
|
15
15
|
return {
|
|
16
|
-
guardianPolicies: Object.assign({}, context.assets.guardianPolicies || {})
|
|
16
|
+
guardianPolicies: Object.assign({}, (context.assets.guardianPolicies || {})),
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -26,18 +26,19 @@ function parse(context) {
|
|
|
26
26
|
hooks: [
|
|
27
27
|
...context.assets.hooks.map((hook) => {
|
|
28
28
|
if (hook.script) {
|
|
29
|
+
//@ts-ignore TODO: understand why two arguments are passed when context.loadFile only accepts one
|
|
29
30
|
hook.script = context.loadFile(hook.script, tools_1.constants.HOOKS_DIRECTORY);
|
|
30
31
|
}
|
|
31
32
|
hook.name = hook.name.toLowerCase().replace(/\s/g, '-');
|
|
32
33
|
return Object.assign({}, hook);
|
|
33
|
-
})
|
|
34
|
-
]
|
|
34
|
+
}),
|
|
35
|
+
],
|
|
35
36
|
};
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
function dump(context) {
|
|
39
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
let hooks = [...context.assets.hooks || []];
|
|
41
|
+
let hooks = [...(context.assets.hooks || [])];
|
|
41
42
|
if (hooks.length > 0) {
|
|
42
43
|
// Create hooks folder
|
|
43
44
|
const hooksFolder = path_1.default.join(context.basePath, 'hooks');
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import YAMLContext from '..';
|
|
2
|
+
import { AssetTypes } from '../../../types';
|
|
3
|
+
export declare type YAMLHandler<T> = {
|
|
4
|
+
dump: (context: YAMLContext) => Promise<T | {}>;
|
|
5
|
+
parse: (context: YAMLContext) => Promise<T>;
|
|
6
|
+
};
|
|
7
|
+
declare const yamlHandlers: {
|
|
8
|
+
[key in AssetTypes]: YAMLHandler<{
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
export default yamlHandlers;
|
|
@@ -28,7 +28,7 @@ const actions_1 = __importDefault(require("./actions"));
|
|
|
28
28
|
const triggers_1 = __importDefault(require("./triggers"));
|
|
29
29
|
const attackProtection_1 = __importDefault(require("./attackProtection"));
|
|
30
30
|
const branding_1 = __importDefault(require("./branding"));
|
|
31
|
-
|
|
31
|
+
const yamlHandlers = {
|
|
32
32
|
rules: rules_1.default,
|
|
33
33
|
hooks: hooks_1.default,
|
|
34
34
|
rulesConfigs: rulesConfigs_1.default,
|
|
@@ -53,5 +53,6 @@ exports.default = {
|
|
|
53
53
|
organizations: organizations_1.default,
|
|
54
54
|
triggers: triggers_1.default,
|
|
55
55
|
attackProtection: attackProtection_1.default,
|
|
56
|
-
branding: branding_1.default
|
|
56
|
+
branding: branding_1.default,
|
|
57
57
|
};
|
|
58
|
+
exports.default = yamlHandlers;
|
|
@@ -13,7 +13,7 @@ function parse(context) {
|
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
const { organizations } = context.assets;
|
|
15
15
|
return {
|
|
16
|
-
organizations: organizations
|
|
16
|
+
organizations: organizations,
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -33,8 +33,8 @@ function dump(context) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
return org;
|
|
36
|
-
})
|
|
37
|
-
]
|
|
36
|
+
}),
|
|
37
|
+
],
|
|
38
38
|
};
|
|
39
39
|
});
|
|
40
40
|
}
|
|
@@ -22,14 +22,14 @@ function parse(context) {
|
|
|
22
22
|
return {};
|
|
23
23
|
return {
|
|
24
24
|
pages: [
|
|
25
|
-
...context.assets.pages.map((page) => (Object.assign(Object.assign({}, page), { html: page.html ? context.loadFile(page.html) : '' })))
|
|
26
|
-
]
|
|
25
|
+
...context.assets.pages.map((page) => (Object.assign(Object.assign({}, page), { html: page.html ? context.loadFile(page.html) : '' }))),
|
|
26
|
+
],
|
|
27
27
|
};
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
30
|
function dump(context) {
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
let pages = [...context.assets.pages || []];
|
|
32
|
+
let pages = [...(context.assets.pages || [])];
|
|
33
33
|
if (pages.length > 0) {
|
|
34
34
|
// Create Pages folder
|
|
35
35
|
const pagesFolder = path_1.default.join(context.basePath, 'pages');
|
|
@@ -13,7 +13,7 @@ function parse(context) {
|
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
// nothing to do, set default if empty
|
|
15
15
|
return {
|
|
16
|
-
resourceServers: context.assets.resourceServers
|
|
16
|
+
resourceServers: context.assets.resourceServers,
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -21,7 +21,7 @@ function dump(context) {
|
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
// nothing to do, set default if empty
|
|
23
23
|
return {
|
|
24
|
-
resourceServers: [...context.assets.resourceServers || []]
|
|
24
|
+
resourceServers: [...(context.assets.resourceServers || [])],
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
27
|
}
|
|
@@ -13,7 +13,7 @@ function parse(context) {
|
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
// nothing to do, set default empty
|
|
15
15
|
return {
|
|
16
|
-
roles: context.assets.roles
|
|
16
|
+
roles: context.assets.roles,
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -27,8 +27,8 @@ function dump(context) {
|
|
|
27
27
|
delete role.description;
|
|
28
28
|
}
|
|
29
29
|
return role;
|
|
30
|
-
})
|
|
31
|
-
]
|
|
30
|
+
}),
|
|
31
|
+
],
|
|
32
32
|
};
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -23,14 +23,14 @@ function parse(context) {
|
|
|
23
23
|
return {};
|
|
24
24
|
return {
|
|
25
25
|
rules: [
|
|
26
|
-
...context.assets.rules.map((rule) => (Object.assign(Object.assign({}, rule), { script: context.loadFile(rule.script) })))
|
|
27
|
-
]
|
|
26
|
+
...context.assets.rules.map((rule) => (Object.assign(Object.assign({}, rule), { script: context.loadFile(rule.script) }))),
|
|
27
|
+
],
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
function dump(context) {
|
|
32
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
let rules = [...context.assets.rules || []];
|
|
33
|
+
let rules = [...(context.assets.rules || [])];
|
|
34
34
|
if (rules.length > 0) {
|
|
35
35
|
// Create Rules folder
|
|
36
36
|
const rulesFolder = path_1.default.join(context.basePath, 'rules');
|
|
@@ -13,7 +13,7 @@ function parse(context) {
|
|
|
13
13
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
// nothing to do, set default if empty
|
|
15
15
|
return {
|
|
16
|
-
rulesConfigs: context.assets.rulesConfigs
|
|
16
|
+
rulesConfigs: context.assets.rulesConfigs,
|
|
17
17
|
};
|
|
18
18
|
});
|
|
19
19
|
}
|
|
@@ -21,7 +21,7 @@ function dump(_context) {
|
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
// do not export rulesConfigs as its values cannot be extracted
|
|
23
23
|
return {
|
|
24
|
-
rulesConfigs: []
|
|
24
|
+
rulesConfigs: [],
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
27
|
}
|
|
@@ -21,6 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
const utils_1 = require("../../../utils");
|
|
24
|
+
const sessionDurationsToMinutes_1 = require("../../../sessionDurationsToMinutes");
|
|
24
25
|
function parse(context) {
|
|
25
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
27
|
// Nothing to do
|
|
@@ -29,15 +30,15 @@ function parse(context) {
|
|
|
29
30
|
/* eslint-disable camelcase */
|
|
30
31
|
const _a = context.assets.tenant, { session_lifetime, idle_session_lifetime } = _a, tenant = __rest(_a, ["session_lifetime", "idle_session_lifetime"]);
|
|
31
32
|
(0, utils_1.clearTenantFlags)(tenant);
|
|
33
|
+
const sessionDurations = (0, sessionDurationsToMinutes_1.sessionDurationsToMinutes)({ session_lifetime, idle_session_lifetime });
|
|
32
34
|
return {
|
|
33
|
-
tenant: Object.assign(
|
|
35
|
+
tenant: Object.assign(Object.assign({}, tenant), sessionDurations),
|
|
34
36
|
};
|
|
35
|
-
/* eslint-enable camelcase */
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
function dump(context) {
|
|
39
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const tenant = Object.assign({}, context.assets.tenant || {});
|
|
41
|
+
const tenant = Object.assign({}, (context.assets.tenant || {}));
|
|
41
42
|
(0, utils_1.clearTenantFlags)(tenant);
|
|
42
43
|
return { tenant };
|
|
43
44
|
});
|