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.
Files changed (34) hide show
  1. package/.github/workflows/claude-code-review.yml +1 -4
  2. package/CHANGELOG.md +49 -1
  3. package/lib/tools/auth0/handlers/actions.js +1 -1
  4. package/lib/tools/auth0/handlers/clientGrants.d.ts +5 -0
  5. package/lib/tools/auth0/handlers/clientGrants.js +41 -8
  6. package/lib/tools/auth0/handlers/clients.d.ts +43 -8
  7. package/lib/tools/auth0/handlers/clients.js +109 -41
  8. package/lib/tools/auth0/handlers/connectionProfiles.js +0 -3
  9. package/lib/tools/auth0/handlers/connections.d.ts +7 -8
  10. package/lib/tools/auth0/handlers/connections.js +67 -59
  11. package/lib/tools/auth0/handlers/customDomains.d.ts +4 -0
  12. package/lib/tools/auth0/handlers/customDomains.js +6 -3
  13. package/lib/tools/auth0/handlers/databases.d.ts +71 -2
  14. package/lib/tools/auth0/handlers/databases.js +139 -25
  15. package/lib/tools/auth0/handlers/default.js +2 -4
  16. package/lib/tools/auth0/handlers/flowVaultConnections.js +6 -3
  17. package/lib/tools/auth0/handlers/flows.js +0 -3
  18. package/lib/tools/auth0/handlers/forms.js +0 -3
  19. package/lib/tools/auth0/handlers/logStreams.js +0 -3
  20. package/lib/tools/auth0/handlers/organizations.d.ts +4 -1
  21. package/lib/tools/auth0/handlers/organizations.js +61 -32
  22. package/lib/tools/auth0/handlers/prompts.d.ts +2 -2
  23. package/lib/tools/auth0/handlers/prompts.js +1 -0
  24. package/lib/tools/auth0/handlers/resourceServers.d.ts +1 -3
  25. package/lib/tools/auth0/handlers/resourceServers.js +4 -4
  26. package/lib/tools/auth0/handlers/roles.js +6 -3
  27. package/lib/tools/auth0/handlers/scimHandler.d.ts +5 -8
  28. package/lib/tools/auth0/handlers/scimHandler.js +19 -13
  29. package/lib/tools/auth0/handlers/selfServiceProfiles.d.ts +8 -0
  30. package/lib/tools/auth0/handlers/selfServiceProfiles.js +9 -0
  31. package/lib/tools/auth0/handlers/userAttributeProfiles.js +0 -3
  32. package/lib/tools/utils.d.ts +11 -0
  33. package/lib/tools/utils.js +24 -1
  34. package/package.json +8 -8
@@ -66,10 +66,13 @@ exports.schema = {
66
66
  const getAllFlowConnections = async (auth0Client) => {
67
67
  const allFlowConnections = [];
68
68
  let vaultConnections = await auth0Client.flows.vault.connections.list();
69
- do {
70
- allFlowConnections.push(...vaultConnections.data);
69
+ // Process first page
70
+ allFlowConnections.push(...vaultConnections.data);
71
+ // Fetch remaining pages
72
+ while (vaultConnections.hasNextPage()) {
71
73
  vaultConnections = await vaultConnections.getNextPage();
72
- } while (vaultConnections.hasNextPage());
74
+ allFlowConnections.push(...vaultConnections.data);
75
+ }
73
76
  return allFlowConnections;
74
77
  };
75
78
  exports.getAllFlowConnections = getAllFlowConnections;
@@ -70,9 +70,6 @@ class FlowHandler extends default_1.default {
70
70
  id: 'id',
71
71
  stripCreateFields: ['created_at', 'updated_at', 'executed_at'],
72
72
  stripUpdateFields: ['created_at', 'updated_at', 'executed_at'],
73
- functions: {
74
- update: async ({ id }, bodyParams) => this.client.flows.update(id, bodyParams),
75
- },
76
73
  });
77
74
  }
