diff --git a/docs/v8_MIGRATION_GUIDE.md b/docs/v8_MIGRATION_GUIDE.md index f0352a93..eca56d0e 100644 --- a/docs/v8_MIGRATION_GUIDE.md +++ b/docs/v8_MIGRATION_GUIDE.md @@ -3,11 +3,11 @@ Guide to migrating from `7.x` to `8.x` - [General](#general) - - [Node 18 or newer is required](#node-18-or-newer-is-required) - - [Auth0 V4 Migration Guide](https://github.com/auth0/node-auth0/blob/master/v4_MIGRATION_GUIDE.md) + - [Node 18 or newer is required](#node-18-or-newer-is-required) + - [Auth0 V4 Migration Guide](https://github.com/auth0/node-auth0/blob/master/v4_MIGRATION_GUIDE.md) - [Management Resources](#management-resources) - - [EmailProvider](#emailProvider) - - [Migrations](#migrations) + - [EmailProvider](#emailProvider) + - [Migrations](#migrations) ## General @@ -18,29 +18,27 @@ Node 18 LTS and newer LTS releases are supported. ## Management Resources | Resource | Change | Description | -|---------------|------------------|-----------------------------------------------| +| ------------- | ---------------- | --------------------------------------------- | | emailProvider | delete operation | Delete operation is deprecated on auth0 `4.x` | | migrations | removed support | Not supported on auth0 `4.x` | #### Note: Other resources from `7.x` are not affected and no changes are required. -#### emailProvider +#### emailProvider : The `delete` operation on the `emailProvider` resource will disable the email provider instead of deleting it. -This is because the email provider deletion operation is deprecated on auth0 `4.x`. User can disable the email provider +This is because the email provider deletion operation is not supported on auth0 `4.x`. User can disable the email provider by email provider setting the `enabled` property to `false` from the configuration file. ```yaml - emailProvider: - # other properties - enabled: false +emailProvider: + # other properties + enabled: false ``` Rest of the operations on emailProvider resource will work the same as `7.x`. -#### migrations +#### migrations : The `migrations` resource is not supported on auth0 `4.x`. It's recommended to remove the `migrations` resource from the configuration file. If it's not removed, the deploy CLI will ignore the `migrations` resource for operations. - - diff --git a/package-lock.json b/package-lock.json index e6e1ef59..4730d44d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "ajv": "^6.12.6", - "auth0": "^4.15.0", + "auth0": "^4.16.0", "dot-prop": "^5.2.0", "fs-extra": "^10.1.0", "global-agent": "^3.0.0", @@ -1404,9 +1404,9 @@ "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" }, "node_modules/auth0": { - "version": "4.15.0", - "resolved": "https://registry.npmjs.org/auth0/-/auth0-4.15.0.tgz", - "integrity": "sha512-GPJJcDxk0sMnpbTZf9QWHXJrdPoSTG9eG5q9Un7X+eNKhZVPEzr3sSK3/EToRP4fNIPKbCWjXa2+HM3GnY3F4g==", + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/auth0/-/auth0-4.16.0.tgz", + "integrity": "sha512-RB+CFDONkvDkH1W4blDq4eJbCa6QdeIeE2Fb8tTfUtC1HVqTYuJp/hFJVkTJSzrqlNRLWmrHaG4eEV4rDtpInw==", "license": "MIT", "dependencies": { "jose": "^4.13.2", @@ -7608,9 +7608,9 @@ "integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==" }, "auth0": { - "version": "4.15.0", - "resolved": "https://registry.npmjs.org/auth0/-/auth0-4.15.0.tgz", - "integrity": "sha512-GPJJcDxk0sMnpbTZf9QWHXJrdPoSTG9eG5q9Un7X+eNKhZVPEzr3sSK3/EToRP4fNIPKbCWjXa2+HM3GnY3F4g==", + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/auth0/-/auth0-4.16.0.tgz", + "integrity": "sha512-RB+CFDONkvDkH1W4blDq4eJbCa6QdeIeE2Fb8tTfUtC1HVqTYuJp/hFJVkTJSzrqlNRLWmrHaG4eEV4rDtpInw==", "requires": { "jose": "^4.13.2", "undici-types": "^6.15.0", diff --git a/package.json b/package.json index 60590c52..fef2f742 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "homepage": "https://github.com/auth0/auth0-deploy-cli#readme", "dependencies": { "ajv": "^6.12.6", - "auth0": "^4.15.0", + "auth0": "^4.16.0", "dot-prop": "^5.2.0", "fs-extra": "^10.1.0", "global-agent": "^3.0.0", diff --git a/src/context/defaults.ts b/src/context/defaults.ts index e498c5f4..0c1c4563 100644 --- a/src/context/defaults.ts +++ b/src/context/defaults.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line import/prefer-default-export export function emailProviderDefaults(emailProvider) { // eslint-disable-line const updated = { ...emailProvider }; @@ -33,5 +34,21 @@ export function emailProviderDefaults(emailProvider) { }; } + if (name === 'azure_cs') { + updated.credentials = { + connectionString: '##AZURE_CS_CONNECTION_KEY##', + ...(updated.credentials || {}), + }; + } + + if (name === 'ms365') { + updated.credentials = { + tenantId: '##MS365_TENANT_ID##', + clientId: '##MS365_CLIENT_ID##', + clientSecret: '##MS365_CLIENT_SECRET##', + ...(updated.credentials || {}), + }; + } + return updated; } diff --git a/src/tools/auth0/handlers/emailProvider.ts b/src/tools/auth0/handlers/emailProvider.ts index a116b7f7..1d86a7d7 100644 --- a/src/tools/auth0/handlers/emailProvider.ts +++ b/src/tools/auth0/handlers/emailProvider.ts @@ -2,6 +2,7 @@ import { EmailProviderCreate } from 'auth0'; import { isEmpty } from 'lodash'; import DefaultHandler, { order } from './default'; import { Asset, Assets } from '../../../types'; +import log from '../../../logger'; export const schema = { type: 'object' }; @@ -41,10 +42,10 @@ export default class EmailProviderHandler extends DefaultHandler { const existing = await this.getType(); - // HTTP DELETE on emails/provider is not public, so not part of our vNext SDK. + // HTTP DELETE on emails/provider is not supported, as this is not part of our vNext SDK. if (Object.keys(emailProvider).length === 0) { if (this.config('AUTH0_ALLOW_DELETE') === true) { - // await this.client.emails.delete(); + // await this.client.emails.delete(); is not supported existing.enabled = false; if (isEmpty(existing.credentials)) { delete existing.credentials; @@ -59,7 +60,7 @@ export default class EmailProviderHandler extends DefaultHandler { if (existing.name) { if (existing.name !== emailProvider.name) { // Delete the current provider as it's different - // await this.client.emailProvider.delete(); + // await this.client.emailProvider.delete(); is not supported existing.enabled = false; } }