auth0-deploy-cli 7.7.0 → 7.9.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/CHANGELOG.md +42 -1
- package/README.md +1 -1
- package/lib/args.d.ts +29 -0
- package/lib/commands/export.d.ts +2 -0
- package/lib/commands/import.d.ts +2 -0
- package/lib/commands/index.d.ts +9 -0
- package/lib/configFactory.d.ts +7 -0
- package/lib/context/defaults.d.ts +1 -0
- package/lib/context/directory/handlers/actions.d.ts +6 -0
- package/lib/context/directory/handlers/attackProtection.d.ts +10 -0
- package/lib/context/directory/handlers/attackProtection.js +3 -3
- package/lib/context/directory/handlers/branding.d.ts +6 -0
- package/lib/context/directory/handlers/clientGrants.d.ts +6 -0
- package/lib/context/directory/handlers/clients.d.ts +6 -0
- package/lib/context/directory/handlers/connections.d.ts +6 -0
- package/lib/context/directory/handlers/databases.d.ts +6 -0
- package/lib/context/directory/handlers/emailProvider.d.ts +6 -0
- package/lib/context/directory/handlers/emailTemplates.d.ts +6 -0
- package/lib/context/directory/handlers/guardianFactorProviders.d.ts +6 -0
- package/lib/context/directory/handlers/guardianFactorTemplates.d.ts +6 -0
- package/lib/context/directory/handlers/guardianFactors.d.ts +6 -0
- package/lib/context/directory/handlers/guardianPhoneFactorMessageTypes.d.ts +6 -0
- package/lib/context/directory/handlers/guardianPhoneFactorSelectedProvider.d.ts +6 -0
- package/lib/context/directory/handlers/guardianPolicies.d.ts +6 -0
- package/lib/context/directory/handlers/hooks.d.ts +6 -0
- package/lib/context/directory/handlers/index.d.ts +12 -0
- package/lib/context/directory/handlers/index.js +2 -0
- package/lib/context/directory/handlers/logStreams.d.ts +7 -0
- package/lib/context/directory/handlers/logStreams.js +49 -0
- package/lib/context/directory/handlers/migrations.d.ts +6 -0
- package/lib/context/directory/handlers/organizations.d.ts +6 -0
- package/lib/context/directory/handlers/pages.d.ts +6 -0
- package/lib/context/directory/handlers/resourceServers.d.ts +6 -0
- package/lib/context/directory/handlers/roles.d.ts +6 -0
- package/lib/context/directory/handlers/rules.d.ts +6 -0
- package/lib/context/directory/handlers/rulesConfigs.d.ts +6 -0
- package/lib/context/directory/handlers/tenant.d.ts +10 -0
- package/lib/context/directory/handlers/triggers.d.ts +6 -0
- package/lib/context/directory/index.d.ts +17 -0
- package/lib/context/index.d.ts +4 -0
- package/lib/context/index.js +18 -0
- package/lib/context/yaml/handlers/actions.d.ts +6 -0
- package/lib/context/yaml/handlers/attackProtection.d.ts +6 -0
- package/lib/context/yaml/handlers/branding.d.ts +6 -0
- package/lib/context/yaml/handlers/clientGrants.d.ts +6 -0
- package/lib/context/yaml/handlers/clients.d.ts +6 -0
- package/lib/context/yaml/handlers/connections.d.ts +6 -0
- package/lib/context/yaml/handlers/databases.d.ts +6 -0
- package/lib/context/yaml/handlers/emailProvider.d.ts +6 -0
- package/lib/context/yaml/handlers/emailTemplates.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianFactorProviders.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianFactorTemplates.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianFactors.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianPhoneFactorMessageTypes.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianPhoneFactorSelectedProvider.d.ts +6 -0
- package/lib/context/yaml/handlers/guardianPolicies.d.ts +6 -0
- package/lib/context/yaml/handlers/hooks.d.ts +6 -0
- package/lib/context/yaml/handlers/index.d.ts +12 -0
- package/lib/context/yaml/handlers/index.js +2 -0
- package/lib/context/yaml/handlers/logStreams.d.ts +7 -0
- package/lib/context/yaml/handlers/logStreams.js +23 -0
- package/lib/context/yaml/handlers/migrations.d.ts +6 -0
- package/lib/context/yaml/handlers/organizations.d.ts +6 -0
- package/lib/context/yaml/handlers/pages.d.ts +6 -0
- package/lib/context/yaml/handlers/resourceServers.d.ts +6 -0
- package/lib/context/yaml/handlers/roles.d.ts +6 -0
- package/lib/context/yaml/handlers/rules.d.ts +6 -0
- package/lib/context/yaml/handlers/rulesConfigs.d.ts +6 -0
- package/lib/context/yaml/handlers/tenant.d.ts +6 -0
- package/lib/context/yaml/handlers/triggers.d.ts +6 -0
- package/lib/context/yaml/index.d.ts +13 -0
- package/lib/index.d.ts +89 -0
- package/lib/index.js +5 -2
- package/lib/logger.d.ts +2 -0
- package/lib/logger.js +7 -17
- package/lib/readonly.d.ts +2 -0
- package/lib/sessionDurationsToMinutes.d.ts +7 -0
- package/lib/tools/auth0/client.d.ts +2 -0
- package/lib/tools/auth0/client.js +7 -7
- package/lib/tools/auth0/handlers/actions.d.ts +95 -0
- package/lib/tools/auth0/handlers/actions.js +1 -1
- package/lib/tools/auth0/handlers/attackProtection.d.ts +28 -0
- package/lib/tools/auth0/handlers/branding.d.ts +27 -0
- package/lib/tools/auth0/handlers/clientGrants.d.ts +32 -0
- package/lib/tools/auth0/handlers/clients.d.ts +23 -0
- package/lib/tools/auth0/handlers/connections.d.ts +54 -0
- package/lib/tools/auth0/handlers/databases.d.ts +36 -0
- package/lib/tools/auth0/handlers/databases.js +2 -2
- package/lib/tools/auth0/handlers/default.d.ts +54 -0
- package/lib/tools/auth0/handlers/default.js +29 -15
- package/lib/tools/auth0/handlers/emailProvider.d.ts +11 -0
- package/lib/tools/auth0/handlers/emailTemplates.d.ts +26 -0
- package/lib/tools/auth0/handlers/guardianFactorProviders.d.ts +25 -0
- package/lib/tools/auth0/handlers/guardianFactorTemplates.d.ts +21 -0
- package/lib/tools/auth0/handlers/guardianFactors.d.ts +21 -0
- package/lib/tools/auth0/handlers/guardianPhoneFactorMessageTypes.d.ts +21 -0
- package/lib/tools/auth0/handlers/guardianPhoneFactorSelectedProvider.d.ts +18 -0
- package/lib/tools/auth0/handlers/guardianPolicies.d.ts +23 -0
- package/lib/tools/auth0/handlers/hooks.d.ts +58 -0
- package/lib/tools/auth0/handlers/index.d.ts +134 -0
- package/lib/tools/auth0/handlers/index.js +2 -0
- package/lib/tools/auth0/handlers/logStreams.d.ts +40 -0
- package/lib/tools/auth0/handlers/logStreams.js +77 -0
- package/lib/tools/auth0/handlers/migrations.d.ts +15 -0
- package/lib/tools/auth0/handlers/migrations.js +1 -1
- package/lib/tools/auth0/handlers/organizations.d.ts +51 -0
- package/lib/tools/auth0/handlers/organizations.js +1 -1
- package/lib/tools/auth0/handlers/pages.d.ts +42 -0
- package/lib/tools/auth0/handlers/prompts.d.ts +11 -0
- package/lib/tools/auth0/handlers/resourceServers.d.ts +51 -0
- package/lib/tools/auth0/handlers/roles.d.ts +48 -0
- package/lib/tools/auth0/handlers/roles.js +1 -1
- package/lib/tools/auth0/handlers/rules.d.ts +55 -0
- package/lib/tools/auth0/handlers/rules.js +4 -4
- package/lib/tools/auth0/handlers/rulesConfigs.d.ts +25 -0
- package/lib/tools/auth0/handlers/tenant.d.ts +11 -0
- package/lib/tools/auth0/handlers/tenant.js +1 -1
- package/lib/tools/auth0/handlers/triggers.d.ts +35 -0
- package/lib/tools/auth0/handlers/triggers.js +1 -1
- package/lib/tools/auth0/index.d.ts +15 -0
- package/lib/tools/auth0/schema.d.ts +15 -0
- package/lib/tools/calculateChanges.d.ts +26 -0
- package/lib/tools/calculateChanges.js +1 -1
- package/lib/tools/constants.d.ts +72 -0
- package/lib/tools/constants.js +4 -1
- package/lib/tools/deploy.d.ts +3 -0
- package/lib/tools/deploy.js +2 -2
- package/lib/tools/index.d.ts +83 -0
- package/lib/tools/utils.d.ts +18 -0
- package/lib/tools/utils.js +67 -9
- package/lib/tools/validationError.d.ts +5 -0
- package/lib/types.d.ts +257 -0
- package/lib/utils.d.ts +67 -0
- package/lib/utils.js +8 -5
- package/package.json +11 -9
- package/tsconfig.json +2 -1
- package/lib/tools/logger.js +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [7.9.0] - 2022-04-19
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Log streams support [#495]
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- `##` String keyword replacements now work when nested inside `@@` array replacements [#504]
|
|
19
|
+
|
|
20
|
+
## [7.8.0] - 2022-04-14
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- Type declarations for more seamless integration into Typescript projects when used as a module [#485]
|
|
25
|
+
|
|
26
|
+
### Security
|
|
27
|
+
|
|
28
|
+
- Updated Winston from 2.3.x to 3.3.0 which applies fix for theoretical prototype pollution vulnerability [#497]
|
|
29
|
+
|
|
30
|
+
## [7.7.1] - 2022-04-07
|
|
31
|
+
|
|
32
|
+
### Added
|
|
33
|
+
|
|
34
|
+
- Deprecation warnings for now deprecated asset-specific exclusion configuration properties: `AUTH0_EXCLUDED_RULES`, `AUTH0_EXCLUDED_CLIENTS`, `AUTH0_EXCLUDED_DATABASES`, `AUTH0_EXCLUDED_CONNECTIONS`, `AUTH0_EXCLUDED_RESOURCE_SERVERS`, `AUTH0_EXCLUDED_DEFAULTS`. See [Resource Exclusion Proposal](https://github.com/auth0/auth0-deploy-cli/issues/451#user-content-deprecated-exclusion-props) for details. [#481]
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- Rules configs failing to update after regression prevented asset-specific overrides of Node Auth0 SDK methods [#482]
|
|
39
|
+
- Attack protection not replacing keywords [#478]
|
|
40
|
+
|
|
10
41
|
## [7.7.0] - 2022-04-06
|
|
11
42
|
|
|
12
43
|
### Added
|
|
@@ -652,7 +683,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
652
683
|
[#453]: https://github.com/auth0/auth0-deploy-cli/issues/453
|
|
653
684
|
[#468]: https://github.com/auth0/auth0-deploy-cli/issues/468
|
|
654
685
|
[#471]: https://github.com/auth0/auth0-deploy-cli/issues/471
|
|
655
|
-
[
|
|
686
|
+
[#478]: https://github.com/auth0/auth0-deploy-cli/issues/478
|
|
687
|
+
[#481]: https://github.com/auth0/auth0-deploy-cli/issues/481
|
|
688
|
+
[#482]: https://github.com/auth0/auth0-deploy-cli/issues/482
|
|
689
|
+
[#485]: https://github.com/auth0/auth0-deploy-cli/issues/485
|
|
690
|
+
[#495]: https://github.com/auth0/auth0-deploy-cli/issues/495
|
|
691
|
+
[#497]: https://github.com/auth0/auth0-deploy-cli/issues/497
|
|
692
|
+
[#504]: https://github.com/auth0/auth0-deploy-cli/issues/504
|
|
693
|
+
[unreleased]: https://github.com/auth0/auth0-deploy-cli/compare/v7.9.0...HEAD
|
|
694
|
+
[7.9.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.8.0...v7.9.0
|
|
695
|
+
[7.8.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.7.1...v7.8.0
|
|
696
|
+
[7.7.1]: https://github.com/auth0/auth0-deploy-cli/compare/v7.7.0...v7.7.1
|
|
656
697
|
[7.7.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.6.0...v7.7.0
|
|
657
698
|
[7.6.0]: https://github.com/auth0/auth0-deploy-cli/compare/v7.5.2...v7.6.0
|
|
658
699
|
[7.5.2]: https://github.com/auth0/auth0-deploy-cli/compare/v7.5.1...v7.5.2
|
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Supported Auth0 Management API resources
|
|
|
16
16
|
- [x] [Grants](https://auth0.com/docs/api/management/v2#!/Grants/get_grants)
|
|
17
17
|
- [x] [Hooks](https://auth0.com/docs/api/management/v2#!/Hooks/get_hooks)
|
|
18
18
|
- [x] [Hook Secrets](https://auth0.com/docs/api/management/v2/#!/Hooks/get_secrets)
|
|
19
|
-
- [
|
|
19
|
+
- [x] [Log Streams](https://auth0.com/docs/api/management/v2#!/Log_Streams/get_log_streams)
|
|
20
20
|
- [ ] [Logs](https://auth0.com/docs/api/management/v2#!/Logs/get_logs)
|
|
21
21
|
- [x] [Organizations](https://auth0.com/docs/api/management/v2#!/Organizations/get_organizations)
|
|
22
22
|
- [ ] [Prompts](https://auth0.com/docs/api/management/v2#!/Prompts/get_prompts)
|
package/lib/args.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Config } from './types';
|
|
2
|
+
declare type SharedParams = {
|
|
3
|
+
proxy_url?: string;
|
|
4
|
+
debug?: boolean;
|
|
5
|
+
config_file?: string;
|
|
6
|
+
env?: boolean;
|
|
7
|
+
secret?: string;
|
|
8
|
+
base_path?: string;
|
|
9
|
+
config?: Partial<Config>;
|
|
10
|
+
};
|
|
11
|
+
declare type ImportSpecificParams = {
|
|
12
|
+
input_file: string;
|
|
13
|
+
};
|
|
14
|
+
declare type ExportSpecificParams = {
|
|
15
|
+
format: 'yaml' | 'directory';
|
|
16
|
+
output_folder: string;
|
|
17
|
+
export_ids?: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare type ExportParams = ExportSpecificParams & SharedParams;
|
|
20
|
+
export declare type ImportParams = ImportSpecificParams & SharedParams;
|
|
21
|
+
export declare type CliParams = (ExportParams | ImportParams) & {
|
|
22
|
+
_: ['export' | 'import' | 'deploy' | 'dump'];
|
|
23
|
+
};
|
|
24
|
+
declare function getParams(): CliParams;
|
|
25
|
+
declare const _default: {
|
|
26
|
+
getParams: typeof getParams;
|
|
27
|
+
};
|
|
28
|
+
export default _default;
|
|
29
|
+
export { getParams };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Config } from './types';
|
|
2
|
+
export declare type ConfigFunction = (arg0: keyof Config) => any;
|
|
3
|
+
export declare const configFactory: () => {
|
|
4
|
+
(key: keyof Config): any;
|
|
5
|
+
setProvider(providerFunction: ConfigFunction): void;
|
|
6
|
+
setValue(key: keyof Config, value: any): void;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function emailProviderDefaults(emailProvider: any): any;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DirectoryHandler } from '.';
|
|
2
|
+
declare type ParsedAttackProtection = {
|
|
3
|
+
attackProtection: {
|
|
4
|
+
breachedPasswordDetection: unknown;
|
|
5
|
+
bruteForceProtection: unknown;
|
|
6
|
+
suspiciousIpThrottling: unknown;
|
|
7
|
+
} | undefined;
|
|
8
|
+
};
|
|
9
|
+
declare const attackProtectionHandler: DirectoryHandler<ParsedAttackProtection>;
|
|
10
|
+
export default attackProtectionHandler;
|
|
@@ -32,9 +32,9 @@ function parse(context) {
|
|
|
32
32
|
attackProtection: undefined,
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const breachedPasswordDetection = (0, utils_1.loadJSON)(files.breachedPasswordDetection);
|
|
36
|
-
const bruteForceProtection = (0, utils_1.loadJSON)(files.bruteForceProtection);
|
|
37
|
-
const suspiciousIpThrottling = (0, utils_1.loadJSON)(files.suspiciousIpThrottling);
|
|
35
|
+
const breachedPasswordDetection = (0, utils_1.loadJSON)(files.breachedPasswordDetection, context.mappings);
|
|
36
|
+
const bruteForceProtection = (0, utils_1.loadJSON)(files.bruteForceProtection, context.mappings);
|
|
37
|
+
const suspiciousIpThrottling = (0, utils_1.loadJSON)(files.suspiciousIpThrottling, context.mappings);
|
|
38
38
|
return {
|
|
39
39
|
attackProtection: {
|
|
40
40
|
breachedPasswordDetection,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DirectoryHandler } from '.';
|
|
2
|
+
declare type ParsedGuardianFactorProviders = {
|
|
3
|
+
guardianFactorProviders: unknown[] | undefined;
|
|
4
|
+
};
|
|
5
|
+
declare const guardianFactorProvidersHandler: DirectoryHandler<ParsedGuardianFactorProviders>;
|
|
6
|
+
export default guardianFactorProvidersHandler;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DirectoryHandler } from '.';
|
|
2
|
+
declare type ParsedGuardianFactorTemplates = {
|
|
3
|
+
guardianFactorTemplates: unknown[] | undefined;
|
|
4
|
+
};
|
|
5
|
+
declare const guardianFactorTemplatesHandler: DirectoryHandler<ParsedGuardianFactorTemplates>;
|
|
6
|
+
export default guardianFactorTemplatesHandler;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DirectoryHandler } from '.';
|
|
2
|
+
declare type ParsedGuardianFactorMessageTypes = {
|
|
3
|
+
guardianPhoneFactorMessageTypes: unknown;
|
|
4
|
+
} | {};
|
|
5
|
+
declare const guardianFactorMessageTypesHandler: DirectoryHandler<ParsedGuardianFactorMessageTypes>;
|
|
6
|
+
export default guardianFactorMessageTypesHandler;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DirectoryHandler } from '.';
|
|
2
|
+
declare type ParsedGuardianFactorSelectedProvider = {
|
|
3
|
+
guardianPhoneFactorSelectedProvider: unknown;
|
|
4
|
+
} | {};
|
|
5
|
+
declare const guardianFactorSelectedProviderHandler: DirectoryHandler<ParsedGuardianFactorSelectedProvider>;
|
|
6
|
+
export default guardianFactorSelectedProviderHandler;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import DirectoryContext from '..';
|
|
2
|
+
import { AssetTypes } from '../../../types';
|
|
3
|
+
export declare type DirectoryHandler<T> = {
|
|
4
|
+
dump: (context: DirectoryContext) => void;
|
|
5
|
+
parse: (context: DirectoryContext) => T;
|
|
6
|
+
};
|
|
7
|
+
declare const directoryHandlers: {
|
|
8
|
+
[key in AssetTypes]: DirectoryHandler<{
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
export default directoryHandlers;
|
|
@@ -28,6 +28,7 @@ const organizations_1 = __importDefault(require("./organizations"));
|
|
|
28
28
|
const triggers_1 = __importDefault(require("./triggers"));
|
|
29
29
|
const attackProtection_1 = __importDefault(require("./attackProtection"));
|
|
30
30
|
const branding_1 = __importDefault(require("./branding"));
|
|
31
|
+
const logStreams_1 = __importDefault(require("./logStreams"));
|
|
31
32
|
const directoryHandlers = {
|
|
32
33
|
rules: rules_1.default,
|
|
33
34
|
rulesConfigs: rulesConfigs_1.default,
|
|
@@ -54,5 +55,6 @@ const directoryHandlers = {
|
|
|
54
55
|
triggers: triggers_1.default,
|
|
55
56
|
attackProtection: attackProtection_1.default,
|
|
56
57
|
branding: branding_1.default,
|
|
58
|
+
logStreams: logStreams_1.default,
|
|
57
59
|
};
|
|
58
60
|
exports.default = directoryHandlers;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
16
|
+
const path_1 = __importDefault(require("path"));
|
|
17
|
+
const tools_1 = require("../../../tools");
|
|
18
|
+
const utils_1 = require("../../../utils");
|
|
19
|
+
function parse(context) {
|
|
20
|
+
const logStreamsDirectory = path_1.default.join(context.filePath, tools_1.constants.LOG_STREAMS_DIRECTORY);
|
|
21
|
+
if (!(0, utils_1.existsMustBeDir)(logStreamsDirectory))
|
|
22
|
+
return { logStreams: undefined }; // Skip
|
|
23
|
+
const foundFiles = (0, utils_1.getFiles)(logStreamsDirectory, ['.json']);
|
|
24
|
+
const logStreams = foundFiles
|
|
25
|
+
.map((f) => (0, utils_1.loadJSON)(f, context.mappings))
|
|
26
|
+
.filter((p) => Object.keys(p).length > 0); // Filter out empty rulesConfigs
|
|
27
|
+
return {
|
|
28
|
+
logStreams,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function dump(context) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const logStreams = context.assets.logStreams || [];
|
|
34
|
+
if (!logStreams)
|
|
35
|
+
return; // Skip, nothing to dump
|
|
36
|
+
// Create Rules folder
|
|
37
|
+
const logStreamsDirectory = path_1.default.join(context.filePath, tools_1.constants.LOG_STREAMS_DIRECTORY);
|
|
38
|
+
fs_extra_1.default.ensureDirSync(logStreamsDirectory);
|
|
39
|
+
logStreams.forEach((logStream) => {
|
|
40
|
+
const ruleFile = path_1.default.join(logStreamsDirectory, `${(0, utils_1.sanitize)(logStream.name)}.json`);
|
|
41
|
+
(0, utils_1.dumpJSON)(ruleFile, logStream);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
const logStreamsHandler = {
|
|
46
|
+
parse,
|
|
47
|
+
dump,
|
|
48
|
+
};
|
|
49
|
+
exports.default = logStreamsHandler;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DirectoryHandler } from '.';
|
|
2
|
+
declare type ParsedTenant = {
|
|
3
|
+
tenant: {
|
|
4
|
+
session_lifetime: number;
|
|
5
|
+
idle_session_lifetime: number;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
} | {};
|
|
9
|
+
declare const tenantHandler: DirectoryHandler<ParsedTenant>;
|
|
10
|
+
export default tenantHandler;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Assets, Auth0APIClient, Config } from '../../types';
|
|
2
|
+
declare type KeywordMappings = {
|
|
3
|
+
[key: string]: (string | number)[] | string | number;
|
|
4
|
+
};
|
|
5
|
+
export default class DirectoryContext {
|
|
6
|
+
basePath: string;
|
|
7
|
+
filePath: string;
|
|
8
|
+
config: Config;
|
|
9
|
+
mappings: KeywordMappings;
|
|
10
|
+
mgmtClient: Auth0APIClient;
|
|
11
|
+
assets: Assets;
|
|
12
|
+
constructor(config: Config, mgmtClient: Auth0APIClient);
|
|
13
|
+
loadFile(f: string, folder: string): string;
|
|
14
|
+
load(): Promise<void>;
|
|
15
|
+
dump(): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
package/lib/context/index.js
CHANGED
|
@@ -46,6 +46,24 @@ const setupContext = (config) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
46
46
|
if (missingParams.length > 0) {
|
|
47
47
|
throw new Error(`The following parameters were missing. Please add them to your config.json or as an environment variable. ${JSON.stringify(missingParams)}`);
|
|
48
48
|
}
|
|
49
|
+
((config) => {
|
|
50
|
+
// Detect and warn on usage of deprecated exclusion params. See: https://github.com/auth0/auth0-deploy-cli/issues/451#user-content-deprecated-exclusion-props
|
|
51
|
+
const deprecatedExclusionParams = [
|
|
52
|
+
'AUTH0_EXCLUDED_RULES',
|
|
53
|
+
'AUTH0_EXCLUDED_CLIENTS',
|
|
54
|
+
'AUTH0_EXCLUDED_DATABASES',
|
|
55
|
+
'AUTH0_EXCLUDED_CONNECTIONS',
|
|
56
|
+
'AUTH0_EXCLUDED_RESOURCE_SERVERS',
|
|
57
|
+
'AUTH0_EXCLUDED_DEFAULTS',
|
|
58
|
+
];
|
|
59
|
+
const usedDeprecatedParams = deprecatedExclusionParams.filter((deprecatedParam) => {
|
|
60
|
+
const deprecatedConfigValue = config[deprecatedParam];
|
|
61
|
+
return !!deprecatedConfigValue && deprecatedConfigValue.length > 0;
|
|
62
|
+
});
|
|
63
|
+
if (usedDeprecatedParams.length > 0) {
|
|
64
|
+
logger_1.default.warn(`Usage of the ${usedDeprecatedParams.join(', ')} exclusion ${usedDeprecatedParams.length > 1 ? 'params are' : 'param is'} deprecated and may be removed from future major versions. See: https://github.com/auth0/auth0-deploy-cli/issues/451#user-content-deprecated-exclusion-props for details.`);
|
|
65
|
+
}
|
|
66
|
+
})(config);
|
|
49
67
|
const accessToken = yield (() => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
68
|
if (!!config.AUTH0_ACCESS_TOKEN)
|
|
51
69
|
return config.AUTH0_ACCESS_TOKEN;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { YAMLHandler } from '.';
|
|
2
|
+
declare type ParsedGuardianFactorMessageTypes = {
|
|
3
|
+
guardianPhoneFactorMessageTypes: unknown;
|
|
4
|
+
};
|
|
5
|
+
declare const guardianPhoneFactorMessageTypesHandler: YAMLHandler<ParsedGuardianFactorMessageTypes>;
|
|
6
|
+
export default guardianPhoneFactorMessageTypesHandler;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { YAMLHandler } from '.';
|
|
2
|
+
declare type ParsedGuardianPhoneFactorSelectedProvider = {
|
|
3
|
+
guardianPhoneFactorSelectedProvider: unknown;
|
|
4
|
+
};
|
|
5
|
+
declare const guardianPhoneFactorSelectedProviderHandler: YAMLHandler<ParsedGuardianPhoneFactorSelectedProvider>;
|
|
6
|
+
export default guardianPhoneFactorSelectedProviderHandler;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import YAMLContext from '..';
|
|
2
|
+
import { AssetTypes } from '../../../types';
|
|
3
|
+
export declare type YAMLHandler<T> = {
|
|
4
|
+
dump: (context: YAMLContext) => Promise<T | {}>;
|
|
5
|
+
parse: (context: YAMLContext) => Promise<T>;
|
|
6
|
+
};
|
|
7
|
+
declare const yamlHandlers: {
|
|
8
|
+
[key in AssetTypes]: YAMLHandler<{
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
export default yamlHandlers;
|