auth0-deploy-cli 8.24.0 → 8.26.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/.github/workflows/claude-code-review.yml +1 -4
- package/CHANGELOG.md +44 -1
- package/lib/context/directory/handlers/tenant.js +7 -2
- package/lib/context/directory/index.js +3 -0
- package/lib/context/index.js +10 -0
- package/lib/context/yaml/handlers/tenant.js +7 -2
- package/lib/context/yaml/index.js +5 -0
- package/lib/sessionDurationsToMinutes.d.ts +5 -1
- package/lib/sessionDurationsToMinutes.js +5 -1
- package/lib/tools/auth0/handlers/actions.js +1 -1
- package/lib/tools/auth0/handlers/clientGrants.d.ts +5 -0
- package/lib/tools/auth0/handlers/clientGrants.js +18 -3
- package/lib/tools/auth0/handlers/clients.d.ts +43 -8
- package/lib/tools/auth0/handlers/clients.js +106 -35
- package/lib/tools/auth0/handlers/connectionProfiles.js +0 -3
- package/lib/tools/auth0/handlers/connections.d.ts +5 -6
- package/lib/tools/auth0/handlers/connections.js +41 -53
- package/lib/tools/auth0/handlers/customDomains.d.ts +4 -0
- package/lib/tools/auth0/handlers/customDomains.js +6 -3
- package/lib/tools/auth0/handlers/databases.d.ts +57 -0
- package/lib/tools/auth0/handlers/databases.js +52 -2
- package/lib/tools/auth0/handlers/default.js +2 -4
- package/lib/tools/auth0/handlers/flowVaultConnections.js +6 -3
- package/lib/tools/auth0/handlers/flows.js +0 -3
- package/lib/tools/auth0/handlers/forms.js +0 -3
- package/lib/tools/auth0/handlers/index.d.ts +1 -0
- package/lib/tools/auth0/handlers/logStreams.js +0 -3
- package/lib/tools/auth0/handlers/organizations.d.ts +4 -1
- package/lib/tools/auth0/handlers/organizations.js +61 -32
- package/lib/tools/auth0/handlers/prompts.d.ts +2 -2
- package/lib/tools/auth0/handlers/prompts.js +1 -0
- package/lib/tools/auth0/handlers/resourceServers.d.ts +1 -3
- package/lib/tools/auth0/handlers/resourceServers.js +4 -4
- package/lib/tools/auth0/handlers/roles.js +6 -3
- package/lib/tools/auth0/handlers/scimHandler.d.ts +5 -8
- package/lib/tools/auth0/handlers/scimHandler.js +13 -13
- package/lib/tools/auth0/handlers/tokenExchangeProfiles.d.ts +0 -14
- package/lib/tools/auth0/handlers/tokenExchangeProfiles.js +27 -34
- package/lib/tools/auth0/handlers/userAttributeProfiles.js +0 -3
- package/lib/tools/auth0/schema.d.ts +7 -0
- package/lib/tools/auth0/schema.js +11 -0
- package/lib/tools/utils.d.ts +1 -0
- package/lib/tools/utils.js +14 -0
- package/lib/types.d.ts +4 -0
- package/package.json +8 -8
|
@@ -3,7 +3,7 @@ import DefaultHandler from './default';
|
|
|
3
3
|
import { Assets, Language } from '../../../types';
|
|
4
4
|
declare const promptTypes: readonly ["login", "login-id", "login-password", "login-passwordless", "login-email-verification", "signup", "signup-id", "signup-password", "phone-identifier-enrollment", "phone-identifier-challenge", "email-identifier-challenge", "reset-password", "custom-form", "consent", "customized-consent", "logout", "mfa-push", "mfa-otp", "mfa-voice", "mfa-phone", "mfa-webauthn", "mfa-sms", "mfa-email", "mfa-recovery-code", "mfa", "status", "device-flow", "email-verification", "email-otp-challenge", "organizations", "invitation", "common", "captcha", "passkeys", "brute-force-protection"];
|
|
5
5
|
export type PromptTypes = (typeof promptTypes)[number];
|
|
6
|
-
declare const screenTypes: readonly ["login", "login-id", "login-password", "login-email-verification", "signup", "signup-id", "signup-password", "reset-password-request", "reset-password-email", "reset-password", "reset-password-success", "reset-password-error", "consent", "status", "mfa-detect-browser-capabilities", "mfa-enroll-result", "mfa-login-options", "mfa-begin-enroll-options", "mfa-otp-enrollment-qr", "mfa-otp-enrollment-code", "mfa-otp-challenge", "mfa-voice-challenge", "mfa-sms-challenge", "mfa-recovery-code-enrollment", "mfa-recovery-code-challenge", "mfa-country-codes", "mfa-sms-enrollment", "mfa-voice-enrollment", "mfa-phone-challenge", "mfa-phone-enrollment", "mfa-webauthn-roaming-enrollment", "mfa-webauthn-platform-enrollment", "mfa-webauthn-platform-challenge", "mfa-webauthn-roaming-challenge", "mfa-webauthn-change-key-nickname", "mfa-webauthn-enrollment-success", "mfa-webauthn-error", "mfa-webauthn-not-available-error", "mfa-sms-list", "mfa-email-challenge", "mfa-email-list", "mfa-push-welcome", "mfa-push-list", "mfa-push-enrollment-qr", "mfa-push-enrollment-code", "mfa-push-success", "mfa-push-challenge-push", "device-code-activation", "device-code-activation-allowed", "device-code-activation-denied", "device-code-confirmation", "email-verification-result", "email-otp-challenge", "redeem-ticket", "organization-selection", "accept-invitation", "login-passwordless-email-code", "login-passwordless-email-link", "login-passwordless-sms-otp", "passkey-enrollment", "passkey-enrollment-local", "brute-force-protection-unblock", "brute-force-protection-unblock-success", "brute-force-protection-unblock-failure"];
|
|
6
|
+
declare const screenTypes: readonly ["login", "login-id", "login-password", "login-email-verification", "signup", "signup-id", "signup-password", "reset-password-request", "reset-password-email", "reset-password", "reset-password-success", "reset-password-error", "consent", "status", "mfa-detect-browser-capabilities", "mfa-enroll-result", "mfa-login-options", "mfa-begin-enroll-options", "mfa-otp-enrollment-qr", "mfa-otp-enrollment-code", "mfa-otp-challenge", "mfa-voice-challenge", "mfa-sms-challenge", "mfa-recovery-code-enrollment", "mfa-recovery-code-challenge", "mfa-country-codes", "mfa-sms-enrollment", "mfa-voice-enrollment", "mfa-phone-challenge", "mfa-phone-enrollment", "mfa-webauthn-roaming-enrollment", "mfa-webauthn-platform-enrollment", "mfa-webauthn-platform-challenge", "mfa-webauthn-roaming-challenge", "mfa-webauthn-change-key-nickname", "mfa-webauthn-enrollment-success", "mfa-webauthn-error", "mfa-webauthn-not-available-error", "mfa-sms-list", "mfa-email-challenge", "mfa-email-list", "mfa-push-welcome", "mfa-push-list", "mfa-push-enrollment-qr", "mfa-push-enrollment-code", "mfa-push-success", "mfa-push-challenge-push", "device-code-activation", "device-code-activation-allowed", "device-code-activation-denied", "device-code-confirmation", "email-verification-result", "email-otp-challenge", "redeem-ticket", "organization-selection", "pre-login-organization-picker", "accept-invitation", "login-passwordless-email-code", "login-passwordless-email-link", "login-passwordless-sms-otp", "passkey-enrollment", "passkey-enrollment-local", "brute-force-protection-unblock", "brute-force-protection-unblock-success", "brute-force-protection-unblock-failure"];
|
|
7
7
|
export type ScreenTypes = (typeof screenTypes)[number];
|
|
8
8
|
declare const customPartialsPromptTypes: string[];
|
|
9
9
|
export type CustomPartialsPromptTypes = (typeof customPartialsPromptTypes)[number];
|
|
@@ -75,7 +75,7 @@ export type PromptsCustomText = {
|
|
|
75
75
|
export type AllPromptsByLanguage = Partial<{
|
|
76
76
|
[key in Language]: Partial<PromptsCustomText>;
|
|
77
77
|
}>;
|
|
78
|
-
export type ScreenRenderer = Management.
|
|
78
|
+
export type ScreenRenderer = Management.GetAculResponseContent;
|
|
79
79
|
export type Prompts = Partial<PromptSettings & {
|
|
80
80
|
customText: AllPromptsByLanguage;
|
|
81
81
|
partials: CustomPromptPartials;
|
|
@@ -95,7 +95,5 @@ export default class ResourceServersHandler extends DefaultHandler {
|
|
|
95
95
|
calcChanges(assets: Assets): Promise<CalculatedChanges>;
|
|
96
96
|
validate(assets: Assets): Promise<void>;
|
|
97
97
|
processChanges(assets: Assets): Promise<void>;
|
|
98
|
-
updateResourceServer(
|
|
99
|
-
id: string;
|
|
100
|
-
}, update: ResourceServer): Promise<Management.UpdateResourceServerResponseContent>;
|
|
98
|
+
updateResourceServer(id: string, update: ResourceServer): Promise<Management.UpdateResourceServerResponseContent>;
|
|
101
99
|
}
|
|
@@ -88,7 +88,7 @@ class ResourceServersHandler extends default_1.default {
|
|
|
88
88
|
stripCreateFields: ['client_id', 'is_system'],
|
|
89
89
|
stripUpdateFields: ['identifier', 'client_id', 'is_system'],
|
|
90
90
|
functions: {
|
|
91
|
-
update: (
|
|
91
|
+
update: (id, data) => this.updateResourceServer(id, data),
|
|
92
92
|
},
|
|
93
93
|
});
|
|
94
94
|
}
|
|
@@ -172,7 +172,7 @@ class ResourceServersHandler extends default_1.default {
|
|
|
172
172
|
...changes,
|
|
173
173
|
});
|
|
174
174
|
}
|
|
175
|
-
async updateResourceServer(
|
|
175
|
+
async updateResourceServer(id, update) {
|
|
176
176
|
// Exclude name from update as it cannot be modified for system resource servers like Auth0 My Account API
|
|
177
177
|
if (update.is_system === true || update.name === 'Auth0 My Account API') {
|
|
178
178
|
const updateFields = {
|
|
@@ -181,9 +181,9 @@ class ResourceServersHandler extends default_1.default {
|
|
|
181
181
|
skip_consent_for_verifiable_first_party_clients: update.skip_consent_for_verifiable_first_party_clients,
|
|
182
182
|
subject_type_authorization: update.subject_type_authorization,
|
|
183
183
|
};
|
|
184
|
-
return this.client.resourceServers.update(
|
|
184
|
+
return this.client.resourceServers.update(id, updateFields);
|
|
185
185
|
}
|
|
186
|
-
return this.client.resourceServers.update(
|
|
186
|
+
return this.client.resourceServers.update(id, update);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
exports.default = ResourceServersHandler;
|
|
@@ -194,10 +194,13 @@ class RolesHandler extends default_1.default {
|
|
|
194
194
|
*/
|
|
195
195
|
const rolesId = roles[index].id;
|
|
196
196
|
let permissions = await this.client.roles.permissions.list(rolesId, { per_page: 100 });
|
|
197
|
-
|
|
198
|
-
|
|
197
|
+
// Process first page
|
|
198
|
+
allPermission.push(...permissions.data);
|
|
199
|
+
// Fetch remaining pages
|
|
200
|
+
while (permissions.hasNextPage()) {
|
|
199
201
|
permissions = await permissions.getNextPage();
|
|
200
|
-
|
|
202
|
+
allPermission.push(...permissions.data);
|
|
203
|
+
}
|
|
201
204
|
const strippedPerms = await Promise.all(allPermission.map(async (permission) => {
|
|
202
205
|
delete permission.resource_server_name;
|
|
203
206
|
delete permission.description;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { PromisePoolExecutor } from 'promise-pool-executor';
|
|
2
2
|
import { Management } from 'auth0';
|
|
3
3
|
import { Asset } from '../../../types';
|
|
4
|
-
interface ScimRequestParams {
|
|
5
|
-
id: string;
|
|
6
|
-
}
|
|
7
4
|
interface ScimBodyParams {
|
|
8
5
|
user_id_attribute: string;
|
|
9
6
|
mapping: {
|
|
@@ -61,20 +58,20 @@ export default class ScimHandler {
|
|
|
61
58
|
/**
|
|
62
59
|
* Creates a new `SCIM` configuration.
|
|
63
60
|
*/
|
|
64
|
-
createScimConfiguration(
|
|
61
|
+
createScimConfiguration(id: string, { user_id_attribute, mapping }: ScimBodyParams): Promise<Asset | null>;
|
|
65
62
|
/**
|
|
66
63
|
* Retrieves `SCIM` configuration of an enterprise connection.
|
|
67
64
|
*/
|
|
68
|
-
getScimConfiguration(
|
|
65
|
+
getScimConfiguration(id: string): Promise<Management.GetScimConfigurationResponseContent | null>;
|
|
69
66
|
/**
|
|
70
67
|
* Updates an existing `SCIM` configuration.
|
|
71
68
|
*/
|
|
72
|
-
updateScimConfiguration(
|
|
69
|
+
updateScimConfiguration(id: string, { user_id_attribute, mapping }: ScimBodyParams): Promise<Asset | null>;
|
|
73
70
|
/**
|
|
74
71
|
* Deletes an existing `SCIM` configuration.
|
|
75
72
|
*/
|
|
76
|
-
deleteScimConfiguration(
|
|
77
|
-
updateOverride(
|
|
73
|
+
deleteScimConfiguration(id: string): Promise<Asset | null>;
|
|
74
|
+
updateOverride(connectionId: string, bodyParams: Asset): Promise<Management.UpdateConnectionResponseContent>;
|
|
78
75
|
createOverride(bodyParams: Asset): Promise<Management.CreateConnectionResponseContent>;
|
|
79
76
|
}
|
|
80
77
|
export {};
|
|
@@ -49,7 +49,7 @@ class ScimHandler {
|
|
|
49
49
|
if (!this.isScimStrategy(connection.strategy))
|
|
50
50
|
return Promise.resolve(null);
|
|
51
51
|
this.idMap.set(connection.id, { strategy: connection.strategy });
|
|
52
|
-
return this.getScimConfiguration(
|
|
52
|
+
return this.getScimConfiguration(connection.id)
|
|
53
53
|
.then((response) => {
|
|
54
54
|
const scimConfiguration = response;
|
|
55
55
|
if (scimConfiguration) {
|
|
@@ -156,7 +156,7 @@ class ScimHandler {
|
|
|
156
156
|
/**
|
|
157
157
|
* Creates a new `SCIM` configuration.
|
|
158
158
|
*/
|
|
159
|
-
async createScimConfiguration(
|
|
159
|
+
async createScimConfiguration(id,
|
|
160
160
|
// eslint-disable-next-line camelcase
|
|
161
161
|
{ user_id_attribute, mapping }) {
|
|
162
162
|
logger_1.default.debug(`Creating SCIM configuration on connection ${id}`);
|
|
@@ -165,14 +165,14 @@ class ScimHandler {
|
|
|
165
165
|
/**
|
|
166
166
|
* Retrieves `SCIM` configuration of an enterprise connection.
|
|
167
167
|
*/
|
|
168
|
-
async getScimConfiguration(
|
|
168
|
+
async getScimConfiguration(id) {
|
|
169
169
|
logger_1.default.debug(`Getting SCIM configuration from connection ${id}`);
|
|
170
170
|
return this.withErrorHandling(async () => this.connectionsManager.scimConfiguration.get(id), 'get', id);
|
|
171
171
|
}
|
|
172
172
|
/**
|
|
173
173
|
* Updates an existing `SCIM` configuration.
|
|
174
174
|
*/
|
|
175
|
-
async updateScimConfiguration(
|
|
175
|
+
async updateScimConfiguration(id,
|
|
176
176
|
// eslint-disable-next-line camelcase
|
|
177
177
|
{ user_id_attribute, mapping }) {
|
|
178
178
|
logger_1.default.debug(`Updating SCIM configuration on connection ${id}`);
|
|
@@ -181,19 +181,19 @@ class ScimHandler {
|
|
|
181
181
|
/**
|
|
182
182
|
* Deletes an existing `SCIM` configuration.
|
|
183
183
|
*/
|
|
184
|
-
async deleteScimConfiguration(
|
|
184
|
+
async deleteScimConfiguration(id) {
|
|
185
185
|
logger_1.default.debug(`Deleting SCIM configuration on connection ${id}`);
|
|
186
186
|
return this.withErrorHandling(async () => this.connectionsManager.scimConfiguration.delete(id), 'delete', id);
|
|
187
187
|
}
|
|
188
|
-
async updateOverride(
|
|
188
|
+
async updateOverride(connectionId, bodyParams) {
|
|
189
189
|
// Extract `scim_configuration` from `bodyParams`.
|
|
190
190
|
// Remove `scim_configuration` from `bodyParams`, because `connections.update` doesn't accept it.
|
|
191
191
|
const { scim_configuration: scimBodyParams } = bodyParams;
|
|
192
192
|
delete bodyParams.scim_configuration;
|
|
193
193
|
delete bodyParams.directory_provisioning_configuration;
|
|
194
194
|
// First, update `connections`.
|
|
195
|
-
const updated = await this.connectionsManager.update(
|
|
196
|
-
const idMapEntry = this.idMap.get(
|
|
195
|
+
const updated = await this.connectionsManager.update(connectionId, bodyParams);
|
|
196
|
+
const idMapEntry = this.idMap.get(connectionId);
|
|
197
197
|
// Now, update `scim_configuration` inside the updated connection.
|
|
198
198
|
// If `scim_configuration` exists in both local and remote -> updateScimConfiguration(...)
|
|
199
199
|
// If `scim_configuration` exists in remote but local -> deleteScimConfiguration(...)
|
|
@@ -201,20 +201,20 @@ class ScimHandler {
|
|
|
201
201
|
if (idMapEntry?.scimConfiguration) {
|
|
202
202
|
if (scimBodyParams) {
|
|
203
203
|
if (this.scimScopes.update) {
|
|
204
|
-
await this.updateScimConfiguration(
|
|
204
|
+
await this.updateScimConfiguration(connectionId, scimBodyParams);
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
else if (this.config('AUTH0_ALLOW_DELETE')) {
|
|
208
208
|
if (this.scimScopes.delete) {
|
|
209
|
-
await this.deleteScimConfiguration(
|
|
209
|
+
await this.deleteScimConfiguration(connectionId);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
else {
|
|
213
|
-
logger_1.default.warn(`Skipping DELETE scim_configuration on \"${
|
|
213
|
+
logger_1.default.warn(`Skipping DELETE scim_configuration on \"${connectionId}\". Enable deletes by setting \"AUTH0_ALLOW_DELETE\" to true in your config.`);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
else if (scimBodyParams && this.scimScopes.create) {
|
|
217
|
-
await this.createScimConfiguration(
|
|
217
|
+
await this.createScimConfiguration(connectionId, scimBodyParams);
|
|
218
218
|
}
|
|
219
219
|
// Return response from connections.update(...).
|
|
220
220
|
return updated;
|
|
@@ -229,7 +229,7 @@ class ScimHandler {
|
|
|
229
229
|
const data = await this.connectionsManager.create(bodyParams);
|
|
230
230
|
if (data?.id && scimBodyParams && this.scimScopes.create) {
|
|
231
231
|
// Now, create the `scim_configuration` for newly created `connection`.
|
|
232
|
-
await this.createScimConfiguration(
|
|
232
|
+
await this.createScimConfiguration(data.id, scimBodyParams);
|
|
233
233
|
}
|
|
234
234
|
// Return response from connections.create(...).
|
|
235
235
|
return data;
|
|
@@ -11,10 +11,6 @@ export declare const schema: {
|
|
|
11
11
|
type: string;
|
|
12
12
|
description: string;
|
|
13
13
|
};
|
|
14
|
-
id: {
|
|
15
|
-
type: string;
|
|
16
|
-
description: string;
|
|
17
|
-
};
|
|
18
14
|
subject_token_type: {
|
|
19
15
|
type: string;
|
|
20
16
|
description: string;
|
|
@@ -28,16 +24,6 @@ export declare const schema: {
|
|
|
28
24
|
enum: string[];
|
|
29
25
|
description: string;
|
|
30
26
|
};
|
|
31
|
-
created_at: {
|
|
32
|
-
type: string;
|
|
33
|
-
format: string;
|
|
34
|
-
description: string;
|
|
35
|
-
};
|
|
36
|
-
updated_at: {
|
|
37
|
-
type: string;
|
|
38
|
-
format: string;
|
|
39
|
-
description: string;
|
|
40
|
-
};
|
|
41
27
|
};
|
|
42
28
|
required: string[];
|
|
43
29
|
};
|
|
@@ -55,10 +55,6 @@ exports.schema = {
|
|
|
55
55
|
type: 'string',
|
|
56
56
|
description: 'The name of the token exchange profile',
|
|
57
57
|
},
|
|
58
|
-
id: {
|
|
59
|
-
type: 'string',
|
|
60
|
-
description: 'The unique identifier of the token exchange profile',
|
|
61
|
-
},
|
|
62
58
|
subject_token_type: {
|
|
63
59
|
type: 'string',
|
|
64
60
|
description: 'The URI representing the subject token type',
|
|
@@ -72,16 +68,6 @@ exports.schema = {
|
|
|
72
68
|
enum: ['custom_authentication'],
|
|
73
69
|
description: 'The type of token exchange profile',
|
|
74
70
|
},
|
|
75
|
-
created_at: {
|
|
76
|
-
type: 'string',
|
|
77
|
-
format: 'date-time',
|
|
78
|
-
description: 'The timestamp when the profile was created',
|
|
79
|
-
},
|
|
80
|
-
updated_at: {
|
|
81
|
-
type: 'string',
|
|
82
|
-
format: 'date-time',
|
|
83
|
-
description: 'The timestamp when the profile was last updated',
|
|
84
|
-
},
|
|
85
71
|
},
|
|
86
72
|
required: ['name', 'subject_token_type', 'action', 'type'],
|
|
87
73
|
},
|
|
@@ -92,10 +78,10 @@ class TokenExchangeProfilesHandler extends default_1.default {
|
|
|
92
78
|
...config,
|
|
93
79
|
type: 'tokenExchangeProfiles',
|
|
94
80
|
id: 'id',
|
|
95
|
-
identifiers: ['id', '
|
|
81
|
+
identifiers: ['id', 'subject_token_type'],
|
|
96
82
|
// Only name and subject_token_type can be updated
|
|
97
|
-
stripUpdateFields: ['
|
|
98
|
-
stripCreateFields: ['
|
|
83
|
+
stripUpdateFields: ['created_at', 'updated_at', 'action_id', 'type'],
|
|
84
|
+
stripCreateFields: ['created_at', 'updated_at'],
|
|
99
85
|
});
|
|
100
86
|
}
|
|
101
87
|
sanitizeForExport(profile, actions) {
|
|
@@ -145,9 +131,9 @@ class TokenExchangeProfilesHandler extends default_1.default {
|
|
|
145
131
|
paginate: true,
|
|
146
132
|
});
|
|
147
133
|
// Fetch all actions to map action_id to action name
|
|
148
|
-
|
|
134
|
+
this.actions = await this.getActions();
|
|
149
135
|
// Map action_id to action name for each profile
|
|
150
|
-
this.existing = profiles.map((profile) => this.sanitizeForExport(profile, actions));
|
|
136
|
+
this.existing = profiles.map((profile) => this.sanitizeForExport(profile, this.actions ?? []));
|
|
151
137
|
return this.existing;
|
|
152
138
|
}
|
|
153
139
|
catch (err) {
|
|
@@ -163,31 +149,34 @@ class TokenExchangeProfilesHandler extends default_1.default {
|
|
|
163
149
|
// Do nothing if not set
|
|
164
150
|
if (!tokenExchangeProfiles)
|
|
165
151
|
return;
|
|
166
|
-
// Fetch actions to resolve action names to IDs
|
|
167
|
-
const actions = await this.getActions();
|
|
168
|
-
// Map action names to action_ids before processing
|
|
169
|
-
const sanitizedProfiles = tokenExchangeProfiles.map((profile) => this.sanitizeForAPI(profile, actions));
|
|
170
|
-
// Create modified assets with sanitized profiles
|
|
171
|
-
const modifiedAssets = {
|
|
172
|
-
...assets,
|
|
173
|
-
tokenExchangeProfiles: sanitizedProfiles,
|
|
174
|
-
};
|
|
175
152
|
// Calculate changes
|
|
176
|
-
const { del, update, create, conflicts } = await this.calcChanges(
|
|
153
|
+
const { del, update, create, conflicts } = await this.calcChanges(assets);
|
|
177
154
|
logger_1.default.debug(`Start processChanges for tokenExchangeProfiles [delete:${del.length}] [update:${update.length}], [create:${create.length}], [conflicts:${conflicts.length}]`);
|
|
155
|
+
// Fetch actions to resolve action names to IDs
|
|
156
|
+
if (!this.actions || this.actions.length === 0) {
|
|
157
|
+
this.actions = await this.getActions();
|
|
158
|
+
}
|
|
178
159
|
// Process changes in order: delete, create, update
|
|
179
160
|
if (del.length > 0) {
|
|
180
|
-
await this.deleteTokenExchangeProfiles(del);
|
|
161
|
+
await this.deleteTokenExchangeProfiles(del.map((profile) => this.sanitizeForAPI(profile, this.actions ?? [])));
|
|
181
162
|
}
|
|
182
163
|
if (create.length > 0) {
|
|
183
|
-
await this.createTokenExchangeProfiles(create);
|
|
164
|
+
await this.createTokenExchangeProfiles(create.map((profile) => this.sanitizeForAPI(profile, this.actions ?? [])));
|
|
184
165
|
}
|
|
185
166
|
if (update.length > 0) {
|
|
186
|
-
await this.updateTokenExchangeProfiles(update);
|
|
167
|
+
await this.updateTokenExchangeProfiles(update.map((profile) => this.sanitizeForAPI(profile, this.actions ?? [])));
|
|
187
168
|
}
|
|
188
169
|
}
|
|
189
170
|
async createTokenExchangeProfile(profile) {
|
|
190
|
-
|
|
171
|
+
if (!profile.name || !profile.subject_token_type || !profile.action_id || !profile.type) {
|
|
172
|
+
throw new Error(`Cannot create token exchange profile missing required fields`);
|
|
173
|
+
}
|
|
174
|
+
const createParams = {
|
|
175
|
+
name: profile.name,
|
|
176
|
+
subject_token_type: profile.subject_token_type,
|
|
177
|
+
action_id: profile.action_id,
|
|
178
|
+
type: profile.type,
|
|
179
|
+
};
|
|
191
180
|
const created = await this.client.tokenExchangeProfiles.create(createParams);
|
|
192
181
|
return created;
|
|
193
182
|
}
|
|
@@ -207,10 +196,14 @@ class TokenExchangeProfilesHandler extends default_1.default {
|
|
|
207
196
|
.promise();
|
|
208
197
|
}
|
|
209
198
|
async updateTokenExchangeProfile(profile) {
|
|
210
|
-
const { id,
|
|
199
|
+
const { id, name, subject_token_type } = profile;
|
|
211
200
|
if (!id) {
|
|
212
201
|
throw new Error(`Cannot update token exchange profile "${profile.name}" - missing id`);
|
|
213
202
|
}
|
|
203
|
+
const updateParams = {
|
|
204
|
+
name,
|
|
205
|
+
subject_token_type,
|
|
206
|
+
};
|
|
214
207
|
await this.client.tokenExchangeProfiles.update(id, updateParams);
|
|
215
208
|
}
|
|
216
209
|
async updateTokenExchangeProfiles(updates) {
|
|
@@ -256,9 +256,6 @@ class UserAttributeProfilesHandler extends default_1.default {
|
|
|
256
256
|
id: 'id',
|
|
257
257
|
identifiers: ['id', 'name'],
|
|
258
258
|
stripUpdateFields: ['id'],
|
|
259
|
-
functions: {
|
|
260
|
-
update: async (params, payload) => this.client.userAttributeProfiles.update(params?.id, payload),
|
|
261
|
-
},
|
|
262
259
|
});
|
|
263
260
|
}
|
|
264
261
|
async getType() {
|
|
@@ -14,6 +14,12 @@ const excludeSchema = Object.entries(handlers_1.default).reduce((map, [name, obj
|
|
|
14
14
|
}
|
|
15
15
|
return map;
|
|
16
16
|
}, {});
|
|
17
|
+
const includeSchema = Object.entries(handlers_1.default).reduce((map, [name, obj]) => {
|
|
18
|
+
if (obj.includeSchema) {
|
|
19
|
+
map[name] = obj.includeSchema;
|
|
20
|
+
}
|
|
21
|
+
return map;
|
|
22
|
+
}, {});
|
|
17
23
|
exports.default = {
|
|
18
24
|
type: 'object',
|
|
19
25
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
@@ -24,6 +30,11 @@ exports.default = {
|
|
|
24
30
|
properties: { ...excludeSchema },
|
|
25
31
|
default: {},
|
|
26
32
|
},
|
|
33
|
+
include: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: { ...includeSchema },
|
|
36
|
+
default: {},
|
|
37
|
+
},
|
|
27
38
|
},
|
|
28
39
|
additionalProperties: false,
|
|
29
40
|
};
|
package/lib/tools/utils.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare function stripFields(obj: Asset, fields: string[]): Asset;
|
|
|
19
19
|
export declare function getEnabledClients(assets: Assets, connection: Asset, existing: Asset[], clients: Asset[]): string[] | undefined;
|
|
20
20
|
export declare function duplicateItems(arr: Asset[], key: string): Asset[];
|
|
21
21
|
export declare function filterExcluded(changes: CalculatedChanges, exclude: string[]): CalculatedChanges;
|
|
22
|
+
export declare function filterIncluded(changes: CalculatedChanges, include: string[]): CalculatedChanges;
|
|
22
23
|
export declare function areArraysEquals(x: any[], y: any[]): boolean;
|
|
23
24
|
export declare const obfuscateSensitiveValues: (data: Asset | Asset[] | null, sensitiveFieldsToObfuscate: string[]) => Asset | Asset[] | null;
|
|
24
25
|
export declare const stripObfuscatedFieldsFromPayload: (data: Asset | Asset[] | null, obfuscatedFields: string[]) => Asset | Asset[] | null;
|
package/lib/tools/utils.js
CHANGED
|
@@ -50,6 +50,7 @@ exports.stripFields = stripFields;
|
|
|
50
50
|
exports.getEnabledClients = getEnabledClients;
|
|
51
51
|
exports.duplicateItems = duplicateItems;
|
|
52
52
|
exports.filterExcluded = filterExcluded;
|
|
53
|
+
exports.filterIncluded = filterIncluded;
|
|
53
54
|
exports.areArraysEquals = areArraysEquals;
|
|
54
55
|
exports.sleep = sleep;
|
|
55
56
|
exports.maskSecretAtPath = maskSecretAtPath;
|
|
@@ -213,6 +214,19 @@ function filterExcluded(changes, exclude) {
|
|
|
213
214
|
conflicts: filter(conflicts),
|
|
214
215
|
};
|
|
215
216
|
}
|
|
217
|
+
function filterIncluded(changes, include) {
|
|
218
|
+
const { del, update, create, conflicts } = changes;
|
|
219
|
+
if (!include || !include.length) {
|
|
220
|
+
return changes;
|
|
221
|
+
}
|
|
222
|
+
const filter = (list) => list.filter((item) => include.includes(item.name));
|
|
223
|
+
return {
|
|
224
|
+
del: filter(del),
|
|
225
|
+
update: filter(update),
|
|
226
|
+
create: filter(create),
|
|
227
|
+
conflicts: filter(conflicts),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
216
230
|
function areArraysEquals(x, y) {
|
|
217
231
|
return lodash_1.default.isEqual(x && x.sort(), y && y.sort());
|
|
218
232
|
}
|
package/lib/types.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export type Config = {
|
|
|
76
76
|
INCLUDED_PROPS?: {
|
|
77
77
|
[key: string]: string[];
|
|
78
78
|
};
|
|
79
|
+
AUTH0_INCLUDED_CONNECTIONS?: string[];
|
|
79
80
|
AUTH0_IGNORE_UNAVAILABLE_MIGRATIONS?: boolean;
|
|
80
81
|
AUTH0_EXCLUDED_RULES?: string[];
|
|
81
82
|
AUTH0_EXCLUDED_CLIENTS?: string[];
|
|
@@ -131,6 +132,9 @@ export type Assets = Partial<{
|
|
|
131
132
|
exclude?: {
|
|
132
133
|
[key: string]: string[];
|
|
133
134
|
};
|
|
135
|
+
include?: {
|
|
136
|
+
[key: string]: string[];
|
|
137
|
+
};
|
|
134
138
|
clientsOrig: Asset[] | null;
|
|
135
139
|
themes: Theme[] | null;
|
|
136
140
|
forms: Form[] | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "auth0-deploy-cli",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.26.0",
|
|
4
4
|
"description": "A command line tool for deploying updates to your Auth0 tenant",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -33,27 +33,27 @@
|
|
|
33
33
|
"homepage": "https://github.com/auth0/auth0-deploy-cli#readme",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"ajv": "^6.12.6",
|
|
36
|
-
"auth0": "^5.
|
|
36
|
+
"auth0": "^5.3.0",
|
|
37
37
|
"dot-prop": "^5.3.0",
|
|
38
38
|
"fs-extra": "^10.1.0",
|
|
39
39
|
"js-yaml": "^4.1.1",
|
|
40
|
-
"lodash": "^4.17.
|
|
40
|
+
"lodash": "^4.17.23",
|
|
41
41
|
"mkdirp": "^1.0.4",
|
|
42
42
|
"nconf": "^0.13.0",
|
|
43
43
|
"promise-pool-executor": "^1.1.1",
|
|
44
44
|
"sanitize-filename": "^1.6.3",
|
|
45
|
-
"undici": "^7.
|
|
45
|
+
"undici": "^7.19.2",
|
|
46
46
|
"winston": "^3.19.0",
|
|
47
47
|
"yargs": "^15.4.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/fs-extra": "^9.0.13",
|
|
51
|
-
"@types/lodash": "^4.17.
|
|
51
|
+
"@types/lodash": "^4.17.23",
|
|
52
52
|
"@types/mocha": "^10.0.10",
|
|
53
53
|
"@types/nconf": "^0.10.7",
|
|
54
54
|
"@eslint/js": "^9.39.2",
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
56
|
-
"@typescript-eslint/parser": "^8.
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
56
|
+
"@typescript-eslint/parser": "^8.54.0",
|
|
57
57
|
"chai": "^4.5.0",
|
|
58
58
|
"chai-as-promised": "^7.1.2",
|
|
59
59
|
"eslint": "^9.39.2",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"rmdir-sync": "^1.0.1",
|
|
73
73
|
"sinon": "^13.0.2",
|
|
74
74
|
"sinon-chai": "^3.7.0",
|
|
75
|
-
"ts-mocha": "^
|
|
75
|
+
"ts-mocha": "^11.1.0",
|
|
76
76
|
"typescript": "^5.9.3"
|
|
77
77
|
},
|
|
78
78
|
"engines": {
|