auth0-deploy-cli 9.0.0-beta.1 → 9.0.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/AGENTS.md +2 -357
- package/CHANGELOG.md +162 -6
- package/CLAUDE.md +138 -2
- package/README.md +1 -1
- package/lib/context/defaults.d.ts +7 -0
- package/lib/context/defaults.js +74 -30
- package/lib/context/directory/handlers/actionModules.js +8 -5
- package/lib/context/directory/handlers/actions.js +8 -4
- package/lib/context/directory/handlers/attackProtection.js +1 -1
- package/lib/context/directory/handlers/branding.js +4 -1
- package/lib/context/directory/handlers/clientAuthCredentials.d.ts +5 -0
- package/lib/context/directory/handlers/clientAuthCredentials.js +13 -0
- package/lib/context/directory/handlers/clientGrants.js +78 -24
- package/lib/context/directory/handlers/clients.js +20 -3
- package/lib/context/directory/handlers/connections.js +19 -5
- package/lib/context/directory/handlers/databases.js +2 -4
- package/lib/context/directory/handlers/emailTemplates.js +5 -0
- package/lib/context/directory/handlers/guardianEmailFactorSettings.d.ts +5 -0
- package/lib/context/directory/handlers/guardianEmailFactorSettings.js +38 -0
- package/lib/context/directory/handlers/guardianPhoneFactorSettings.d.ts +5 -0
- package/lib/context/directory/handlers/guardianPhoneFactorSettings.js +38 -0
- package/lib/context/directory/handlers/guardianSettings.d.ts +5 -0
- package/lib/context/directory/handlers/guardianSettings.js +38 -0
- package/lib/context/directory/handlers/hooks.js +8 -1
- package/lib/context/directory/handlers/index.js +12 -0
- package/lib/context/directory/handlers/networkACLKeys.d.ts +6 -0
- package/lib/context/directory/handlers/networkACLKeys.js +54 -0
- package/lib/context/directory/handlers/prompts.js +7 -3
- package/lib/context/directory/handlers/rateLimitPolicies.d.ts +6 -0
- package/lib/context/directory/handlers/rateLimitPolicies.js +53 -0
- package/lib/context/directory/handlers/rules.js +8 -1
- package/lib/context/directory/index.js +4 -7
- package/lib/context/index.js +31 -31
- package/lib/context/yaml/handlers/attackProtection.js +1 -1
- package/lib/context/yaml/handlers/branding.js +4 -1
- package/lib/context/yaml/handlers/clientAuthCredentials.d.ts +5 -0
- package/lib/context/yaml/handlers/clientAuthCredentials.js +13 -0
- package/lib/context/yaml/handlers/clients.js +19 -1
- package/lib/context/yaml/handlers/connections.js +8 -1
- package/lib/context/yaml/handlers/flows.js +3 -0
- package/lib/context/yaml/handlers/forms.js +3 -0
- package/lib/context/yaml/handlers/guardianEmailFactorSettings.d.ts +5 -0
- package/lib/context/yaml/handlers/guardianEmailFactorSettings.js +15 -0
- package/lib/context/yaml/handlers/guardianPhoneFactorSettings.d.ts +5 -0
- package/lib/context/yaml/handlers/guardianPhoneFactorSettings.js +15 -0
- package/lib/context/yaml/handlers/guardianSettings.d.ts +5 -0
- package/lib/context/yaml/handlers/guardianSettings.js +15 -0
- package/lib/context/yaml/handlers/index.js +12 -0
- package/lib/context/yaml/handlers/networkACLKeys.d.ts +6 -0
- package/lib/context/yaml/handlers/networkACLKeys.js +42 -0
- package/lib/context/yaml/handlers/prompts.js +3 -1
- package/lib/context/yaml/handlers/rateLimitPolicies.d.ts +6 -0
- package/lib/context/yaml/handlers/rateLimitPolicies.js +27 -0
- package/lib/context/yaml/index.js +3 -5
- package/lib/keywordPreservation.d.ts +1 -1
- package/lib/keywordPreservation.js +2 -1
- package/lib/readonly.js +5 -0
- package/lib/tools/auth0/handlers/attackProtection.js +19 -6
- package/lib/tools/auth0/handlers/clientAuthCredentials.d.ts +27 -0
- package/lib/tools/auth0/handlers/clientAuthCredentials.js +234 -0
- package/lib/tools/auth0/handlers/clientAuthCredentialsPre.d.ts +38 -0
- package/lib/tools/auth0/handlers/clientAuthCredentialsPre.js +123 -0
- package/lib/tools/auth0/handlers/clientGrants.d.ts +1 -1
- package/lib/tools/auth0/handlers/clients.d.ts +106 -0
- package/lib/tools/auth0/handlers/clients.js +206 -2
- package/lib/tools/auth0/handlers/connectionProfiles.d.ts +27 -0
- package/lib/tools/auth0/handlers/connectionProfiles.js +30 -0
- package/lib/tools/auth0/handlers/connections.d.ts +32 -6
- package/lib/tools/auth0/handlers/connections.js +49 -7
- package/lib/tools/auth0/handlers/databases.d.ts +28 -0
- package/lib/tools/auth0/handlers/databases.js +58 -24
- package/lib/tools/auth0/handlers/default.d.ts +23 -0
- package/lib/tools/auth0/handlers/default.js +47 -29
- package/lib/tools/auth0/handlers/eventStreams.js +10 -2
- package/lib/tools/auth0/handlers/guardianEmailFactorSettings.d.ts +22 -0
- package/lib/tools/auth0/handlers/guardianEmailFactorSettings.js +77 -0
- package/lib/tools/auth0/handlers/guardianFactorTemplates.js +13 -4
- package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.js +11 -9
- package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.js +11 -9
- package/lib/tools/auth0/handlers/guardianPhoneFactorSettings.d.ts +22 -0
- package/lib/tools/auth0/handlers/guardianPhoneFactorSettings.js +77 -0
- package/lib/tools/auth0/handlers/guardianPolicies.js +11 -1
- package/lib/tools/auth0/handlers/guardianSettings.d.ts +30 -0
- package/lib/tools/auth0/handlers/guardianSettings.js +85 -0
- package/lib/tools/auth0/handlers/hooks.js +1 -1
- package/lib/tools/auth0/handlers/index.js +16 -0
- package/lib/tools/auth0/handlers/networkACLKeys.d.ts +45 -0
- package/lib/tools/auth0/handlers/networkACLKeys.js +177 -0
- package/lib/tools/auth0/handlers/networkACLs.d.ts +132 -2
- package/lib/tools/auth0/handlers/networkACLs.js +100 -16
- package/lib/tools/auth0/handlers/organizations.d.ts +33 -1
- package/lib/tools/auth0/handlers/organizations.js +177 -19
- package/lib/tools/auth0/handlers/phoneProvider.js +10 -2
- package/lib/tools/auth0/handlers/phoneTemplates.d.ts +4 -1
- package/lib/tools/auth0/handlers/phoneTemplates.js +67 -10
- package/lib/tools/auth0/handlers/prompts.js +1 -1
- package/lib/tools/auth0/handlers/rateLimitPolicies.d.ts +81 -0
- package/lib/tools/auth0/handlers/rateLimitPolicies.js +203 -0
- package/lib/tools/auth0/handlers/resourceServers.d.ts +44 -0
- package/lib/tools/auth0/handlers/resourceServers.js +44 -0
- package/lib/tools/auth0/handlers/riskAssessment.d.ts +1 -1
- package/lib/tools/auth0/handlers/riskAssessment.js +19 -1
- package/lib/tools/auth0/handlers/roles.d.ts +4 -0
- package/lib/tools/auth0/handlers/roles.js +10 -0
- package/lib/tools/auth0/handlers/rules.js +19 -7
- package/lib/tools/auth0/handlers/tenant.d.ts +45 -0
- package/lib/tools/auth0/handlers/tenant.js +48 -0
- package/lib/tools/auth0/handlers/themes.d.ts +37 -1
- package/lib/tools/auth0/handlers/themes.js +64 -0
- package/lib/tools/auth0/handlers/tokenExchangeProfiles.js +3 -1
- package/lib/tools/auth0/index.js +12 -6
- package/lib/tools/calculateDryRunChanges.js +12 -8
- package/lib/tools/constants.d.ts +2 -0
- package/lib/tools/constants.js +3 -0
- package/lib/tools/utils.d.ts +3 -0
- package/lib/tools/utils.js +41 -2
- package/lib/types.d.ts +9 -1
- package/lib/utils.d.ts +6 -0
- package/lib/utils.js +17 -2
- package/package.json +2 -2
- package/references/code-style.md +133 -0
- package/references/commands.md +98 -0
- package/references/docs-update.md +34 -0
- package/references/git-workflow.md +135 -0
- package/references/pitfalls.md +62 -0
- package/references/testing.md +118 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.schema = void 0;
|
|
7
|
+
const default_1 = __importDefault(require("./default"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
exports.schema = {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
otp_length: {
|
|
13
|
+
type: 'number',
|
|
14
|
+
description: 'The length of the OTP code.',
|
|
15
|
+
},
|
|
16
|
+
otp_expiration_time: {
|
|
17
|
+
type: 'number',
|
|
18
|
+
description: 'The OTP expiration time in seconds.',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
additionalProperties: false,
|
|
22
|
+
};
|
|
23
|
+
class GuardianEmailFactorSettingsHandler extends default_1.default {
|
|
24
|
+
constructor(options) {
|
|
25
|
+
super({
|
|
26
|
+
...options,
|
|
27
|
+
type: 'guardianEmailFactorSettings',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async getType() {
|
|
31
|
+
if (this.existing)
|
|
32
|
+
return this.existing;
|
|
33
|
+
try {
|
|
34
|
+
const data = await this.client.guardian.factors.email.get();
|
|
35
|
+
this.existing = data;
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
if ((0, utils_1.isFeatureUnavailableError)(err)) {
|
|
39
|
+
// Gracefully skip processing this configuration value.
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
throw err;
|
|
46
|
+
}
|
|
47
|
+
return this.existing;
|
|
48
|
+
}
|
|
49
|
+
async processChanges(assets) {
|
|
50
|
+
// No API to delete or create guardianEmailFactorSettings, we can only update.
|
|
51
|
+
const { guardianEmailFactorSettings } = assets;
|
|
52
|
+
// Do nothing if not set
|
|
53
|
+
if (!guardianEmailFactorSettings) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if ((0, utils_1.isDryRun)(this.config)) {
|
|
57
|
+
const { del, update, create } = await this.calcChanges(assets);
|
|
58
|
+
if (create.length === 0 && update.length === 0 && del.length === 0) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
await this.client.guardian.factors.email.set(guardianEmailFactorSettings);
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
if ((0, utils_1.isFeatureUnavailableError)(err) || (0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
67
|
+
// Feature is unavailable (404) or disabled (403) on this tenant; skip instead of failing
|
|
68
|
+
// the import. The 403 path logs a warning via isForbiddenFeatureError; the 404 path is silent.
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
throw err;
|
|
72
|
+
}
|
|
73
|
+
this.updated += 1;
|
|
74
|
+
this.didUpdate(guardianEmailFactorSettings);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.default = GuardianEmailFactorSettingsHandler;
|
|
@@ -60,11 +60,20 @@ class GuardianFactorTemplatesHandler extends default_1.default {
|
|
|
60
60
|
await Promise.all(guardianFactorTemplates.map(async (fatorTemplates) => {
|
|
61
61
|
const { name, ...data } = fatorTemplates;
|
|
62
62
|
const params = { name: fatorTemplates.name };
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
try {
|
|
64
|
+
if (name === 'sms') {
|
|
65
|
+
await this.client.guardian.factors.sms.setTemplates(data);
|
|
66
|
+
}
|
|
67
|
+
else if (name === 'phone') {
|
|
68
|
+
await this.client.guardian.factors.phone.setTemplates(data);
|
|
69
|
+
}
|
|
65
70
|
}
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
catch (err) {
|
|
72
|
+
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
73
|
+
// Feature is deprecated/disabled on this tenant; warn and skip instead of failing the import.
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
throw err;
|
|
68
77
|
}
|
|
69
78
|
this.didUpdate(params);
|
|
70
79
|
this.updated += 1;
|
|
@@ -25,14 +25,7 @@ const isFeatureUnavailableError = (err) => {
|
|
|
25
25
|
// Older Management API version where the endpoint is not available.
|
|
26
26
|
return true;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
err.originalError &&
|
|
30
|
-
err.originalError.response &&
|
|
31
|
-
err.originalError.response.body &&
|
|
32
|
-
err.originalError.response.body.errorCode === 'voice_mfa_not_allowed') {
|
|
33
|
-
// Recent Management API version, but with feature explicitly disabled.
|
|
34
|
-
return true;
|
|
35
|
-
}
|
|
28
|
+
// 403s (feature explicitly disabled) are handled by isForbiddenFeatureError.
|
|
36
29
|
return false;
|
|
37
30
|
};
|
|
38
31
|
class GuardianPhoneMessageTypesHandler extends default_1.default {
|
|
@@ -75,7 +68,16 @@ class GuardianPhoneMessageTypesHandler extends default_1.default {
|
|
|
75
68
|
}
|
|
76
69
|
}
|
|
77
70
|
const data = guardianPhoneFactorMessageTypes;
|
|
78
|
-
|
|
71
|
+
try {
|
|
72
|
+
await this.client.guardian.factors.phone.setMessageTypes(data);
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
if (isFeatureUnavailableError(err) || (0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
76
|
+
// Feature is deprecated/disabled on this tenant; warn and skip instead of failing the import.
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
throw err;
|
|
80
|
+
}
|
|
79
81
|
this.updated += 1;
|
|
80
82
|
this.didUpdate(guardianPhoneFactorMessageTypes);
|
|
81
83
|
}
|
|
@@ -22,14 +22,7 @@ const isFeatureUnavailableError = (err) => {
|
|
|
22
22
|
// Older Management API version where the endpoint is not available.
|
|
23
23
|
return true;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
err.originalError &&
|
|
27
|
-
err.originalError.response &&
|
|
28
|
-
err.originalError.response.body &&
|
|
29
|
-
err.originalError.response.body.errorCode === 'hooks_not_allowed') {
|
|
30
|
-
// Recent Management API version, but with feature explicitly disabled.
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
25
|
+
// 403s (feature explicitly disabled) are handled by isForbiddenFeatureError.
|
|
33
26
|
return false;
|
|
34
27
|
};
|
|
35
28
|
class GuardianPhoneSelectedProviderHandler extends default_1.default {
|
|
@@ -72,7 +65,16 @@ class GuardianPhoneSelectedProviderHandler extends default_1.default {
|
|
|
72
65
|
}
|
|
73
66
|
}
|
|
74
67
|
const data = guardianPhoneFactorSelectedProvider;
|
|
75
|
-
|
|
68
|
+
try {
|
|
69
|
+
await this.client.guardian.factors.phone.setProvider(data);
|
|
70
|
+
}
|
|
71
|
+
catch (err) {
|
|
72
|
+
if (isFeatureUnavailableError(err) || (0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
73
|
+
// Feature is deprecated/disabled on this tenant; warn and skip instead of failing the import.
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
throw err;
|
|
77
|
+
}
|
|
76
78
|
this.updated += 1;
|
|
77
79
|
this.didUpdate(guardianPhoneFactorSelectedProvider);
|
|
78
80
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import DefaultHandler from './default';
|
|
2
|
+
import { Asset, Assets } from '../../../types';
|
|
3
|
+
export declare const schema: {
|
|
4
|
+
type: string;
|
|
5
|
+
properties: {
|
|
6
|
+
otp_length: {
|
|
7
|
+
type: string;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
otp_expiration_time: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
additionalProperties: boolean;
|
|
16
|
+
};
|
|
17
|
+
export default class GuardianPhoneFactorSettingsHandler extends DefaultHandler {
|
|
18
|
+
existing: Asset;
|
|
19
|
+
constructor(options: any);
|
|
20
|
+
getType(): Promise<Asset | null>;
|
|
21
|
+
processChanges(assets: Assets): Promise<void>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.schema = void 0;
|
|
7
|
+
const default_1 = __importDefault(require("./default"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
exports.schema = {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
otp_length: {
|
|
13
|
+
type: 'number',
|
|
14
|
+
description: 'The length of the OTP code.',
|
|
15
|
+
},
|
|
16
|
+
otp_expiration_time: {
|
|
17
|
+
type: 'number',
|
|
18
|
+
description: 'The OTP expiration time in seconds.',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
additionalProperties: false,
|
|
22
|
+
};
|
|
23
|
+
class GuardianPhoneFactorSettingsHandler extends default_1.default {
|
|
24
|
+
constructor(options) {
|
|
25
|
+
super({
|
|
26
|
+
...options,
|
|
27
|
+
type: 'guardianPhoneFactorSettings',
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
async getType() {
|
|
31
|
+
if (this.existing)
|
|
32
|
+
return this.existing;
|
|
33
|
+
try {
|
|
34
|
+
const data = await this.client.guardian.factors.phone.get();
|
|
35
|
+
this.existing = data;
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
if ((0, utils_1.isFeatureUnavailableError)(err)) {
|
|
39
|
+
// Gracefully skip processing this configuration value.
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
throw err;
|
|
46
|
+
}
|
|
47
|
+
return this.existing;
|
|
48
|
+
}
|
|
49
|
+
async processChanges(assets) {
|
|
50
|
+
// No API to delete or create guardianPhoneFactorSettings, we can only update.
|
|
51
|
+
const { guardianPhoneFactorSettings } = assets;
|
|
52
|
+
// Do nothing if not set
|
|
53
|
+
if (!guardianPhoneFactorSettings) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if ((0, utils_1.isDryRun)(this.config)) {
|
|
57
|
+
const { del, update, create } = await this.calcChanges(assets);
|
|
58
|
+
if (create.length === 0 && update.length === 0 && del.length === 0) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
await this.client.guardian.factors.phone.set(guardianPhoneFactorSettings);
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
if ((0, utils_1.isFeatureUnavailableError)(err) || (0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
67
|
+
// Feature is unavailable (404) or disabled (403) on this tenant; skip instead of failing
|
|
68
|
+
// the import. The 403 path logs a warning via isForbiddenFeatureError; the 404 path is silent.
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
throw err;
|
|
72
|
+
}
|
|
73
|
+
this.updated += 1;
|
|
74
|
+
this.didUpdate(guardianPhoneFactorSettings);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.default = GuardianPhoneFactorSettingsHandler;
|
|
@@ -7,6 +7,7 @@ exports.schema = void 0;
|
|
|
7
7
|
const default_1 = __importDefault(require("./default"));
|
|
8
8
|
const constants_1 = __importDefault(require("../../constants"));
|
|
9
9
|
const utils_1 = require("../../utils");
|
|
10
|
+
const logger_1 = __importDefault(require("../../../logger"));
|
|
10
11
|
exports.schema = {
|
|
11
12
|
type: 'object',
|
|
12
13
|
properties: {
|
|
@@ -48,7 +49,16 @@ class GuardianPoliciesHandler extends default_1.default {
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
const data = guardianPolicies.policies;
|
|
51
|
-
|
|
52
|
+
try {
|
|
53
|
+
await this.client.guardian.policies.set(data);
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
if ((0, utils_1.isInsufficientEntitlementError)(err)) {
|
|
57
|
+
logger_1.default.warn('Skipping guardianPolicies deploy: tenant does not have Adaptive MFA entitlement (confidence-score requires an Enterprise add-on)');
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
throw err;
|
|
61
|
+
}
|
|
52
62
|
this.updated += 1;
|
|
53
63
|
this.didUpdate(guardianPolicies);
|
|
54
64
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import DefaultHandler from './default';
|
|
2
|
+
import { Asset, Assets } from '../../../types';
|
|
3
|
+
export declare const schema: {
|
|
4
|
+
type: string;
|
|
5
|
+
properties: {
|
|
6
|
+
display_remember_me_checkbox: {
|
|
7
|
+
type: string;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
remember_me_default_value: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
mfa_session_inactivity_timeout: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
mfa_session_overall_timeout: {
|
|
19
|
+
type: string;
|
|
20
|
+
description: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
additionalProperties: boolean;
|
|
24
|
+
};
|
|
25
|
+
export default class GuardianSettingsHandler extends DefaultHandler {
|
|
26
|
+
existing: Asset;
|
|
27
|
+
constructor(options: any);
|
|
28
|
+
getType(): Promise<Asset | null>;
|
|
29
|
+
processChanges(assets: Assets): Promise<void>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.schema = void 0;
|
|
7
|
+
const default_1 = __importDefault(require("./default"));
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
|
+
exports.schema = {
|
|
10
|
+
type: 'object',
|
|
11
|
+
properties: {
|
|
12
|
+
display_remember_me_checkbox: {
|
|
13
|
+
type: 'boolean',
|
|
14
|
+
description: 'Determines whether to display the "Remember Me" checkbox on the MFA prompt in Universal Login.',
|
|
15
|
+
},
|
|
16
|
+
remember_me_default_value: {
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
description: 'Determines the default state of the "Remember Me" checkbox on the MFA prompt in Universal Login.',
|
|
19
|
+
},
|
|
20
|
+
mfa_session_inactivity_timeout: {
|
|
21
|
+
type: 'number',
|
|
22
|
+
description: 'Duration of inactivity (seconds) after which the user will be prompted for MFA. Cannot exceed the overall timeout.',
|
|
23
|
+
},
|
|
24
|
+
mfa_session_overall_timeout: {
|
|
25
|
+
type: 'number',
|
|
26
|
+
description: 'Maximum duration (seconds) after which the user will be prompted for MFA regardless of activity.',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
additionalProperties: false,
|
|
30
|
+
};
|
|
31
|
+
class GuardianSettingsHandler extends default_1.default {
|
|
32
|
+
constructor(options) {
|
|
33
|
+
super({
|
|
34
|
+
...options,
|
|
35
|
+
type: 'guardianSettings',
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
async getType() {
|
|
39
|
+
if (this.existing)
|
|
40
|
+
return this.existing;
|
|
41
|
+
try {
|
|
42
|
+
const data = await this.client.guardian.get();
|
|
43
|
+
this.existing = data;
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
if ((0, utils_1.isFeatureUnavailableError)(err)) {
|
|
47
|
+
// Gracefully skip processing this configuration value.
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
if ((0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
throw err;
|
|
54
|
+
}
|
|
55
|
+
return this.existing;
|
|
56
|
+
}
|
|
57
|
+
async processChanges(assets) {
|
|
58
|
+
// No API to delete or create guardianSettings, we can only update.
|
|
59
|
+
const { guardianSettings } = assets;
|
|
60
|
+
// Do nothing if not set
|
|
61
|
+
if (!guardianSettings) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if ((0, utils_1.isDryRun)(this.config)) {
|
|
65
|
+
const { del, update, create } = await this.calcChanges(assets);
|
|
66
|
+
if (create.length === 0 && update.length === 0 && del.length === 0) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
await this.client.guardian.set(guardianSettings);
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
if ((0, utils_1.isFeatureUnavailableError)(err) || (0, utils_1.isForbiddenFeatureError)(err, this.type)) {
|
|
75
|
+
// Feature is unavailable (404) or disabled (403) on this tenant; skip instead of failing
|
|
76
|
+
// the import. The 403 path logs a warning via isForbiddenFeatureError; the 404 path is silent.
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
throw err;
|
|
80
|
+
}
|
|
81
|
+
this.updated += 1;
|
|
82
|
+
this.didUpdate(guardianSettings);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.default = GuardianSettingsHandler;
|
|
@@ -151,7 +151,7 @@ class HooksHandler extends default_1.default {
|
|
|
151
151
|
.get(hook.id)
|
|
152
152
|
.then((hookWithCode) => this.client.hooks.secrets
|
|
153
153
|
.get(hook.id)
|
|
154
|
-
.then((
|
|
154
|
+
.then((secrets) => ({ ...hookWithCode, secrets })))));
|
|
155
155
|
return this.existing;
|
|
156
156
|
}
|
|
157
157
|
catch (err) {
|
|
@@ -51,6 +51,9 @@ const guardianFactorTemplates = __importStar(require("./guardianFactorTemplates"
|
|
|
51
51
|
const guardianPolicies = __importStar(require("./guardianPolicies"));
|
|
52
52
|
const guardianPhoneFactorSelectedProvider = __importStar(require("./guardianPhoneFactorSelectedProvider"));
|
|
53
53
|
const guardianPhoneFactorMessageTypes = __importStar(require("./guardianPhoneFactorMessageTypes"));
|
|
54
|
+
const guardianPhoneFactorSettings = __importStar(require("./guardianPhoneFactorSettings"));
|
|
55
|
+
const guardianEmailFactorSettings = __importStar(require("./guardianEmailFactorSettings"));
|
|
56
|
+
const guardianSettings = __importStar(require("./guardianSettings"));
|
|
54
57
|
const roles = __importStar(require("./roles"));
|
|
55
58
|
const branding = __importStar(require("./branding"));
|
|
56
59
|
const phoneProviders = __importStar(require("./phoneProvider"));
|
|
@@ -69,12 +72,16 @@ const forms = __importStar(require("./forms"));
|
|
|
69
72
|
const flows = __importStar(require("./flows"));
|
|
70
73
|
const flowVaultConnections = __importStar(require("./flowVaultConnections"));
|
|
71
74
|
const selfServiceProfiles = __importStar(require("./selfServiceProfiles"));
|
|
75
|
+
const networkACLKeys = __importStar(require("./networkACLKeys"));
|
|
72
76
|
const networkACLs = __importStar(require("./networkACLs"));
|
|
73
77
|
const userAttributeProfiles = __importStar(require("./userAttributeProfiles"));
|
|
74
78
|
const connectionProfiles = __importStar(require("./connectionProfiles"));
|
|
75
79
|
const tokenExchangeProfiles = __importStar(require("./tokenExchangeProfiles"));
|
|
76
80
|
const supplementalSignals = __importStar(require("./supplementalSignals"));
|
|
81
|
+
const rateLimitPolicies = __importStar(require("./rateLimitPolicies"));
|
|
77
82
|
const eventStreams = __importStar(require("./eventStreams"));
|
|
83
|
+
const clientAuthCredentials = __importStar(require("./clientAuthCredentials"));
|
|
84
|
+
const clientAuthCredentialsPre = __importStar(require("./clientAuthCredentialsPre"));
|
|
78
85
|
const auth0ApiHandlers = {
|
|
79
86
|
rules,
|
|
80
87
|
rulesConfigs,
|
|
@@ -94,6 +101,9 @@ const auth0ApiHandlers = {
|
|
|
94
101
|
guardianPolicies,
|
|
95
102
|
guardianPhoneFactorSelectedProvider,
|
|
96
103
|
guardianPhoneFactorMessageTypes,
|
|
104
|
+
guardianPhoneFactorSettings,
|
|
105
|
+
guardianEmailFactorSettings,
|
|
106
|
+
guardianSettings,
|
|
97
107
|
roles,
|
|
98
108
|
branding,
|
|
99
109
|
phoneProviders,
|
|
@@ -113,11 +123,17 @@ const auth0ApiHandlers = {
|
|
|
113
123
|
flows,
|
|
114
124
|
flowVaultConnections,
|
|
115
125
|
selfServiceProfiles,
|
|
126
|
+
networkACLKeys,
|
|
116
127
|
networkACLs,
|
|
117
128
|
userAttributeProfiles,
|
|
118
129
|
connectionProfiles,
|
|
119
130
|
tokenExchangeProfiles,
|
|
120
131
|
supplementalSignals,
|
|
132
|
+
rateLimitPolicies,
|
|
121
133
|
eventStreams,
|
|
134
|
+
clientAuthCredentials,
|
|
135
|
+
// clientAuthCredentialsPre is a deploy-only pre-pass handler (order 40) — not a user-facing
|
|
136
|
+
// asset type so it is not in AssetTypes, but must be registered here to run during deploy.
|
|
137
|
+
...{ clientAuthCredentialsPre },
|
|
122
138
|
};
|
|
123
139
|
exports.default = auth0ApiHandlers; // TODO: apply stronger types to schema properties
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Management } from 'auth0';
|
|
2
|
+
import DefaultAPIHandler from './default';
|
|
3
|
+
import { Asset, Assets, CalculatedChanges } from '../../../types';
|
|
4
|
+
export type NetworkAclKey = Management.NetworkAclKey & {
|
|
5
|
+
value?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const schema: {
|
|
8
|
+
type: string;
|
|
9
|
+
description: string;
|
|
10
|
+
items: {
|
|
11
|
+
type: string;
|
|
12
|
+
required: string[];
|
|
13
|
+
properties: {
|
|
14
|
+
id: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
name: {
|
|
18
|
+
type: string;
|
|
19
|
+
maxLength: number;
|
|
20
|
+
};
|
|
21
|
+
alg: {
|
|
22
|
+
type: string;
|
|
23
|
+
enum: string[];
|
|
24
|
+
};
|
|
25
|
+
value: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
fingerprint: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
additionalProperties: boolean;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export default class NetworkACLKeysHandler extends DefaultAPIHandler {
|
|
36
|
+
existing: NetworkAclKey[] | null;
|
|
37
|
+
constructor(config: DefaultAPIHandler);
|
|
38
|
+
objString(key: NetworkAclKey): string;
|
|
39
|
+
getType(): Promise<Asset | null>;
|
|
40
|
+
processChanges(assets: Assets): Promise<void>;
|
|
41
|
+
createNetworkACLKey(key: NetworkAclKey): Promise<void>;
|
|
42
|
+
createNetworkACLKeys(creates: CalculatedChanges['create']): Promise<void>;
|
|
43
|
+
deleteNetworkACLKey(key: NetworkAclKey): Promise<void>;
|
|
44
|
+
deleteNetworkACLKeys(data: Asset[]): Promise<void>;
|
|
45
|
+
}
|