auth0-deploy-cli 8.25.0 → 8.27.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 +49 -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 +41 -8
- package/lib/tools/auth0/handlers/clients.d.ts +43 -8
- package/lib/tools/auth0/handlers/clients.js +109 -41
- package/lib/tools/auth0/handlers/connectionProfiles.js +0 -3
- package/lib/tools/auth0/handlers/connections.d.ts +7 -8
- package/lib/tools/auth0/handlers/connections.js +67 -59
- 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 +71 -2
- package/lib/tools/auth0/handlers/databases.js +139 -25
- 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/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 +19 -13
- package/lib/tools/auth0/handlers/selfServiceProfiles.d.ts +8 -0
- package/lib/tools/auth0/handlers/selfServiceProfiles.js +9 -0
- package/lib/tools/auth0/handlers/userAttributeProfiles.js +0 -3
- package/lib/tools/utils.d.ts +11 -0
- package/lib/tools/utils.js +24 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [8.27.0] - 2026-02-13
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add support for `custom_password_hash.action_id` in `databases` (Universal Custom Password Hash EA). [#1288]
|
|
15
|
+
- Add support for `allowed_strategies` in `selfServiceProfiles`. [#1298]
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Fix validation handling for `authentication_methods.password.enabled` and `disable_self_service_change_password` in `databases`. [#1297]
|
|
20
|
+
- Fix stripping deprecated `enabled_clients` for `connections` with enhanced client management. [#1294]
|
|
21
|
+
- Fix exclude third-party `clientGrants` when `AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS` is enabled. [#1289]
|
|
22
|
+
|
|
23
|
+
## [8.26.0] - 2026-01-30
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- Add support for `use_for_organization_discovery` in organizations `discovery-domains`. [#1283]
|
|
28
|
+
- Add support for passwordless authentication methods (`email_otp` and `phone_otp`) in `databases`. [#1282]
|
|
29
|
+
- Add support for `relying_party_identifier` in `customDomains`. [#1280]
|
|
30
|
+
- Add support for `allow_all_scopes` property in `clientGrants`. [#1278]
|
|
31
|
+
- Add OIDC logout configuration support with session metadata in `clients`. [#1263]
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
|
|
35
|
+
- Optimize directory provisioning configuration fetching for `connections`. [#1284]
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- Fix exclude read-only `is_default` from `customDomains`. [#1279]
|
|
40
|
+
- Fix pagination skipping last page. [#1277]
|
|
41
|
+
|
|
10
42
|
## [8.25.0] - 2026-01-08
|
|
11
43
|
|
|
12
44
|
### Added
|
|
@@ -1606,7 +1638,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
1606
1638
|
[#1244]: https://github.com/auth0/auth0-deploy-cli/issues/1244
|
|
1607
1639
|
[#1246]: https://github.com/auth0/auth0-deploy-cli/issues/1246
|
|
1608
1640
|
[#1253]: https://github.com/auth0/auth0-deploy-cli/issues/1253
|
|
1609
|
-
[
|
|
1641
|
+
[#1261]: https://github.com/auth0/auth0-deploy-cli/issues/1261
|
|
1642
|
+
[#1263]: https://github.com/auth0/auth0-deploy-cli/issues/1263
|
|
1643
|
+
[#1277]: https://github.com/auth0/auth0-deploy-cli/issues/1277
|
|
1644
|
+
[#1278]: https://github.com/auth0/auth0-deploy-cli/issues/1278
|
|
1645
|
+
[#1279]: https://github.com/auth0/auth0-deploy-cli/issues/1279
|
|
1646
|
+
[#1280]: https://github.com/auth0/auth0-deploy-cli/issues/1280
|
|
1647
|
+
[#1282]: https://github.com/auth0/auth0-deploy-cli/issues/1282
|
|
1648
|
+
[#1283]: https://github.com/auth0/auth0-deploy-cli/issues/1283
|
|
1649
|
+
[#1284]: https://github.com/auth0/auth0-deploy-cli/issues/1284
|
|
1650
|
+
[#1288]: https://github.com/auth0/auth0-deploy-cli/issues/1288
|
|
1651
|
+
[#1289]: https://github.com/auth0/auth0-deploy-cli/issues/1289
|
|
1652
|
+
[#1294]: https://github.com/auth0/auth0-deploy-cli/issues/1294
|
|
1653
|
+
[#1297]: https://github.com/auth0/auth0-deploy-cli/issues/1297
|
|
1654
|
+
[#1298]: https://github.com/auth0/auth0-deploy-cli/issues/1298
|
|
1655
|
+
[Unreleased]: https://github.com/auth0/auth0-deploy-cli/compare/v8.27.0...HEAD
|
|
1656
|
+
[8.27.0]: https://github.com/auth0/auth0-deploy-cli/compare/v8.26.0...v8.27.0
|
|
1657
|
+
[8.26.0]: https://github.com/auth0/auth0-deploy-cli/compare/v8.25.0...v8.26.0
|
|
1610
1658
|
[8.25.0]: https://github.com/auth0/auth0-deploy-cli/compare/v8.24.0...v8.25.0
|
|
1611
1659
|
[8.24.0]: https://github.com/auth0/auth0-deploy-cli/compare/v8.23.2...v8.24.0
|
|
1612
1660
|
[8.23.2]: https://github.com/auth0/auth0-deploy-cli/compare/v8.23.1...v8.23.2
|
|
@@ -114,7 +114,7 @@ class ActionHandler extends default_1.default {
|
|
|
114
114
|
type: 'actions',
|
|
115
115
|
functions: {
|
|
116
116
|
create: (action) => this.createAction(action),
|
|
117
|
-
update: (
|
|
117
|
+
update: (id, action) => this.updateAction(id, action),
|
|
118
118
|
delete: (actionId) => this.deleteAction(actionId),
|
|
119
119
|
},
|
|
120
120
|
stripUpdateFields: ['deployed', 'status'],
|
|
@@ -33,6 +33,10 @@ export declare const schema: {
|
|
|
33
33
|
};
|
|
34
34
|
uniqueItems: boolean;
|
|
35
35
|
};
|
|
36
|
+
allow_all_scopes: {
|
|
37
|
+
type: string;
|
|
38
|
+
description: string;
|
|
39
|
+
};
|
|
36
40
|
};
|
|
37
41
|
required: string[];
|
|
38
42
|
};
|
|
@@ -42,6 +46,7 @@ export default class ClientGrantsHandler extends DefaultHandler {
|
|
|
42
46
|
existing: ClientGrant[] | null;
|
|
43
47
|
constructor(config: DefaultAPIHandler);
|
|
44
48
|
objString(item: any): string;
|
|
49
|
+
validate(assets: Assets): Promise<void>;
|
|
45
50
|
getType(): Promise<ClientGrant[]>;
|
|
46
51
|
processChanges(assets: Assets): Promise<void>;
|
|
47
52
|
}
|
|
@@ -69,6 +69,10 @@ exports.schema = {
|
|
|
69
69
|
},
|
|
70
70
|
uniqueItems: true,
|
|
71
71
|
},
|
|
72
|
+
allow_all_scopes: {
|
|
73
|
+
type: 'boolean',
|
|
74
|
+
description: 'When enabled, all scopes configured on the resource server are allowed for by this client grant.',
|
|
75
|
+
},
|
|
72
76
|
},
|
|
73
77
|
required: ['client_id', 'audience'],
|
|
74
78
|
},
|
|
@@ -81,15 +85,26 @@ class ClientGrantsHandler extends default_1.default {
|
|
|
81
85
|
id: 'id',
|
|
82
86
|
// @ts-ignore because not sure why two-dimensional array passed in
|
|
83
87
|
identifiers: ['id', ['client_id', 'audience']],
|
|
84
|
-
functions: {
|
|
85
|
-
update: async ({ id }, bodyParams) => this.client.clientGrants.update(id, bodyParams),
|
|
86
|
-
},
|
|
87
88
|
stripUpdateFields: ['audience', 'client_id', 'subject_type', 'is_system'],
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
objString(item) {
|
|
91
92
|
return super.objString({ id: item.id, client_id: item.client_id, audience: item.audience });
|
|
92
93
|
}
|
|
94
|
+
async validate(assets) {
|
|
95
|
+
const { clientGrants } = assets;
|
|
96
|
+
// Do nothing if not set
|
|
97
|
+
if (!clientGrants)
|
|
98
|
+
return;
|
|
99
|
+
// Validate each client grant
|
|
100
|
+
clientGrants.forEach((grant) => {
|
|
101
|
+
// When allow_all_scopes is true, scope should not be present
|
|
102
|
+
if (grant.allow_all_scopes === true && grant.scope && grant.scope.length > 0) {
|
|
103
|
+
throw new Error(`Client grant for client_id "${grant.client_id}" and audience "${grant.audience}": Cannot specify "scope" when "allow_all_scopes" is set to true. Remove the "scope" property or set "allow_all_scopes" to false.`);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
await super.validate(assets);
|
|
107
|
+
}
|
|
93
108
|
async getType() {
|
|
94
109
|
if (this.existing) {
|
|
95
110
|
return this.existing;
|
|
@@ -102,6 +117,15 @@ class ClientGrantsHandler extends default_1.default {
|
|
|
102
117
|
// As it could cause problems if the grants are deleted or updated etc
|
|
103
118
|
const currentClient = this.config('AUTH0_CLIENT_ID');
|
|
104
119
|
this.existing = this.existing.filter((grant) => grant.client_id !== currentClient);
|
|
120
|
+
// Filter out third-party client grants when AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS is enabled
|
|
121
|
+
if ((0, utils_1.shouldExcludeThirdPartyClients)(this.config)) {
|
|
122
|
+
const clients = await (0, client_1.paginate)(this.client.clients.list, {
|
|
123
|
+
paginate: true,
|
|
124
|
+
is_first_party: true,
|
|
125
|
+
});
|
|
126
|
+
const firstPartyClientIds = new Set(clients.map((c) => c.client_id));
|
|
127
|
+
this.existing = this.existing.filter((grant) => firstPartyClientIds.has(grant.client_id));
|
|
128
|
+
}
|
|
105
129
|
return this.existing;
|
|
106
130
|
}
|
|
107
131
|
// Run after clients are updated so we can convert client_id names to id's
|
|
@@ -125,19 +149,28 @@ class ClientGrantsHandler extends default_1.default {
|
|
|
125
149
|
});
|
|
126
150
|
// Always filter out the client we are using to access Auth0 Management API
|
|
127
151
|
const currentClient = this.config('AUTH0_CLIENT_ID');
|
|
152
|
+
// Build a set of third-party client IDs for efficient lookup
|
|
153
|
+
const thirdPartyClientIds = new Set(clients.filter((c) => c.is_first_party === false).map((c) => c.client_id));
|
|
128
154
|
const { del, update, create, conflicts } = await this.calcChanges({
|
|
129
155
|
...assets,
|
|
130
156
|
clientGrants: formatted,
|
|
131
157
|
});
|
|
132
158
|
const filterGrants = (list) => {
|
|
159
|
+
let filtered = list;
|
|
160
|
+
// Filter out the current client (Auth0 Management API client)
|
|
161
|
+
filtered = filtered.filter((item) => item.client_id !== currentClient);
|
|
162
|
+
// Filter out excluded clients
|
|
133
163
|
if (excludedClients.length) {
|
|
134
|
-
|
|
135
|
-
item.client_id &&
|
|
164
|
+
filtered = filtered.filter((item) => item.client_id &&
|
|
136
165
|
![...excludedClientsByNames, ...excludedClients].includes(item.client_id));
|
|
137
166
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
167
|
+
// Filter out system grants
|
|
168
|
+
filtered = filtered.filter((item) => item.is_system !== true);
|
|
169
|
+
// Filter out third-party client grants when flag is enabled
|
|
170
|
+
if ((0, utils_1.shouldExcludeThirdPartyClients)(this.config)) {
|
|
171
|
+
filtered = filtered.filter((item) => !thirdPartyClientIds.has(item.client_id));
|
|
172
|
+
}
|
|
173
|
+
return filtered;
|
|
141
174
|
};
|
|
142
175
|
const changes = {
|
|
143
176
|
// @ts-ignore because this expects `client_id` and that's not yet typed on Asset
|
|
@@ -263,6 +263,49 @@ export declare const schema: {
|
|
|
263
263
|
};
|
|
264
264
|
};
|
|
265
265
|
};
|
|
266
|
+
oidc_logout: {
|
|
267
|
+
type: string[];
|
|
268
|
+
description: string;
|
|
269
|
+
properties: {
|
|
270
|
+
backchannel_logout_urls: {
|
|
271
|
+
type: string;
|
|
272
|
+
description: string;
|
|
273
|
+
items: {
|
|
274
|
+
type: string;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
backchannel_logout_initiators: {
|
|
278
|
+
type: string;
|
|
279
|
+
description: string;
|
|
280
|
+
properties: {
|
|
281
|
+
mode: {
|
|
282
|
+
type: string;
|
|
283
|
+
schemaName: string;
|
|
284
|
+
enum: string[];
|
|
285
|
+
description: string;
|
|
286
|
+
};
|
|
287
|
+
selected_initiators: {
|
|
288
|
+
type: string;
|
|
289
|
+
items: {
|
|
290
|
+
type: string;
|
|
291
|
+
enum: string[];
|
|
292
|
+
description: string;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
backchannel_logout_session_metadata: {
|
|
298
|
+
type: string[];
|
|
299
|
+
description: string;
|
|
300
|
+
properties: {
|
|
301
|
+
include: {
|
|
302
|
+
type: string;
|
|
303
|
+
description: string;
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
};
|
|
266
309
|
};
|
|
267
310
|
required: string[];
|
|
268
311
|
};
|
|
@@ -273,14 +316,6 @@ export default class ClientHandler extends DefaultAPIHandler {
|
|
|
273
316
|
constructor(config: DefaultAPIHandler);
|
|
274
317
|
objString(item: any): string;
|
|
275
318
|
processChanges(assets: Assets): Promise<void>;
|
|
276
|
-
/**
|
|
277
|
-
* @description
|
|
278
|
-
* Sanitize the deprecated field `cross_origin_auth` to `cross_origin_authentication`
|
|
279
|
-
*
|
|
280
|
-
* @param {Client[]} clients - The client array to sanitize.
|
|
281
|
-
* @returns {Client[]} The sanitized array of clients.
|
|
282
|
-
*/
|
|
283
|
-
private sanitizeCrossOriginAuth;
|
|
284
319
|
getType(): Promise<Management.Client[]>;
|
|
285
320
|
sanitizeMapExpressConfiguration(auth0Client: Auth0APIClient, clientList: Client[]): Promise<Client[]>;
|
|
286
321
|
}
|
|
@@ -10,6 +10,7 @@ const default_1 = __importDefault(require("./default"));
|
|
|
10
10
|
const connectionProfiles_1 = require("./connectionProfiles");
|
|
11
11
|
const userAttributeProfiles_1 = require("./userAttributeProfiles");
|
|
12
12
|
const logger_1 = __importDefault(require("../../../logger"));
|
|
13
|
+
const utils_1 = require("../../utils");
|
|
13
14
|
const multiResourceRefreshTokenPoliciesSchema = {
|
|
14
15
|
type: ['array', 'null'],
|
|
15
16
|
description: 'A collection of policies governing multi-resource refresh token exchange (MRRT), defining how refresh tokens can be used across different resource servers',
|
|
@@ -263,10 +264,111 @@ exports.schema = {
|
|
|
263
264
|
},
|
|
264
265
|
},
|
|
265
266
|
},
|
|
267
|
+
oidc_logout: {
|
|
268
|
+
type: ['object', 'null'],
|
|
269
|
+
description: 'Configuration for OIDC backchannel logout',
|
|
270
|
+
properties: {
|
|
271
|
+
backchannel_logout_urls: {
|
|
272
|
+
type: 'array',
|
|
273
|
+
description: 'Comma-separated list of URLs that are valid to call back from Auth0 for OIDC backchannel logout. Currently only one URL is allowed.',
|
|
274
|
+
items: {
|
|
275
|
+
type: 'string',
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
backchannel_logout_initiators: {
|
|
279
|
+
type: 'object',
|
|
280
|
+
description: 'Configuration for OIDC backchannel logout initiators',
|
|
281
|
+
properties: {
|
|
282
|
+
mode: {
|
|
283
|
+
type: 'string',
|
|
284
|
+
schemaName: 'ClientOIDCBackchannelLogoutInitiatorsModeEnum',
|
|
285
|
+
enum: ['custom', 'all'],
|
|
286
|
+
description: 'The `mode` property determines the configuration method for enabling initiators. `custom` enables only the initiators listed in the selected_initiators array, `all` enables all current and future initiators.',
|
|
287
|
+
},
|
|
288
|
+
selected_initiators: {
|
|
289
|
+
type: 'array',
|
|
290
|
+
items: {
|
|
291
|
+
type: 'string',
|
|
292
|
+
enum: [
|
|
293
|
+
'rp-logout',
|
|
294
|
+
'idp-logout',
|
|
295
|
+
'password-changed',
|
|
296
|
+
'session-expired',
|
|
297
|
+
'session-revoked',
|
|
298
|
+
'account-deleted',
|
|
299
|
+
'email-identifier-changed',
|
|
300
|
+
'mfa-phone-unenrolled',
|
|
301
|
+
'account-deactivated',
|
|
302
|
+
],
|
|
303
|
+
description: 'The `selected_initiators` property contains the list of initiators to be enabled for the given application.',
|
|
304
|
+
},
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
backchannel_logout_session_metadata: {
|
|
309
|
+
type: ['object', 'null'],
|
|
310
|
+
description: 'Controls whether session metadata is included in the logout token. Default value is null.',
|
|
311
|
+
properties: {
|
|
312
|
+
include: {
|
|
313
|
+
type: 'boolean',
|
|
314
|
+
description: 'The `include` property determines whether session metadata is included in the logout token.',
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
},
|
|
266
320
|
},
|
|
267
321
|
required: ['name'],
|
|
268
322
|
},
|
|
269
323
|
};
|
|
324
|
+
const createClientSanitizer = (clients) => {
|
|
325
|
+
let sanitized = clients;
|
|
326
|
+
return {
|
|
327
|
+
sanitizeCrossOriginAuth() {
|
|
328
|
+
const deprecatedClients = [];
|
|
329
|
+
sanitized = sanitized.map((client) => {
|
|
330
|
+
let updated = { ...client };
|
|
331
|
+
if ((0, lodash_1.has)(updated, 'cross_origin_auth')) {
|
|
332
|
+
const clientName = client.name || client.client_id || 'unknown client';
|
|
333
|
+
deprecatedClients.push(clientName);
|
|
334
|
+
if (!(0, lodash_1.has)(updated, 'cross_origin_authentication')) {
|
|
335
|
+
updated.cross_origin_authentication = updated.cross_origin_auth;
|
|
336
|
+
}
|
|
337
|
+
updated = (0, lodash_1.omit)(updated, 'cross_origin_auth');
|
|
338
|
+
}
|
|
339
|
+
return updated;
|
|
340
|
+
});
|
|
341
|
+
if (deprecatedClients.length > 0) {
|
|
342
|
+
logger_1.default.warn("The 'cross_origin_auth' parameter is deprecated in clients and scheduled for removal in future releases.\n" +
|
|
343
|
+
`Use 'cross_origin_authentication' going forward. Clients using the deprecated setting: [${deprecatedClients.join(', ')}]`);
|
|
344
|
+
}
|
|
345
|
+
return this;
|
|
346
|
+
},
|
|
347
|
+
sanitizeOidcLogout() {
|
|
348
|
+
const deprecatedClients = [];
|
|
349
|
+
sanitized = sanitized.map((client) => {
|
|
350
|
+
let updated = { ...client };
|
|
351
|
+
if ((0, lodash_1.has)(updated, 'oidc_backchannel_logout')) {
|
|
352
|
+
const clientName = client.name || client.client_id || 'unknown client';
|
|
353
|
+
deprecatedClients.push(clientName);
|
|
354
|
+
if (!(0, lodash_1.has)(updated, 'oidc_logout')) {
|
|
355
|
+
updated.oidc_logout = updated.oidc_backchannel_logout;
|
|
356
|
+
}
|
|
357
|
+
updated = (0, lodash_1.omit)(updated, 'oidc_backchannel_logout');
|
|
358
|
+
}
|
|
359
|
+
return updated;
|
|
360
|
+
});
|
|
361
|
+
if (deprecatedClients.length > 0) {
|
|
362
|
+
logger_1.default.warn("The 'oidc_backchannel_logout' parameter is deprecated in clients and scheduled for removal in future releases.\n" +
|
|
363
|
+
`Use 'oidc_logout' going forward. Clients using the deprecated setting: [${deprecatedClients.join(', ')}]`);
|
|
364
|
+
}
|
|
365
|
+
return this;
|
|
366
|
+
},
|
|
367
|
+
get: () => {
|
|
368
|
+
return sanitized;
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
};
|
|
270
372
|
class ClientHandler extends default_1.default {
|
|
271
373
|
constructor(config) {
|
|
272
374
|
super({
|
|
@@ -284,11 +386,6 @@ class ClientHandler extends default_1.default {
|
|
|
284
386
|
'jwt_configuration.secret_encoded',
|
|
285
387
|
'resource_server_identifier',
|
|
286
388
|
],
|
|
287
|
-
functions: {
|
|
288
|
-
update: async (
|
|
289
|
-
// eslint-disable-next-line camelcase
|
|
290
|
-
{ client_id }, bodyParams) => this.client.clients.update(client_id, bodyParams),
|
|
291
|
-
},
|
|
292
389
|
});
|
|
293
390
|
}
|
|
294
391
|
objString(item) {
|
|
@@ -301,8 +398,6 @@ class ClientHandler extends default_1.default {
|
|
|
301
398
|
return;
|
|
302
399
|
assets.clients = await this.sanitizeMapExpressConfiguration(this.client, clients);
|
|
303
400
|
const excludedClients = (assets.exclude && assets.exclude.clients) || [];
|
|
304
|
-
const excludeThirdPartyClients = this.config('AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS') === 'true' ||
|
|
305
|
-
this.config('AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS') === true;
|
|
306
401
|
const { del, update, create, conflicts } = await this.calcChanges(assets);
|
|
307
402
|
// Always filter out the client we are using to access Auth0 Management API
|
|
308
403
|
// As it could cause problems if it gets deleted or updated etc
|
|
@@ -316,10 +411,13 @@ class ClientHandler extends default_1.default {
|
|
|
316
411
|
const filterClients = (list) => list.filter((item) => item.client_id !== currentClient &&
|
|
317
412
|
item.name &&
|
|
318
413
|
!excludedClients.includes(item.name) &&
|
|
319
|
-
(!
|
|
414
|
+
(!(0, utils_1.shouldExcludeThirdPartyClients)(this.config) || item.is_first_party));
|
|
320
415
|
// Sanitize client fields
|
|
321
416
|
const sanitizeClientFields = (list) => {
|
|
322
|
-
const sanitizedClients =
|
|
417
|
+
const sanitizedClients = createClientSanitizer(list)
|
|
418
|
+
.sanitizeCrossOriginAuth()
|
|
419
|
+
.sanitizeOidcLogout()
|
|
420
|
+
.get();
|
|
323
421
|
return sanitizedClients.map((item) => {
|
|
324
422
|
if (item.app_type === 'resource_server') {
|
|
325
423
|
if ('oidc_backchannel_logout' in item) {
|
|
@@ -345,45 +443,15 @@ class ClientHandler extends default_1.default {
|
|
|
345
443
|
...changes,
|
|
346
444
|
});
|
|
347
445
|
}
|
|
348
|
-
/**
|
|
349
|
-
* @description
|
|
350
|
-
* Sanitize the deprecated field `cross_origin_auth` to `cross_origin_authentication`
|
|
351
|
-
*
|
|
352
|
-
* @param {Client[]} clients - The client array to sanitize.
|
|
353
|
-
* @returns {Client[]} The sanitized array of clients.
|
|
354
|
-
*/
|
|
355
|
-
sanitizeCrossOriginAuth(clients) {
|
|
356
|
-
const deprecatedClients = [];
|
|
357
|
-
const updatedClients = clients.map((client) => {
|
|
358
|
-
let updated = { ...client };
|
|
359
|
-
if ((0, lodash_1.has)(updated, 'cross_origin_auth')) {
|
|
360
|
-
const clientName = client.name || client.client_id || 'unknown client';
|
|
361
|
-
deprecatedClients.push(clientName);
|
|
362
|
-
if (!(0, lodash_1.has)(updated, 'cross_origin_authentication')) {
|
|
363
|
-
updated.cross_origin_authentication = updated.cross_origin_auth;
|
|
364
|
-
}
|
|
365
|
-
updated = (0, lodash_1.omit)(updated, 'cross_origin_auth');
|
|
366
|
-
}
|
|
367
|
-
return updated;
|
|
368
|
-
});
|
|
369
|
-
if (deprecatedClients.length > 0) {
|
|
370
|
-
logger_1.default.warn("The 'cross_origin_auth' parameter is deprecated in clients and scheduled for removal in future releases.\n" +
|
|
371
|
-
`Use 'cross_origin_authentication' going forward. Clients using the deprecated setting: [${deprecatedClients.join(', ')}]`);
|
|
372
|
-
}
|
|
373
|
-
return updatedClients;
|
|
374
|
-
}
|
|
375
446
|
async getType() {
|
|
376
447
|
if (this.existing)
|
|
377
448
|
return this.existing;
|
|
378
|
-
const excludeThirdPartyClients = this.config('AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS') === 'true' ||
|
|
379
|
-
this.config('AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS') === true;
|
|
380
449
|
const clients = await (0, client_1.paginate)(this.client.clients.list, {
|
|
381
450
|
paginate: true,
|
|
382
451
|
is_global: false,
|
|
383
|
-
...(
|
|
452
|
+
...((0, utils_1.shouldExcludeThirdPartyClients)(this.config) && { is_first_party: true }),
|
|
384
453
|
});
|
|
385
|
-
|
|
386
|
-
this.existing = sanitizedClients;
|
|
454
|
+
this.existing = createClientSanitizer(clients).sanitizeCrossOriginAuth().get();
|
|
387
455
|
return this.existing;
|
|
388
456
|
}
|
|
389
457
|
// convert names back to IDs for express configuration
|
|
@@ -206,9 +206,6 @@ class ConnectionProfilesHandler extends default_1.default {
|
|
|
206
206
|
type: 'connectionProfiles',
|
|
207
207
|
id: 'id',
|
|
208
208
|
identifiers: ['id', 'name'],
|
|
209
|
-
functions: {
|
|
210
|
-
update: (args, data) => this.client.connectionProfiles.update(args?.id, data),
|
|
211
|
-
},
|
|
212
209
|
});
|
|
213
210
|
}
|
|
214
211
|
objString(item) {
|
|
@@ -107,10 +107,10 @@ export declare const schema: {
|
|
|
107
107
|
required: string[];
|
|
108
108
|
};
|
|
109
109
|
};
|
|
110
|
-
type DirectoryProvisioningConfig = Management.
|
|
110
|
+
type DirectoryProvisioningConfig = Management.DirectoryProvisioning;
|
|
111
111
|
export type Connection = Management.ConnectionForList & {
|
|
112
112
|
enabled_clients?: string[];
|
|
113
|
-
directory_provisioning_configuration?: DirectoryProvisioningConfig
|
|
113
|
+
directory_provisioning_configuration?: Pick<DirectoryProvisioningConfig, 'mapping' | 'synchronize_automatically'>;
|
|
114
114
|
};
|
|
115
115
|
export declare const addExcludedConnectionPropertiesToChanges: ({ proposedChanges, existingConnections, config, }: {
|
|
116
116
|
proposedChanges: CalculatedChanges;
|
|
@@ -141,7 +141,7 @@ export declare const getConnectionEnabledClients: (auth0Client: Auth0APIClient,
|
|
|
141
141
|
* @returns Promise that resolves to true if the update was successful, false otherwise
|
|
142
142
|
*
|
|
143
143
|
*/
|
|
144
|
-
export declare const updateConnectionEnabledClients: (auth0Client: Auth0APIClient, typeName: string, connectionId: string, enabledClientIds: string[]) => Promise<boolean>;
|
|
144
|
+
export declare const updateConnectionEnabledClients: (auth0Client: Auth0APIClient, typeName: string, connectionId: string, enabledClientIds: string[], existingConnections: Asset[] | Asset | null) => Promise<boolean>;
|
|
145
145
|
/**
|
|
146
146
|
* This function processes enabled clients for create, update, and conflict operations.
|
|
147
147
|
* Note: This function mutates the `create` array by adding IDs to the connection objects after creation.
|
|
@@ -153,7 +153,7 @@ export declare const updateConnectionEnabledClients: (auth0Client: Auth0APIClien
|
|
|
153
153
|
*
|
|
154
154
|
* @returns A Promise that resolves when all enabled client updates are complete
|
|
155
155
|
*/
|
|
156
|
-
export declare const processConnectionEnabledClients: (auth0Client: Auth0APIClient, typeName: string, changes: CalculatedChanges, delayMs?: number) => Promise<void>;
|
|
156
|
+
export declare const processConnectionEnabledClients: (auth0Client: Auth0APIClient, typeName: string, existingConnections: Asset[] | null, changes: CalculatedChanges, delayMs?: number) => Promise<void>;
|
|
157
157
|
export default class ConnectionsHandler extends DefaultAPIHandler {
|
|
158
158
|
existing: Connection[] | null;
|
|
159
159
|
scimHandler: ScimHandler;
|
|
@@ -165,11 +165,10 @@ export default class ConnectionsHandler extends DefaultAPIHandler {
|
|
|
165
165
|
options?: undefined;
|
|
166
166
|
};
|
|
167
167
|
/**
|
|
168
|
-
* Retrieves directory provisioning
|
|
169
|
-
* @
|
|
170
|
-
* @returns A promise that resolves to the configuration object, or null if not configured/supported
|
|
168
|
+
* Retrieves all directory provisioning configurations for all connections.
|
|
169
|
+
* @returns A promise that resolves to the configurations object, or null if not configured/supported
|
|
171
170
|
*/
|
|
172
|
-
|
|
171
|
+
getConnectionDirectoryProvisionings(): Promise<DirectoryProvisioningConfig[] | null>;
|
|
173
172
|
/**
|
|
174
173
|
* Creates directory provisioning configuration for a connection.
|
|
175
174
|
*/
|