78
75
  objString(item) {
@@ -69,9 +69,6 @@ class FormsHandler extends default_1.default {
69
69
  id: 'id',
70
70
  stripCreateFields: ['created_at', 'updated_at', 'submitted_at', 'embedded_at'],
71
71
  stripUpdateFields: ['created_at', 'updated_at', 'submitted_at', 'embedded_at'],
72
- functions: {
73
- update: async ({ id }, bodyParams) => this.client.forms.update(id, bodyParams),
74
- },
75
72
  });
76
73
  }
77
74
  objString(item) {
@@ -96,9 +96,6 @@ class LogStreamsHandler extends default_1.default {
96
96
  'sink.splunkToken',
97
97
  'sink.datadogApiKey',
98
98
  ],
99
- functions: {
100
- update: async (params, payload) => this.client.logStreams.update(params?.id, payload),
101
- },
102
99
  });
103
100
  }
104
101
  objString(item) {
@@ -87,6 +87,9 @@ export declare const schema: {
87
87
  type: string;
88
88
  enum: string[];
89
89
  };
90
+ use_for_organization_discovery: {
91
+ type: string;
92
+ };
90
93
  };
91
94
  required: string[];
92
95
  };
@@ -122,7 +125,7 @@ export default class OrganizationsHandler extends DefaultHandler {
122
125
  getAllOrganizationDiscoveryDomains(organizationId: string): Promise<Management.OrganizationDiscoveryDomain[] | null>;
123
126
  getOrganizationDiscoveryDomain(organizationId: string, discoveryDomainId: string): Promise<Management.GetOrganizationDiscoveryDomainResponseContent>;
124
127
  createOrganizationDiscoveryDomain(organizationId: string, discoveryDomain: Management.CreateOrganizationDiscoveryDomainRequestContent): Promise<Management.CreateOrganizationDiscoveryDomainResponseContent>;
125
- updateOrganizationDiscoveryDomain(organizationId: string, discoveryDomainId: string, discoveryDomain: string, status: Management.OrganizationDiscoveryDomainStatus): Promise<Management.UpdateOrganizationDiscoveryDomainResponseContent>;
128
+ updateOrganizationDiscoveryDomain(organizationId: string, discoveryDomainId: string, discoveryDomain: string, discoveryDomainUpdate: Management.UpdateOrganizationDiscoveryDomainRequestContent): Promise<Management.UpdateOrganizationDiscoveryDomainResponseContent>;
126
129
  deleteOrganizationDiscoveryDomain(organizationId: string, discoveryDomain: string, discoveryDomainId: string): Promise<void>;
127
130
  }
128
131
  export {};
@@ -112,6 +112,9 @@ exports.schema = {
112
112
  properties: {
113
113
  domain: { type: 'string' },
114
114
  status: { type: 'string', enum: ['pending', 'verified'] },
115
+ use_for_organization_discovery: {
116
+ type: 'boolean',
117
+ },
115
118
  },
116
119
  required: ['domain', 'status'],
117
120
  },
