auth0-deploy-cli 9.0.0-beta.2 → 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 +158 -10
- 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 +1 -4
- package/lib/context/directory/handlers/actions.js +1 -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 +1 -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 +1 -4
- 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 +1 -4
- package/lib/context/directory/index.js +1 -4
- 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 +1 -4
- 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,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
42
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.schema = void 0;
|
|
46
|
+
const default_1 = __importStar(require("./default"));
|
|
47
|
+
const logger_1 = __importDefault(require("../../../logger"));
|
|
48
|
+
exports.schema = {
|
|
49
|
+
type: 'array',
|
|
50
|
+
description: 'List of Network ACL keys for HMAC signature verification',
|
|
51
|
+
items: {
|
|
52
|
+
type: 'object',
|
|
53
|
+
required: ['name', 'alg'],
|
|
54
|
+
properties: {
|
|
55
|
+
id: { type: 'string' },
|
|
56
|
+
name: { type: 'string', maxLength: 255 },
|
|
57
|
+
alg: { type: 'string', enum: ['hmac-sha256'] },
|
|
58
|
+
// value is write-only and never returned by the API.
|
|
59
|
+
// Provide it at deploy time via keyword replacement (e.g. ##HMAC_KEY_VALUE##).
|
|
60
|
+
// It is not exported and is omitted from exported configs.
|
|
61
|
+
value: { type: 'string' },
|
|
62
|
+
fingerprint: { type: 'string' },
|
|
63
|
+
},
|
|
64
|
+
additionalProperties: false,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
class NetworkACLKeysHandler extends default_1.default {
|
|
68
|
+
constructor(config) {
|
|
69
|
+
super({
|
|
70
|
+
...config,
|
|
71
|
+
type: 'networkACLKeys',
|
|
72
|
+
id: 'id',
|
|
73
|
+
identifiers: ['name'],
|
|
74
|
+
// value is write-only (never returned by API) and fingerprint/timestamps are
|
|
75
|
+
// API-generated — ignore all of them when computing dry-run diffs so keys
|
|
76
|
+
// with a local `value` don't show phantom UPDATEs.
|
|
77
|
+
ignoreDryRunFields: ['value', 'fingerprint', 'created_at', 'updated_at'],
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
objString(key) {
|
|
81
|
+
return super.objString({ name: key.name, alg: key.alg });
|
|
82
|
+
}
|
|
83
|
+
async getType() {
|
|
84
|
+
if (this.existing)
|
|
85
|
+
return this.existing;
|
|
86
|
+
try {
|
|
87
|
+
// Not paginated — tenant cap is 10 keys. Returns { keys: [...] }.
|
|
88
|
+
const result = await this.client.keys.networkAcls.list();
|
|
89
|
+
this.existing = result.keys;
|
|
90
|
+
return this.existing;
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
if (err.statusCode === 404 || err.statusCode === 501) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
if (err.statusCode === 403) {
|
|
97
|
+
logger_1.default.debug('Network ACL key management is not enabled for this tenant. Please verify `scope` or contact Auth0 support.');
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async processChanges(assets) {
|
|
104
|
+
const { networkACLKeys } = assets;
|
|
105
|
+
// Do nothing if not set
|
|
106
|
+
if (!networkACLKeys)
|
|
107
|
+
return;
|
|
108
|
+
const { del, create } = await this.calcChanges(assets);
|
|
109
|
+
// Keys are immutable after creation — there is no update operation.
|
|
110
|
+
// A detected "update" (same name, different config) is a no-op: the existing key is kept as-is.
|
|
111
|
+
logger_1.default.debug(`Start processChanges for networkACLKeys [delete:${del.length}] [create:${create.length}]`);
|
|
112
|
+
await Promise.all([this.deleteNetworkACLKeys(del), this.createNetworkACLKeys(create)]);
|
|
113
|
+
}
|
|
114
|
+
async createNetworkACLKey(key) {
|
|
115
|
+
if (!key.value) {
|
|
116
|
+
logger_1.default.warn(`Skipping creation of Network ACL key "${key.name}": ` +
|
|
117
|
+
`'value' is required to create a key but is not present in the config. ` +
|
|
118
|
+
`Supply the key material via keyword replacement (e.g. ##HMAC_KEY_VALUE##) or create the key out-of-band.`);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
await this.client.keys.networkAcls.create({
|
|
122
|
+
name: key.name,
|
|
123
|
+
alg: key.alg,
|
|
124
|
+
value: key.value,
|
|
125
|
+
});
|
|
126
|
+
this.didCreate(key);
|
|
127
|
+
this.created += 1;
|
|
128
|
+
}
|
|
129
|
+
async createNetworkACLKeys(creates) {
|
|
130
|
+
await this.client.pool
|
|
131
|
+
.addEachTask({
|
|
132
|
+
data: creates || [],
|
|
133
|
+
generator: (item) => this.createNetworkACLKey(item).catch((err) => {
|
|
134
|
+
throw new Error(`Problem creating ${this.type} ${this.objString(item)}\n${err}`);
|
|
135
|
+
}),
|
|
136
|
+
})
|
|
137
|
+
.promise();
|
|
138
|
+
}
|
|
139
|
+
async deleteNetworkACLKey(key) {
|
|
140
|
+
if (!key.id) {
|
|
141
|
+
throw new Error(`Missing id for ${this.type} ${this.objString(key)}`);
|
|
142
|
+
}
|
|
143
|
+
await this.client.keys.networkAcls.delete(key.id);
|
|
144
|
+
}
|
|
145
|
+
async deleteNetworkACLKeys(data) {
|
|
146
|
+
if (!data || data.length === 0)
|
|
147
|
+
return;
|
|
148
|
+
if (this.config('AUTH0_ALLOW_DELETE') === 'true' ||
|
|
149
|
+
this.config('AUTH0_ALLOW_DELETE') === true) {
|
|
150
|
+
await this.client.pool
|
|
151
|
+
.addEachTask({
|
|
152
|
+
data: data || [],
|
|
153
|
+
generator: (item) => this.deleteNetworkACLKey(item)
|
|
154
|
+
.then(() => {
|
|
155
|
+
this.didDelete(item);
|
|
156
|
+
this.deleted += 1;
|
|
157
|
+
})
|
|
158
|
+
.catch((err) => {
|
|
159
|
+
if (err.statusCode === 409) {
|
|
160
|
+
throw new Error(`Cannot delete Network ACL key "${item.name}" — it is still referenced by one or more ACL rules. ` +
|
|
161
|
+
`Remove the key reference from all ACL rules first.\n${err}`);
|
|
162
|
+
}
|
|
163
|
+
throw new Error(`Problem deleting ${this.type} ${this.objString(item)}\n${err}`);
|
|
164
|
+
}),
|
|
165
|
+
})
|
|
166
|
+
.promise();
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
logger_1.default.warn(`Detected the following ${this.type} should be deleted. Doing so may be destructive.\nYou can enable deletes by setting 'AUTH0_ALLOW_DELETE' to true in the config
|
|
170
|
+
\n${data.map((i) => this.objString(i)).join('\n')}`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
exports.default = NetworkACLKeysHandler;
|
|
175
|
+
__decorate([
|
|
176
|
+
(0, default_1.order)(60)
|
|
177
|
+
], NetworkACLKeysHandler.prototype, "processChanges", null);
|
|
@@ -21,7 +21,7 @@ export declare const schema: {
|
|
|
21
21
|
minimum: number;
|
|
22
22
|
};
|
|
23
23
|
rule: {
|
|
24
|
-
anyOf: {
|
|
24
|
+
anyOf: ({
|
|
25
25
|
type: string;
|
|
26
26
|
required: string[];
|
|
27
27
|
properties: {
|
|
@@ -85,6 +85,15 @@ export declare const schema: {
|
|
|
85
85
|
uniqueItems: boolean;
|
|
86
86
|
minItems: number;
|
|
87
87
|
};
|
|
88
|
+
auth0_managed: {
|
|
89
|
+
type: string;
|
|
90
|
+
items: {
|
|
91
|
+
type: string;
|
|
92
|
+
pattern: string;
|
|
93
|
+
};
|
|
94
|
+
uniqueItems: boolean;
|
|
95
|
+
minItems: number;
|
|
96
|
+
};
|
|
88
97
|
geo_country_codes: {
|
|
89
98
|
type: string;
|
|
90
99
|
items: {
|
|
@@ -162,6 +171,29 @@ export declare const schema: {
|
|
|
162
171
|
};
|
|
163
172
|
uniqueItems: boolean;
|
|
164
173
|
};
|
|
174
|
+
http_message_signature: {
|
|
175
|
+
type: string;
|
|
176
|
+
properties: {
|
|
177
|
+
keys: {
|
|
178
|
+
type: string;
|
|
179
|
+
minItems: number;
|
|
180
|
+
maxItems: number;
|
|
181
|
+
uniqueItems: boolean;
|
|
182
|
+
items: {
|
|
183
|
+
type: string;
|
|
184
|
+
properties: {
|
|
185
|
+
id: {
|
|
186
|
+
type: string;
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
required: string[];
|
|
190
|
+
additionalProperties: boolean;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
required: string[];
|
|
195
|
+
additionalProperties: boolean;
|
|
196
|
+
};
|
|
165
197
|
};
|
|
166
198
|
additionalProperties: boolean;
|
|
167
199
|
};
|
|
@@ -176,6 +208,15 @@ export declare const schema: {
|
|
|
176
208
|
uniqueItems: boolean;
|
|
177
209
|
minItems: number;
|
|
178
210
|
};
|
|
211
|
+
auth0_managed: {
|
|
212
|
+
type: string;
|
|
213
|
+
items: {
|
|
214
|
+
type: string;
|
|
215
|
+
pattern: string;
|
|
216
|
+
};
|
|
217
|
+
uniqueItems: boolean;
|
|
218
|
+
minItems: number;
|
|
219
|
+
};
|
|
179
220
|
geo_country_codes: {
|
|
180
221
|
type: string;
|
|
181
222
|
items: {
|
|
@@ -253,6 +294,29 @@ export declare const schema: {
|
|
|
253
294
|
};
|
|
254
295
|
uniqueItems: boolean;
|
|
255
296
|
};
|
|
297
|
+
http_message_signature: {
|
|
298
|
+
type: string;
|
|
299
|
+
properties: {
|
|
300
|
+
keys: {
|
|
301
|
+
type: string;
|
|
302
|
+
minItems: number;
|
|
303
|
+
maxItems: number;
|
|
304
|
+
uniqueItems: boolean;
|
|
305
|
+
items: {
|
|
306
|
+
type: string;
|
|
307
|
+
properties: {
|
|
308
|
+
id: {
|
|
309
|
+
type: string;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
required: string[];
|
|
313
|
+
additionalProperties: boolean;
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
};
|
|
317
|
+
required: string[];
|
|
318
|
+
additionalProperties: boolean;
|
|
319
|
+
};
|
|
256
320
|
};
|
|
257
321
|
additionalProperties: boolean;
|
|
258
322
|
};
|
|
@@ -260,9 +324,75 @@ export declare const schema: {
|
|
|
260
324
|
enum: string[];
|
|
261
325
|
type: string;
|
|
262
326
|
};
|
|
327
|
+
match_all?: undefined;
|
|
328
|
+
};
|
|
329
|
+
additionalProperties: boolean;
|
|
330
|
+
} | {
|
|
331
|
+
type: string;
|
|
332
|
+
required: string[];
|
|
333
|
+
properties: {
|
|
334
|
+
action: {
|
|
335
|
+
type: string;
|
|
336
|
+
anyOf: ({
|
|
337
|
+
type: string;
|
|
338
|
+
required: string[];
|
|
339
|
+
properties: {
|
|
340
|
+
block: {
|
|
341
|
+
type: string;
|
|
342
|
+
enum: boolean[];
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
additionalProperties: boolean;
|
|
346
|
+
} | {
|
|
347
|
+
type: string;
|
|
348
|
+
required: string[];
|
|
349
|
+
properties: {
|
|
350
|
+
allow: {
|
|
351
|
+
type: string;
|
|
352
|
+
enum: boolean[];
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
additionalProperties: boolean;
|
|
356
|
+
} | {
|
|
357
|
+
type: string;
|
|
358
|
+
required: string[];
|
|
359
|
+
properties: {
|
|
360
|
+
log: {
|
|
361
|
+
type: string;
|
|
362
|
+
enum: boolean[];
|
|
363
|
+
};
|
|
364
|
+
};
|
|
365
|
+
additionalProperties: boolean;
|
|
366
|
+
} | {
|
|
367
|
+
type: string;
|
|
368
|
+
required: string[];
|
|
369
|
+
properties: {
|
|
370
|
+
redirect: {
|
|
371
|
+
type: string;
|
|
372
|
+
enum: boolean[];
|
|
373
|
+
};
|
|
374
|
+
redirect_uri: {
|
|
375
|
+
type: string;
|
|
376
|
+
minLength: number;
|
|
377
|
+
maxLength: number;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
additionalProperties: boolean;
|
|
381
|
+
})[];
|
|
382
|
+
};
|
|
383
|
+
match_all: {
|
|
384
|
+
type: string;
|
|
385
|
+
enum: boolean[];
|
|
386
|
+
};
|
|
387
|
+
scope: {
|
|
388
|
+
enum: string[];
|
|
389
|
+
type: string;
|
|
390
|
+
};
|
|
391
|
+
match?: undefined;
|
|
392
|
+
not_match?: undefined;
|
|
263
393
|
};
|
|
264
394
|
additionalProperties: boolean;
|
|
265
|
-
}[];
|
|
395
|
+
})[];
|
|
266
396
|
};
|
|
267
397
|
};
|
|
268
398
|
additionalProperties: boolean;
|
|
@@ -1,10 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
2
41
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
42
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
43
|
};
|
|
5
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
45
|
exports.schema = void 0;
|
|
7
|
-
const default_1 =
|
|
46
|
+
const default_1 = __importStar(require("./default"));
|
|
8
47
|
const client_1 = require("../client");
|
|
9
48
|
const logger_1 = __importDefault(require("../../../logger"));
|
|
10
49
|
// Define action types
|
|
@@ -57,6 +96,15 @@ const RedirectAction = {
|
|
|
57
96
|
},
|
|
58
97
|
additionalProperties: false,
|
|
59
98
|
};
|
|
99
|
+
// Shared sub-schemas reused across every rule branch below.
|
|
100
|
+
const ActionSchema = {
|
|
101
|
+
type: 'object',
|
|
102
|
+
anyOf: [BlockAction, AllowAction, LogAction, RedirectAction],
|
|
103
|
+
};
|
|
104
|
+
const ScopeSchema = {
|
|
105
|
+
enum: ['management', 'authentication', 'tenant'],
|
|
106
|
+
type: 'string',
|
|
107
|
+
};
|
|
60
108
|
// Define MatchSchema
|
|
61
109
|
const MatchSchema = {
|
|
62
110
|
type: 'object',
|
|
@@ -69,6 +117,15 @@ const MatchSchema = {
|
|
|
69
117
|
uniqueItems: true,
|
|
70
118
|
minItems: 1,
|
|
71
119
|
},
|
|
120
|
+
auth0_managed: {
|
|
121
|
+
type: 'array',
|
|
122
|
+
items: {
|
|
123
|
+
type: 'string',
|
|
124
|
+
pattern: '^auth0\\.[^.\\s]+$',
|
|
125
|
+
},
|
|
126
|
+
uniqueItems: true,
|
|
127
|
+
minItems: 1,
|
|
128
|
+
},
|
|
72
129
|
geo_country_codes: {
|
|
73
130
|
type: 'array',
|
|
74
131
|
items: {
|
|
@@ -146,6 +203,27 @@ const MatchSchema = {
|
|
|
146
203
|
},
|
|
147
204
|
uniqueItems: true,
|
|
148
205
|
},
|
|
206
|
+
http_message_signature: {
|
|
207
|
+
type: 'object',
|
|
208
|
+
properties: {
|
|
209
|
+
keys: {
|
|
210
|
+
type: 'array',
|
|
211
|
+
minItems: 1,
|
|
212
|
+
maxItems: 10,
|
|
213
|
+
uniqueItems: true,
|
|
214
|
+
items: {
|
|
215
|
+
type: 'object',
|
|
216
|
+
properties: {
|
|
217
|
+
id: { type: 'string' },
|
|
218
|
+
},
|
|
219
|
+
required: ['id'],
|
|
220
|
+
additionalProperties: false,
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
required: ['keys'],
|
|
225
|
+
additionalProperties: false,
|
|
226
|
+
},
|
|
149
227
|
},
|
|
150
228
|
additionalProperties: false,
|
|
151
229
|
};
|
|
@@ -173,16 +251,10 @@ exports.schema = {
|
|
|
173
251
|
type: 'object',
|
|
174
252
|
required: ['action', 'scope', 'match'],
|
|
175
253
|
properties: {
|
|
176
|
-
action:
|
|
177
|
-
type: 'object',
|
|
178
|
-
anyOf: [BlockAction, AllowAction, LogAction, RedirectAction],
|
|
179
|
-
},
|
|
254
|
+
action: ActionSchema,
|
|
180
255
|
match: MatchSchema,
|
|
181
256
|
not_match: MatchSchema,
|
|
182
|
-
scope:
|
|
183
|
-
enum: ['management', 'authentication', 'tenant'],
|
|
184
|
-
type: 'string',
|
|
185
|
-
},
|
|
257
|
+
scope: ScopeSchema,
|
|
186
258
|
},
|
|
187
259
|
additionalProperties: false,
|
|
188
260
|
},
|
|
@@ -190,16 +262,25 @@ exports.schema = {
|
|
|
190
262
|
type: 'object',
|
|
191
263
|
required: ['action', 'scope', 'not_match'],
|
|
192
264
|
properties: {
|
|
193
|
-
action:
|
|
194
|
-
type: 'object',
|
|
195
|
-
anyOf: [BlockAction, AllowAction, LogAction, RedirectAction],
|
|
196
|
-
},
|
|
265
|
+
action: ActionSchema,
|
|
197
266
|
not_match: MatchSchema,
|
|
198
267
|
match: MatchSchema,
|
|
199
|
-
scope:
|
|
200
|
-
|
|
201
|
-
|
|
268
|
+
scope: ScopeSchema,
|
|
269
|
+
},
|
|
270
|
+
additionalProperties: false,
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
// Unconditional match: `match_all` is mutually exclusive with `match`/`not_match`.
|
|
274
|
+
type: 'object',
|
|
275
|
+
required: ['action', 'scope', 'match_all'],
|
|
276
|
+
properties: {
|
|
277
|
+
action: ActionSchema,
|
|
278
|
+
match_all: {
|
|
279
|
+
// Schema only permits `true`; omit the property instead of sending `false`.
|
|
280
|
+
type: 'boolean',
|
|
281
|
+
enum: [true],
|
|
202
282
|
},
|
|
283
|
+
scope: ScopeSchema,
|
|
203
284
|
},
|
|
204
285
|
additionalProperties: false,
|
|
205
286
|
},
|
|
@@ -346,3 +427,6 @@ class NetworkACLsHandler extends default_1.default {
|
|
|
346
427
|
}
|
|
347
428
|
}
|
|
348
429
|
exports.default = NetworkACLsHandler;
|
|
430
|
+
__decorate([
|
|
431
|
+
(0, default_1.order)(65)
|
|
432
|
+
], NetworkACLsHandler.prototype, "processChanges", null);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Management } from 'auth0';
|
|
2
2
|
import DefaultHandler from './default';
|
|
3
3
|
import { Asset, Assets, CalculatedChanges } from '../../../types';
|
|
4
|
+
import { Client } from './clients';
|
|
4
5
|
export declare const schema: {
|
|
5
6
|
type: string;
|
|
6
7
|
items: {
|
|
@@ -104,6 +105,29 @@ export declare const schema: {
|
|
|
104
105
|
required: string[];
|
|
105
106
|
};
|
|
106
107
|
};
|
|
108
|
+
third_party_client_access: {
|
|
109
|
+
type: string;
|
|
110
|
+
enum: ("allow" | "block")[];
|
|
111
|
+
};
|
|
112
|
+
is_app_entitlement_active: {
|
|
113
|
+
type: string;
|
|
114
|
+
};
|
|
115
|
+
clients: {
|
|
116
|
+
type: string;
|
|
117
|
+
items: {
|
|
118
|
+
type: string;
|
|
119
|
+
properties: {
|
|
120
|
+
client_id: {
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
use_for_member_access: {
|
|
124
|
+
type: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
required: string[];
|
|
128
|
+
};
|
|
129
|
+
default: never[];
|
|
130
|
+
};
|
|
107
131
|
};
|
|
108
132
|
required: string[];
|
|
109
133
|
};
|
|
@@ -115,6 +139,7 @@ type FormattedClientGrants = {
|
|
|
115
139
|
export default class OrganizationsHandler extends DefaultHandler {
|
|
116
140
|
existing: Asset[];
|
|
117
141
|
formattedClientGrants: FormattedClientGrants[];
|
|
142
|
+
allClients: Client[];
|
|
118
143
|
constructor(config: DefaultHandler);
|
|
119
144
|
deleteOrganization(org: any): Promise<void>;
|
|
120
145
|
deleteOrganizations(data: Asset[]): Promise<void>;
|
|
@@ -122,8 +147,9 @@ export default class OrganizationsHandler extends DefaultHandler {
|
|
|
122
147
|
createOrganizations(creates: CalculatedChanges['create']): Promise<void>;
|
|
123
148
|
updateOrganization(org: any, organizations: any): Promise<{
|
|
124
149
|
id: any;
|
|
125
|
-
}>;
|
|
150
|
+
} | null>;
|
|
126
151
|
getClientGrantIDByClientName(clientsName: string): string;
|
|
152
|
+
getClientIdByClientName(clientName: string): string;
|
|
127
153
|
getFormattedClientGrants(): Promise<FormattedClientGrants[]>;
|
|
128
154
|
updateOrganizations(updates: CalculatedChanges['update'], orgs: Asset[]): Promise<void>;
|
|
129
155
|
getType(): Promise<Asset[]>;
|
|
@@ -137,5 +163,11 @@ export default class OrganizationsHandler extends DefaultHandler {
|
|
|
137
163
|
createOrganizationDiscoveryDomain(organizationId: string, discoveryDomain: Management.CreateOrganizationDiscoveryDomainRequestContent): Promise<Management.CreateOrganizationDiscoveryDomainResponseContent>;
|
|
138
164
|
updateOrganizationDiscoveryDomain(organizationId: string, discoveryDomainId: string, discoveryDomain: string, discoveryDomainUpdate: Management.UpdateOrganizationDiscoveryDomainRequestContent): Promise<Management.UpdateOrganizationDiscoveryDomainResponseContent>;
|
|
139
165
|
deleteOrganizationDiscoveryDomain(organizationId: string, discoveryDomain: string, discoveryDomainId: string): Promise<void>;
|
|
166
|
+
getAllOrganizationClients(organizationId: string): Promise<Management.OrganizationClient[] | null>;
|
|
167
|
+
createOrganizationClients(organizationId: string, clients: Array<{
|
|
168
|
+
client_id: string;
|
|
169
|
+
use_for_member_access: boolean;
|
|
170
|
+
}>): Promise<void>;
|
|
171
|
+
deleteOrganizationClients(organizationId: string, clientIds: string[]): Promise<void>;
|
|
140
172
|
}
|
|
141
173
|
export {};
|