auth0-deploy-cli
Advanced tools
Comparing version
@@ -10,2 +10,20 @@ # Changelog | ||
## [8.7.0] - 2025-03-13 | ||
### Added | ||
- Add support for extensibility as custom phone provider `phoneProviders` [#1038] | ||
- Add support for checkpoint pagination for GET `connections` [#1041] | ||
### Fixed | ||
- Removed survey link from import/export command [#1039] | ||
- Fix dumping JSON files with keyword preserve markers in client grants [#1040] | ||
- Fix warn log insufficient scope for branding templates export [#1047] | ||
### Security | ||
- Security fixes from dependencies [#1046] | ||
- Node 20(v20.18.3) LTS and newer LTS releases are supported [#1046] | ||
## [8.6.2] - 2025-02-21 | ||
@@ -1239,3 +1257,10 @@ | ||
[#1035]: https://github.com/auth0/auth0-deploy-cli/issues/1035 | ||
[unreleased]: https://github.com/auth0/auth0-deploy-cli/compare/v8.6.2...HEAD | ||
[#1038]: https://github.com/auth0/auth0-deploy-cli/issues/1038 | ||
[#1039]: https://github.com/auth0/auth0-deploy-cli/issues/1039 | ||
[#1040]: https://github.com/auth0/auth0-deploy-cli/issues/1040 | ||
[#1041]: https://github.com/auth0/auth0-deploy-cli/issues/1041 | ||
[#1046]: https://github.com/auth0/auth0-deploy-cli/issues/1046 | ||
[#1047]: https://github.com/auth0/auth0-deploy-cli/issues/1047 | ||
[unreleased]: https://github.com/auth0/auth0-deploy-cli/compare/v8.7.0...HEAD | ||
[8.7.0]: https://github.com/auth0/auth0-deploy-cli/compare/v8.6.2...v8.7.0 | ||
[8.6.2]: https://github.com/auth0/auth0-deploy-cli/compare/v8.6.1...v8.6.2 | ||
@@ -1242,0 +1267,0 @@ [8.6.1]: https://github.com/auth0/auth0-deploy-cli/compare/v8.6.0...v8.6.1 |
@@ -60,15 +60,4 @@ "use strict"; | ||
logger_1.default.info('Export Successful'); | ||
logger_1.default.info(` | ||
================================================ | ||
======= Help us improve Auth0 Deploy CLI ======= | ||
================================================ | ||
We're on a mission to make Auth0 Deploy CLI the best it can be, and we need YOUR help. | ||
We've put together a brief survey to understand how you use Deploy CLI, what you love about it, and where you think we can do better. | ||
===> https://www.surveymonkey.com/r/LZKMPFN <=== | ||
Thank you for helping us make Auth0 Deploy CLI better for everyone! | ||
================================================`); | ||
}); | ||
} | ||
//# sourceMappingURL=export.js.map |
@@ -53,15 +53,4 @@ "use strict"; | ||
logger_1.default.info('Import Successful'); | ||
logger_1.default.info(` | ||
================================================ | ||
======= Help us improve Auth0 Deploy CLI ======= | ||
================================================ | ||
We're on a mission to make Auth0 Deploy CLI the best it can be, and we need YOUR help. | ||
We've put together a brief survey to understand how you use Deploy CLI, what you love about it, and where you think we can do better. | ||
===> https://www.surveymonkey.com/r/LZKMPFN <=== | ||
Thank you for helping us make Auth0 Deploy CLI better for everyone! | ||
================================================`); | ||
}); | ||
} | ||
//# sourceMappingURL=import.js.map |
export declare function emailProviderDefaults(emailProvider: any): any; | ||
export declare function phoneProviderDefaults(phoneProvider: any): any; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.emailProviderDefaults = emailProviderDefaults; | ||
exports.phoneProviderDefaults = phoneProviderDefaults; | ||
// eslint-disable-next-line import/prefer-default-export | ||
@@ -28,2 +29,20 @@ function emailProviderDefaults(emailProvider) { | ||
} | ||
function phoneProviderDefaults(phoneProvider) { | ||
const updated = Object.assign({}, phoneProvider); | ||
const removeKeysFromOutput = ['id', 'created_at', 'updated_at', 'channel', 'tenant', 'credentials']; | ||
removeKeysFromOutput.forEach((key) => { | ||
if (key in updated) { | ||
delete updated[key]; | ||
} | ||
}); | ||
const apiKeyProviders = ['twilio']; | ||
// Add placeholder for credentials as they cannot be exported | ||
const { name } = updated; | ||
if (apiKeyProviders.includes(name)) { | ||
updated.credentials = { | ||
auth_token: `##${name.toUpperCase()}_AUTH_TOKEN##`, | ||
}; | ||
} | ||
return updated; | ||
} | ||
//# sourceMappingURL=defaults.js.map |
@@ -20,2 +20,3 @@ "use strict"; | ||
const client_1 = require("../../../tools/auth0/client"); | ||
const keywordPreservation_1 = require("../../../keywordPreservation"); | ||
function parse(context) { | ||
@@ -60,5 +61,3 @@ const grantsFolder = path_1.default.join(context.filePath, tools_1.constants.CLIENTS_GRANTS_DIRECTORY); | ||
const clientName = (() => { | ||
const associatedClient = allClients.find((client) => { | ||
return client.client_id === grant.client_id; | ||
}); | ||
const associatedClient = allClients.find((client) => client.client_id === grant.client_id); | ||
if (associatedClient === undefined) | ||
@@ -68,11 +67,22 @@ return grant.client_id; | ||
})(); | ||
const apiName = (() => { | ||
const associatedAPI = allResourceServers.find((resourceServer) => { | ||
return resourceServer.identifier === grant.audience; | ||
}); | ||
// Convert audience to the API name for readability | ||
const apiName = (grantAudience) => { | ||
const associatedAPI = allResourceServers.find((resourceServer) => resourceServer.identifier === grantAudience); | ||
if (associatedAPI === undefined) | ||
return grant.audience; | ||
return associatedAPI.name; | ||
})(); | ||
const name = (0, utils_1.sanitize)(`${clientName}-${apiName}`); | ||
return grantAudience; // Use the audience if the API is not found | ||
return associatedAPI.name; // Use the name of the API | ||
}; | ||
// Replace keyword markers if necessary | ||
const clientNameNonMarker = (0, keywordPreservation_1.doesHaveKeywordMarker)(clientName, context.mappings) | ||
? (0, tools_1.keywordReplace)(clientName, context.mappings) | ||
: clientName; | ||
const apiAudienceNonMarker = (0, keywordPreservation_1.doesHaveKeywordMarker)(grant.audience, context.mappings) | ||
? (0, tools_1.keywordReplace)(grant.audience, context.mappings) | ||
: grant.audience; | ||
// Construct the name using non-marker names | ||
const name = (0, utils_1.sanitize)(`${clientNameNonMarker}-${apiName(apiAudienceNonMarker)}`); | ||
// Ensure the name is not empty or invalid | ||
if (!name || name.trim().length === 0) { | ||
throw new Error(`Invalid name generated for client grant: ${JSON.stringify(grant)}`); | ||
} | ||
const grantFile = path_1.default.join(grantsFolder, `${name}.json`); | ||
@@ -79,0 +89,0 @@ (0, utils_1.dumpJSON)(grantFile, dumpGrant); |
@@ -27,2 +27,3 @@ "use strict"; | ||
const branding_1 = __importDefault(require("./branding")); | ||
const phoneProvider_1 = __importDefault(require("./phoneProvider")); | ||
const logStreams_1 = __importDefault(require("./logStreams")); | ||
@@ -64,2 +65,3 @@ const prompts_1 = __importDefault(require("./prompts")); | ||
branding: branding_1.default, | ||
phoneProviders: phoneProvider_1.default, | ||
logStreams: logStreams_1.default, | ||
@@ -66,0 +68,0 @@ prompts: prompts_1.default, |
@@ -27,2 +27,3 @@ "use strict"; | ||
const branding_1 = __importDefault(require("./branding")); | ||
const phoneProvider_1 = __importDefault(require("./phoneProvider")); | ||
const logStreams_1 = __importDefault(require("./logStreams")); | ||
@@ -64,2 +65,3 @@ const prompts_1 = __importDefault(require("./prompts")); | ||
branding: branding_1.default, | ||
phoneProviders: phoneProvider_1.default, | ||
logStreams: logStreams_1.default, | ||
@@ -66,0 +68,0 @@ prompts: prompts_1.default, |
@@ -56,2 +56,3 @@ #!/usr/bin/env node | ||
BRANDING_DIRECTORY: string; | ||
PHONE_PROVIDER_DIRECTORY: string; | ||
BRANDING_TEMPLATES_DIRECTORY: string; | ||
@@ -58,0 +59,0 @@ BRANDING_TEMPLATES_YAML_DIRECTORY: string; |
@@ -196,2 +196,12 @@ "use strict"; | ||
} | ||
// Update the clientGrants audience field if it exists | ||
if (updatedRemoteAssets && updatedRemoteAssets.clientGrants) { | ||
for (let i = 0; i < updatedRemoteAssets.clientGrants.length; i++) { | ||
const clientGrant = updatedRemoteAssets.clientGrants[i]; | ||
if (clientGrant.audience === remoteValue) { | ||
clientGrant.audience = localValue; | ||
} | ||
updatedRemoteAssets.clientGrants[i] = clientGrant; | ||
} | ||
} | ||
// Two address possibilities are provided to account for cases when there is a keyword | ||
@@ -198,0 +208,0 @@ // in the resources's identifier field. When the resource identifier's field is preserved |
@@ -127,4 +127,6 @@ "use strict"; | ||
logger_1.default.debug(`Error calling branding API, ${err.message}, status code: ${err.statusCode}`); | ||
if (err.statusCode === 403) | ||
if (err.statusCode === 403) { | ||
logger_1.default.warn('Insufficient scope the read:custom_domains scope is not set. Branding templates will not be exported.'); | ||
return branding; | ||
} | ||
if (err.statusCode === 404) | ||
@@ -131,0 +133,0 @@ return branding; |
@@ -154,3 +154,3 @@ "use strict"; | ||
const connections = yield (0, client_1.paginate)(this.client.connections.getAll, { | ||
paginate: true, | ||
checkpoint: true, | ||
include_totals: true, | ||
@@ -187,3 +187,3 @@ }); | ||
const existingConnections = yield (0, client_1.paginate)(this.client.connections.getAll, { | ||
paginate: true, | ||
checkpoint: true, | ||
include_totals: true, | ||
@@ -190,0 +190,0 @@ }); |
@@ -192,3 +192,3 @@ "use strict"; | ||
strategy: [auth0_1.GetConnectionsStrategyEnum.auth0], | ||
paginate: true, | ||
checkpoint: true, | ||
include_totals: true, | ||
@@ -221,3 +221,3 @@ }); | ||
strategy: [auth0_1.GetConnectionsStrategyEnum.auth0], | ||
paginate: true, | ||
checkpoint: true, | ||
include_totals: true, | ||
@@ -224,0 +224,0 @@ }); |
@@ -90,3 +90,2 @@ "use strict"; | ||
// await this.client.emails.delete(); is not supported | ||
existing.enabled = false; | ||
if ((0, lodash_1.isEmpty)(existing.credentials)) { | ||
@@ -102,9 +101,2 @@ delete existing.credentials; | ||
if (existing.name) { | ||
if (existing.name !== emailProvider.name) { | ||
// Delete the current provider as it's different | ||
// await this.client.emailProvider.delete(); is not supported | ||
existing.enabled = false; | ||
} | ||
} | ||
if (existing.name) { | ||
const updated = yield this.client.emails.update(emailProvider); | ||
@@ -111,0 +103,0 @@ this.updated += 1; |
@@ -56,2 +56,3 @@ "use strict"; | ||
const branding = __importStar(require("./branding")); | ||
const phoneProviders = __importStar(require("./phoneProvider")); | ||
const prompts = __importStar(require("./prompts")); | ||
@@ -90,2 +91,3 @@ const actions = __importStar(require("./actions")); | ||
branding, | ||
phoneProviders, | ||
//@ts-ignore because prompts have not been universally implemented yet | ||
@@ -92,0 +94,0 @@ prompts, |
@@ -311,3 +311,3 @@ "use strict"; | ||
const existingConnections = yield (0, client_1.paginate)(this.client.connections.getAll, { | ||
paginate: true, | ||
checkpoint: true, | ||
include_totals: true, | ||
@@ -314,0 +314,0 @@ }); |
@@ -8,3 +8,3 @@ declare const _default: { | ||
properties: { | ||
[x: string]: Object; | ||
[key: string]: Object; | ||
}; | ||
@@ -11,0 +11,0 @@ default: {}; |
@@ -18,3 +18,3 @@ import APIHandler from '../tools/auth0/handlers/default'; | ||
}): { | ||
[x: string]: any; | ||
[key: string]: any; | ||
}; | ||
@@ -21,0 +21,0 @@ export declare function calculateChanges({ handler, assets, existing, identifiers, allowDelete, }: { |
@@ -51,2 +51,3 @@ import { GetEmailTemplatesByTemplateNameTemplateNameEnum } from 'auth0'; | ||
BRANDING_DIRECTORY: string; | ||
PHONE_PROVIDER_DIRECTORY: string; | ||
BRANDING_TEMPLATES_DIRECTORY: string; | ||
@@ -53,0 +54,0 @@ BRANDING_TEMPLATES_YAML_DIRECTORY: string; |
@@ -91,2 +91,3 @@ "use strict"; | ||
BRANDING_DIRECTORY: 'branding', | ||
PHONE_PROVIDER_DIRECTORY: 'phone-providers', | ||
BRANDING_TEMPLATES_DIRECTORY: 'templates', | ||
@@ -93,0 +94,0 @@ BRANDING_TEMPLATES_YAML_DIRECTORY: 'branding_templates', |
@@ -52,2 +52,3 @@ import constants from './constants'; | ||
BRANDING_DIRECTORY: string; | ||
PHONE_PROVIDER_DIRECTORY: string; | ||
BRANDING_TEMPLATES_DIRECTORY: string; | ||
@@ -54,0 +55,0 @@ BRANDING_TEMPLATES_YAML_DIRECTORY: string; |
@@ -15,2 +15,3 @@ import { GetConnectionsStrategyEnum, ManagementClient, ResourceServer } from 'auth0'; | ||
import { SsProfileWithCustomText } from './tools/auth0/handlers/selfServiceProfiles'; | ||
import { PhoneProvider } from './tools/auth0/handlers/phoneProvider'; | ||
type SharedPaginationParams = { | ||
@@ -89,2 +90,3 @@ checkpoint?: boolean; | ||
}) | null; | ||
phoneProviders: PhoneProvider[] | null; | ||
clients: Client[] | null; | ||
@@ -134,3 +136,3 @@ clientGrants: ClientGrant[] | null; | ||
}; | ||
export type AssetTypes = 'rules' | 'rulesConfigs' | 'hooks' | 'pages' | 'databases' | 'clientGrants' | 'resourceServers' | 'clients' | 'connections' | 'tenant' | 'emailProvider' | 'emailTemplates' | 'guardianFactors' | 'guardianFactorProviders' | 'guardianFactorTemplates' | 'guardianPhoneFactorMessageTypes' | 'guardianPhoneFactorSelectedProvider' | 'guardianPolicies' | 'roles' | 'actions' | 'organizations' | 'triggers' | 'attackProtection' | 'branding' | 'logStreams' | 'prompts' | 'customDomains' | 'themes' | 'forms' | 'flows' | 'flowVaultConnections' | 'selfServiceProfiles'; | ||
export type AssetTypes = 'rules' | 'rulesConfigs' | 'hooks' | 'pages' | 'databases' | 'clientGrants' | 'resourceServers' | 'clients' | 'connections' | 'tenant' | 'emailProvider' | 'emailTemplates' | 'guardianFactors' | 'guardianFactorProviders' | 'guardianFactorTemplates' | 'guardianPhoneFactorMessageTypes' | 'guardianPhoneFactorSelectedProvider' | 'guardianPolicies' | 'roles' | 'actions' | 'organizations' | 'triggers' | 'attackProtection' | 'branding' | 'phoneProviders' | 'logStreams' | 'prompts' | 'customDomains' | 'themes' | 'forms' | 'flows' | 'flowVaultConnections' | 'selfServiceProfiles'; | ||
export type KeywordMappings = { | ||
@@ -137,0 +139,0 @@ [key: string]: (string | number)[] | string | number; |
@@ -24,2 +24,3 @@ import { Auth0 } from './tools'; | ||
}) | null | undefined; | ||
phoneProviders?: import("auth0").GetBrandingPhoneProviders200ResponseProvidersInner[] | null | undefined; | ||
clients?: import("./tools/auth0/handlers/clients").Client[] | null | undefined; | ||
@@ -26,0 +27,0 @@ clientGrants?: import("./tools/auth0/handlers/clientGrants").ClientGrant[] | null | undefined; |
{ | ||
"name": "auth0-deploy-cli", | ||
"version": "8.6.2", | ||
"version": "8.7.0", | ||
"description": "A command line tool for deploying updates to your Auth0 tenant", | ||
@@ -36,3 +36,3 @@ "main": "lib/index.js", | ||
"ajv": "^6.12.6", | ||
"auth0": "^4.18.0", | ||
"auth0": "^4.19.0", | ||
"dot-prop": "^5.2.0", | ||
@@ -46,3 +46,3 @@ "fs-extra": "^10.1.0", | ||
"sanitize-filename": "^1.6.3", | ||
"undici": "^7.3.0", | ||
"undici": "^7.4.0", | ||
"winston": "^3.17.0", | ||
@@ -75,8 +75,8 @@ "yargs": "^15.3.1" | ||
"sinon-chai": "^3.7.0", | ||
"ts-mocha": "^10.0.0", | ||
"typescript": "^5.7.2", | ||
"ts-mocha": "^10.1.0", | ||
"typescript": "^5.8.2", | ||
"zlib": "^1.0.5" | ||
}, | ||
"engines": { | ||
"node": ">= 18" | ||
"node": ">= 20.18.3" | ||
}, | ||
@@ -83,0 +83,0 @@ "keywords": [ |
@@ -73,3 +73,3 @@  | ||
- [Node](https://nodejs.dev/) version 18 or greater | ||
- [Node](https://nodejs.dev/) version 20(v20.18.3) or greater | ||
- [Auth0 Tenant](https://auth0.com/) | ||
@@ -76,0 +76,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1183149
2.33%410
2.24%16952
2.68%60
1.69%Updated
Updated