@@ -174,6 +177,7 @@ class OrganizationsHandler extends default_1.default {
174
177
  generator: (discoveryDomain) => this.createOrganizationDiscoveryDomain(created.id, {
175
178
  domain: discoveryDomain?.domain,
176
179
  status: discoveryDomain?.status,
180
+ use_for_organization_discovery: discoveryDomain?.use_for_organization_discovery,
177
181
  }).catch((err) => {
178
182
  throw new Error(`Problem creating discovery domain ${discoveryDomain?.domain} for organization ${created.id}\n${err}`);
179
183
  }),
@@ -256,32 +260,47 @@ class OrganizationsHandler extends default_1.default {
256
260
  const orgDiscoveryDomainsToRemove = existingDiscoveryDomains?.filter((existingDomain) => !organizationDiscoveryDomains?.find((d) => d.domain === existingDomain.domain)) || [];
257
261
  const orgDiscoveryDomainsToAdd = organizationDiscoveryDomains?.filter((domain) => !existingDiscoveryDomains?.find((d) => d.domain === domain.domain)) || [];
258
262
  const orgDiscoveryDomainsToUpdate = existingDiscoveryDomains
259
- ?.filter((existingDomain) => {
263
+ ?.map((existingDomain) => {
260
264
  const updatedDomain = organizationDiscoveryDomains?.find((d) => d.domain === existingDomain.domain);
261
- return updatedDomain && updatedDomain.status !== existingDomain.status;
265
+ if (!updatedDomain)
266
+ return undefined;
267
+ return {
268
+ ...updatedDomain,
269
+ id: existingDomain.id, // setting remote id for update
270
+ };
262
271
  })
263
- .map((existingDomain) => ({
264
- id: existingDomain.id,
265
- domain: existingDomain.domain,
266
- status: organizationDiscoveryDomains.find((d) => d.domain === existingDomain.domain)
267
- .status,
268
- })) || [];
269
- // Handle updates first
270
- await Promise.all(orgDiscoveryDomainsToUpdate.map((domainUpdate) => this.updateOrganizationDiscoveryDomain(params.id, domainUpdate.id, domainUpdate.domain, domainUpdate.status).catch((err) => {
271
- throw new Error(`Problem updating discovery domain ${domainUpdate.domain} for organization ${params.id}\n${err.message}`);
272
- })));
273
- await Promise.all(orgDiscoveryDomainsToAdd.map((domain) => this.createOrganizationDiscoveryDomain(params.id, {
274
- domain: domain.domain,
275
- status: domain.status,
276
- }).catch((err) => {
277
- throw new Error(`Problem adding discovery domain ${domain.domain} for organization ${params.id}\n${err.message}`);
278
- })));
272
+ .filter(Boolean) || [];
273
+ for (const { id, domain, ...updateParams } of orgDiscoveryDomainsToUpdate) {
274
+ try {
275
+ await this.updateOrganizationDiscoveryDomain(params.id, id, domain, updateParams);
276
+ }
277
+ catch (err) {
278
+ throw new Error(`Problem updating discovery domain ${domain} for organization ${params.id}\n${err.message}`);
279
+ }
280
+ }
281
+ for (const domain of orgDiscoveryDomainsToAdd) {
282
+ try {
283
+ await this.createOrganizationDiscoveryDomain(params.id, {
284
+ domain: domain.domain,
285
+ status: domain.status,
286
+ use_for_organization_discovery: domain.use_for_organization_discovery,
287
+ });
288
+ }
289
+ catch (err) {
290
+ throw new Error(`Problem adding discovery domain ${domain.domain} for organization ${params.id}\n${err.message}`);
291
+ }
292
+ }
279
293
  if (orgDiscoveryDomainsToRemove.length > 0) {
280
294
  if (this.config('AUTH0_ALLOW_DELETE') === 'true' ||
281
295
  this.config('AUTH0_ALLOW_DELETE') === true) {
282
- await Promise.all(orgDiscoveryDomainsToRemove.map((domain) => this.deleteOrganizationDiscoveryDomain(params.id, domain.domain, domain.id).catch((err) => {
283
- throw new Error(`Problem removing discovery domain ${domain.domain} for organization ${params.id}\n${err.message}`);
284
- })));
296
+ for (const domain of orgDiscoveryDomainsToRemove) {
297
+ try {
298
+ await this.deleteOrganizationDiscoveryDomain(params.id, domain.domain, domain.id);
299
+ }
300
+ catch (err) {
301
+ throw new Error(`Problem removing discovery domain ${domain.domain} for organization ${params.id}\n${err.message}`);
302
+ }
303
+ }
285
304
  }
286
305
  else {
287
306
  logger_1.default.warn(`Detected the following organization discovery domains should be deleted. Doing so may be destructive.\nYou can enable deletes by setting 'AUTH0_ALLOW_DELETE' to true in the config
@@ -416,19 +435,25 @@ class OrganizationsHandler extends default_1.default {
416
435
  async getOrganizationEnabledConnections(organizationId) {
417
436
  const allOrganizationConnections = [];
418
437
  let organizationConnections = await this.client.organizations.enabledConnections.list(organizationId);
419
- do {
420
- allOrganizationConnections.push(...organizationConnections.data);
438
+ // Process first page
439
+ allOrganizationConnections.push(...organizationConnections.data);
440
+ // Fetch remaining pages
441
+ while (organizationConnections.hasNextPage()) {
421
442
  organizationConnections = await organizationConnections.getNextPage();
422
- } while (organizationConnections.hasNextPage());
443
+ allOrganizationConnections.push(...organizationConnections.data);
444
+ }
423
445
  return allOrganizationConnections;
424
446
  }
425
447
  async getOrganizationClientGrants(organizationId) {
426
448
  const allOrganizationClientGrants = [];
427
449
  let organizationClientGrants = await this.client.organizations.clientGrants.list(organizationId);
428
- do {
429
- allOrganizationClientGrants.push(...organizationClientGrants.data);
450
+ // Process first page
451
+ allOrganizationClientGrants.push(...organizationClientGrants.data);
452
+ // Fetch remaining pages
453
+ while (organizationClientGrants.hasNextPage()) {
430
454
  organizationClientGrants = await organizationClientGrants.getNextPage();
431
- } while (organizationClientGrants.hasNextPage());
455
+ allOrganizationClientGrants.push(...organizationClientGrants.data);
456
+ }
432
457
  return allOrganizationClientGrants;
433
458
  }
434
459
  async createOrganizationClientGrants(organizationId, grantId) {
@@ -447,10 +472,13 @@ class OrganizationsHandler extends default_1.default {
447
472
  const allDiscoveryDomains = [];
448
473
  try {
449
474
  let orgDiscoveryDomain = await this.client.organizations.discoveryDomains.list(organizationId);
450
- do {
451
- allDiscoveryDomains.push(...orgDiscoveryDomain.data);
475
+ // Process first page
476
+ allDiscoveryDomains.push(...orgDiscoveryDomain.data);
477
+ // Fetch remaining pages
478
+ while (orgDiscoveryDomain.hasNextPage()) {
452
479
  orgDiscoveryDomain = await orgDiscoveryDomain.getNextPage();
453
- } while (orgDiscoveryDomain.hasNextPage());
480
+ allDiscoveryDomains.push(...orgDiscoveryDomain.data);
481
+ }
454
482
  return allDiscoveryDomains;
455
483
  }
456
484
  catch (err) {
@@ -480,7 +508,7 @@ class OrganizationsHandler extends default_1.default {
480
508
  .promise();
481
509
  return orgDiscoveryDomain;
482
510
  }
483
- async updateOrganizationDiscoveryDomain(organizationId, discoveryDomainId, discoveryDomain, status) {
511
+ async updateOrganizationDiscoveryDomain(organizationId, discoveryDomainId, discoveryDomain, discoveryDomainUpdate) {
484
512
  logger_1.default.debug(`Updating discovery domain ${discoveryDomain} for organization ${organizationId}`);
485
513
  // stripUpdateFields does not support in sub modules
486
514
  const stripUpdateFields = ['verification_host', 'verification_txt'];
@@ -492,7 +520,8 @@ class OrganizationsHandler extends default_1.default {
492
520
  discoveryDomainId: discoveryDomainId,
493
521
  },
494
522
  generator: (args) => this.client.organizations.discoveryDomains.update(args.id, args.discoveryDomainId, {
495
- status: status,
523
+ status: discoveryDomainUpdate.status,
524
+ use_for_organization_discovery: discoveryDomainUpdate.use_for_organization_discovery,
496
525
  }),
497
526
  })
498
527
  .promise();
@@ -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.AculResponseContent;
78
+ export type ScreenRenderer = Management.GetAculResponseContent;
79
79
  export type Prompts = Partial<PromptSettings & {
80
80
  customText: AllPromptsByLanguage;
81
81
  partials: CustomPromptPartials;
@@ -103,6 +103,7 @@ const screenTypes = [
103
103
  'email-otp-challenge',
104
104
  'redeem-ticket',
105
105
  'organization-selection',
106
+ 'pre-login-organization-picker',
106
107
  'accept-invitation',
107
108
  'login-passwordless-email-code',
108
109
  'login-passwordless-email-link',
@@ -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(args: {
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: (args, data) => this.updateResourceServer(args, data),
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(args, update) {
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(args?.id, updateFields);
184
+ return this.client.resourceServers.update(id, updateFields);
185
185
  }
186
- return this.client.resourceServers.update(args?.id, 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
- do {
198
- allPermission.push(...permissions.data);
197
+ // Process first page
198
+ allPermission.push(...permissions.data);
199
+ // Fetch remaining pages
200
+ while (permissions.hasNextPage()) {
199
201
  permissions = await permissions.getNextPage();
200
- } while (permissions.hasNextPage());
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({ id }: ScimRequestParams, { user_id_attribute, mapping }: ScimBodyParams): Promise<Asset | null>;
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({ id, }: ScimRequestParams): Promise<Management.GetScimConfigurationResponseContent | null>;
65
+ getScimConfiguration(id: string): Promise<Management.GetScimConfigurationResponseContent | null>;
69
66
  /**
70
67
  * Updates an existing `SCIM` configuration.
71
68
  */
72
- updateScimConfiguration({ id }: ScimRequestParams, { user_id_attribute, mapping }: ScimBodyParams): Promise<Asset | null>;
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({ id }: ScimRequestParams): Promise<Asset | null>;
77
- updateOverride(requestParams: ScimRequestParams, bodyParams: Asset): Promise<Management.UpdateConnectionResponseContent>;
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({ id: connection.id })
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({ id },
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({ id, }) {
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({ id },
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,22 @@ class ScimHandler {
181
181
  /**
182
182
  * Deletes an existing `SCIM` configuration.
183
183
  */
184
- async deleteScimConfiguration({ id }) {
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(requestParams, bodyParams) {
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
+ // Remove deprecated enabled_clients field
195
+ if ('enabled_clients' in bodyParams)
196
+ delete bodyParams.enabled_clients;
194
197
  // First, update `connections`.
195
- const updated = await this.connectionsManager.update(requestParams.id, bodyParams);
196
- const idMapEntry = this.idMap.get(requestParams.id);
198
+ const updated = await this.connectionsManager.update(connectionId, bodyParams);
199
+ const idMapEntry = this.idMap.get(connectionId);
197
200
  // Now, update `scim_configuration` inside the updated connection.
198
201
  // If `scim_configuration` exists in both local and remote -> updateScimConfiguration(...)
199
202
  // If `scim_configuration` exists in remote but local -> deleteScimConfiguration(...)
@@ -201,20 +204,20 @@ class ScimHandler {
201
204
  if (idMapEntry?.scimConfiguration) {
202
205
  if (scimBodyParams) {
203
206
  if (this.scimScopes.update) {
204
- await this.updateScimConfiguration(requestParams, scimBodyParams);
207
+ await this.updateScimConfiguration(connectionId, scimBodyParams);
205
208
  }
206
209
  }
207
210
  else if (this.config('AUTH0_ALLOW_DELETE')) {
208
211
  if (this.scimScopes.delete) {
209
- await this.deleteScimConfiguration(requestParams);
212
+ await this.deleteScimConfiguration(connectionId);
210
213
  }
211
214
  }
212
215
  else {
213
- logger_1.default.warn(`Skipping DELETE scim_configuration on \"${requestParams.id}\". Enable deletes by setting \"AUTH0_ALLOW_DELETE\" to true in your config.`);
216
+ logger_1.default.warn(`Skipping DELETE scim_configuration on \"${connectionId}\". Enable deletes by setting \"AUTH0_ALLOW_DELETE\" to true in your config.`);
214
217
  }
215
218
  }
216
219
  else if (scimBodyParams && this.scimScopes.create) {
217
- await this.createScimConfiguration(requestParams, scimBodyParams);
220
+ await this.createScimConfiguration(connectionId, scimBodyParams);
218
221
  }
219
222
  // Return response from connections.update(...).
220
223
  return updated;
@@ -225,11 +228,14 @@ class ScimHandler {
225
228
  const { scim_configuration: scimBodyParams } = bodyParams;
226
229
  delete bodyParams.scim_configuration;
227
230
  delete bodyParams.directory_provisioning_configuration;
231
+ // Remove deprecated enabled_clients field
232
+ if ('enabled_clients' in bodyParams)
233
+ delete bodyParams.enabled_clients;
228
234
  // First, create the new `connection`.
229
235
  const data = await this.connectionsManager.create(bodyParams);
230
236
  if (data?.id && scimBodyParams && this.scimScopes.create) {
231
237
  // Now, create the `scim_configuration` for newly created `connection`.
232
- await this.createScimConfiguration({ id: data.id }, scimBodyParams);
238
+ await this.createScimConfiguration(data.id, scimBodyParams);
233
239
  }
234
240
  // Return response from connections.create(...).
235
241
  return data;
@@ -48,6 +48,14 @@ export declare const schema: {
48
48
  };
49
49
  };
50
50
  };
51
+ allowed_strategies: {
52
+ type: string;
53
+ description: string;
54
+ items: {
55
+ type: string;
56
+ enum: ("pingfederate" | "adfs" | "waad" | "google-apps" | "okta" | "oidc" | "samlp" | "auth0-samlp" | "okta-samlp" | "keycloak-samlp")[];
57
+ };
58
+ };
51
59
  branding: {
52
60
  type: string;
53
61
  properties: {
@@ -43,6 +43,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
43
43
  };
44
44
  Object.defineProperty(exports, "__esModule", { value: true });
45
45
  exports.schema = void 0;
46
+ const auth0_1 = require("auth0");
46
47
  const lodash_1 = require("lodash");
47
48
  const logger_1 = __importDefault(require("../../../logger"));
48
49
  const default_1 = __importStar(require("./default"));
@@ -86,6 +87,14 @@ exports.schema = {
86
87
  },
87
88
  },
88
89
  },
90
+ allowed_strategies: {
91
+ type: 'array',
92
+ description: 'List of IdP strategies that will be shown to users during the Self-Service SSO flow.',
93
+ items: {
94
+ type: 'string',
95
+ enum: Object.values(auth0_1.Management.SelfServiceProfileAllowedStrategyEnum),
96
+ },
97
+ },
89
98
  branding: {
90
99
  type: 'object',
91
100
  properties: {
@@ -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() {
@@ -6,6 +6,8 @@ export declare function keywordStringReplace(input: string, mappings: KeywordMap
6
6
  export declare function keywordReplace(input: string | undefined, mappings: KeywordMappings): string;
7
7
  export declare function wrapArrayReplaceMarkersInQuotes(body: string, mappings: KeywordMappings): string;
8
8
  export declare function convertClientNameToId(name: string, clients: Asset[]): string;
9
+ export declare function convertActionNameToId(name: string, actions: Asset[]): string;
10
+ export declare function convertActionIdToName(id: string, actions: Asset[]): string;
9
11
  export declare function convertClientNamesToIds(names: string[], clients: Asset[]): string[];
10
12
  export declare function loadFileAndReplaceKeywords(file: string, { mappings, disableKeywordReplacement, }: {
11
13
  mappings: KeywordMappings;
@@ -44,3 +46,12 @@ export declare function maskSecretAtPath({ resourceTypeName, maskedKeyName, mask
44
46
  maskOnObj: object;
45
47
  keyJsonPath: string;
46
48
  }): any;
49
+ /**
50
+ * Determines whether third-party clients should be excluded based on configuration.
51
+ * Checks the AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS config value and returns true if it's
52
+ * set to boolean true or string 'true'.
53
+ *
54
+ * @param configFn - The configuration function to retrieve the config value.
55
+ * @returns True if third-party clients should be excluded, false otherwise.
56
+ */
57
+ export declare const shouldExcludeThirdPartyClients: (configFn: (key: string) => any) => boolean;
@@ -36,12 +36,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
36
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.isForbiddenFeatureError = exports.isDeprecatedError = exports.detectInsufficientScopeError = exports.stripObfuscatedFieldsFromPayload = exports.obfuscateSensitiveValues = exports.keywordReplaceStringRegExp = exports.keywordReplaceArrayRegExp = void 0;
39
+ exports.shouldExcludeThirdPartyClients = exports.isForbiddenFeatureError = exports.isDeprecatedError = exports.detectInsufficientScopeError = exports.stripObfuscatedFieldsFromPayload = exports.obfuscateSensitiveValues = exports.keywordReplaceStringRegExp = exports.keywordReplaceArrayRegExp = void 0;
40
40
  exports.keywordArrayReplace = keywordArrayReplace;
41
41
  exports.keywordStringReplace = keywordStringReplace;
42
42
  exports.keywordReplace = keywordReplace;
43
43
  exports.wrapArrayReplaceMarkersInQuotes = wrapArrayReplaceMarkersInQuotes;
44
44
  exports.convertClientNameToId = convertClientNameToId;
45
+ exports.convertActionNameToId = convertActionNameToId;
46
+ exports.convertActionIdToName = convertActionIdToName;
45
47
  exports.convertClientNamesToIds = convertClientNamesToIds;
46
48
  exports.loadFileAndReplaceKeywords = loadFileAndReplaceKeywords;
47
49
  exports.flatten = flatten;
@@ -115,6 +117,14 @@ function convertClientNameToId(name, clients) {
115
117
  const found = clients.find((c) => c.name === name);
116
118
  return (found && found.client_id) || name;
117
119
  }
120
+ function convertActionNameToId(name, actions) {
121
+ const found = actions.find((a) => a.name === name);
122
+ return (found && found.id) || name;
123
+ }
124
+ function convertActionIdToName(id, actions) {
125
+ const found = actions.find((a) => a.id === id);
126
+ return (found && found.name) || id;
127
+ }
118
128
  function convertClientNamesToIds(names, clients) {
119
129
  const resolvedNames = names.map((name) => ({ name, resolved: false }));
120
130
  const result = clients.reduce((acc, client) => {
@@ -311,3 +321,16 @@ function maskSecretAtPath({ resourceTypeName, maskedKeyName, maskOnObj, keyJsonP
311
321
  }
312
322
  return maskOnObj;
313
323
  }
324
+ /**
325
+ * Determines whether third-party clients should be excluded based on configuration.
326
+ * Checks the AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS config value and returns true if it's
327
+ * set to boolean true or string 'true'.
328
+ *
329
+ * @param configFn - The configuration function to retrieve the config value.
330
+ * @returns True if third-party clients should be excluded, false otherwise.
331
+ */
332
+ const shouldExcludeThirdPartyClients = (configFn) => {
333
+ const value = configFn('AUTH0_EXCLUDE_THIRD_PARTY_CLIENTS');
334
+ return value === 'true' || value === true;
335
+ };
336
+ exports.shouldExcludeThirdPartyClients = shouldExcludeThirdPartyClients;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "auth0-deploy-cli",
3
- "version": "8.25.0",
3
+ "version": "8.27.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.2.0",
36
+ "auth0": "^5.3.1",
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.21",
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.18.0",
45
+ "undici": "^7.21.0",
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.21",
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.52.0",
56
- "@typescript-eslint/parser": "^8.52.0",
55
+ "@typescript-eslint/eslint-plugin": "^8.55.0",
56
+ "@typescript-eslint/parser": "^8.55.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": "^10.1.0",
75
+ "ts-mocha": "^11.1.0",
76
76
  "typescript": "^5.9.3"
77
77
  },
78
78
  "engines": {