From 7e5adb5f9e1acf15ee79b16f349d1cb984f7e613 Mon Sep 17 00:00:00 2001 From: Geoff Speirs Date: Mon, 18 Jun 2018 14:43:55 +1000 Subject: [PATCH] Adding build artifacts so we can use them directly. --- .gitignore | 2 +- lib/api.d.ts | 24 + lib/api.js | 42 + lib/api.js.map | 1 + lib/awsData.d.ts | 97 ++ lib/awsData.js | 14 + lib/awsData.js.map | 1 + lib/docs.d.ts | 2 + lib/docs.js | 124 +++ lib/docs.js.map | 1 + lib/index.d.ts | 0 lib/index.js | 245 +++++ lib/index.js.map | 1 + lib/logger.d.ts | 4 + lib/logger.js | 13 + lib/logger.js.map | 1 + lib/parser.d.ts | 1 + lib/parser.js | 46 + lib/parser.js.map | 1 + lib/resourcesSpec.d.ts | 54 ++ lib/resourcesSpec.js | 211 +++++ lib/resourcesSpec.js.map | 1 + lib/test/apiTest.d.ts | 0 lib/test/apiTest.js | 54 ++ lib/test/apiTest.js.map | 1 + lib/test/docsTest.d.ts | 0 lib/test/docsTest.js | 26 + lib/test/docsTest.js.map | 1 + lib/test/indexTest.d.ts | 0 lib/test/indexTest.js | 201 ++++ lib/test/indexTest.js.map | 1 + lib/test/parserTest.d.ts | 0 lib/test/parserTest.js | 41 + lib/test/parserTest.js.map | 1 + lib/test/resourcesTest.d.ts | 0 lib/test/resourcesTest.js | 109 +++ lib/test/resourcesTest.js.map | 1 + lib/test/validatorTest.d.ts | 0 lib/test/validatorTest.js | 1244 +++++++++++++++++++++++++ lib/test/validatorTest.js.map | 1 + lib/test/yamlSchema.d.ts | 0 lib/test/yamlSchema.js | 35 + lib/test/yamlSchema.js.map | 1 + lib/util/CustomError.d.ts | 13 + lib/util/CustomError.js | 26 + lib/util/CustomError.js.map | 1 + lib/util/polyfills.d.ts | 0 lib/util/polyfills.js | 6 + lib/util/polyfills.js.map | 1 + lib/validator.d.ts | 82 ++ lib/validator.js | 1633 +++++++++++++++++++++++++++++++++ lib/validator.js.map | 1 + lib/yamlSchema.d.ts | 6 + lib/yamlSchema.js | 58 ++ lib/yamlSchema.js.map | 1 + package-lock.json | 715 +++++++++++++++ 56 files changed, 5145 insertions(+), 1 deletion(-) create mode 100644 lib/api.d.ts create mode 100644 lib/api.js create mode 100644 lib/api.js.map create mode 100644 lib/awsData.d.ts create mode 100644 lib/awsData.js create mode 100644 lib/awsData.js.map create mode 100644 lib/docs.d.ts create mode 100644 lib/docs.js create mode 100644 lib/docs.js.map create mode 100644 lib/index.d.ts create mode 100644 lib/index.js create mode 100644 lib/index.js.map create mode 100644 lib/logger.d.ts create mode 100644 lib/logger.js create mode 100644 lib/logger.js.map create mode 100644 lib/parser.d.ts create mode 100644 lib/parser.js create mode 100644 lib/parser.js.map create mode 100644 lib/resourcesSpec.d.ts create mode 100644 lib/resourcesSpec.js create mode 100644 lib/resourcesSpec.js.map create mode 100644 lib/test/apiTest.d.ts create mode 100644 lib/test/apiTest.js create mode 100644 lib/test/apiTest.js.map create mode 100644 lib/test/docsTest.d.ts create mode 100644 lib/test/docsTest.js create mode 100644 lib/test/docsTest.js.map create mode 100644 lib/test/indexTest.d.ts create mode 100644 lib/test/indexTest.js create mode 100644 lib/test/indexTest.js.map create mode 100644 lib/test/parserTest.d.ts create mode 100644 lib/test/parserTest.js create mode 100644 lib/test/parserTest.js.map create mode 100644 lib/test/resourcesTest.d.ts create mode 100644 lib/test/resourcesTest.js create mode 100644 lib/test/resourcesTest.js.map create mode 100644 lib/test/validatorTest.d.ts create mode 100644 lib/test/validatorTest.js create mode 100644 lib/test/validatorTest.js.map create mode 100644 lib/test/yamlSchema.d.ts create mode 100644 lib/test/yamlSchema.js create mode 100644 lib/test/yamlSchema.js.map create mode 100644 lib/util/CustomError.d.ts create mode 100644 lib/util/CustomError.js create mode 100644 lib/util/CustomError.js.map create mode 100644 lib/util/polyfills.d.ts create mode 100644 lib/util/polyfills.js create mode 100644 lib/util/polyfills.js.map create mode 100644 lib/validator.d.ts create mode 100644 lib/validator.js create mode 100644 lib/validator.js.map create mode 100644 lib/yamlSchema.d.ts create mode 100644 lib/yamlSchema.js create mode 100644 lib/yamlSchema.js.map create mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index d01826a..65d4b73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ node_modules/ -lib +# lib diff --git a/lib/api.d.ts b/lib/api.d.ts new file mode 100644 index 0000000..02d6ca5 --- /dev/null +++ b/lib/api.d.ts @@ -0,0 +1,24 @@ +import validator = require('./validator'); +export interface APIValidationOptions { + parameters: { + [parameterName: string]: any; + }; + pseudoParameters: { + [pseudoParameterName: string]: any; + }; +} +export declare type ValidationOptions = APIValidationOptions & validator.ValidateOptions; +export declare type ValidationResult = validator.ErrorObject; +/** + * Synchronously validates a CloudFormation yaml or json file. + * @param fileName + * @param options + */ +export declare function validateFile(fileName: string, options?: Partial): ValidationResult; +/** + * Synchronously validates an object. The object should be what you + * get from JSON.parse-ing or yaml.load-ing a CloudFormation template. + * @param objectToValidate + * @param options + */ +export declare function validateJsonObject(objectToValidate: any, options?: Partial): ValidationResult; diff --git a/lib/api.js b/lib/api.js new file mode 100644 index 0000000..17e8b28 --- /dev/null +++ b/lib/api.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var validator = require("./validator"); +var defaultOptions = { + parameters: {}, + pseudoParameters: {}, + guessParameters: undefined +}; +/** + * Synchronously validates a CloudFormation yaml or json file. + * @param fileName + * @param options + */ +function validateFile(fileName, options) { + setupValidator(options); + return validator.validateFile(fileName, options); +} +exports.validateFile = validateFile; +/** + * Synchronously validates an object. The object should be what you + * get from JSON.parse-ing or yaml.load-ing a CloudFormation template. + * @param objectToValidate + * @param options + */ +function validateJsonObject(objectToValidate, options) { + setupValidator(options); + return validator.validateJsonObject(objectToValidate, options); +} +exports.validateJsonObject = validateJsonObject; +function setupValidator(passedOptions) { + validator.resetValidator(); + var options = Object.assign({}, defaultOptions, passedOptions); + for (var parameterName in options.parameters) { + var parameterValue = options.parameters[parameterName]; + validator.addParameterValue(parameterName, parameterValue); + } + for (var pseudoName in options.pseudoParameters) { + var pseudoValue = options.pseudoParameters[pseudoName]; + validator.addPseudoValue(pseudoName, pseudoValue); + } +} +//# sourceMappingURL=api.js.map \ No newline at end of file diff --git a/lib/api.js.map b/lib/api.js.map new file mode 100644 index 0000000..06a9c2e --- /dev/null +++ b/lib/api.js.map @@ -0,0 +1 @@ +{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":";;AAAA,uCAA0C;AAW1C,IAAM,cAAc,GAAsB;IACxC,UAAU,EAAE,EAAE;IACd,gBAAgB,EAAE,EAAE;IACpB,eAAe,EAAE,SAAS;CAC3B,CAAA;AAED;;;;GAIG;AACH,sBAA6B,QAAgB,EAAE,OAAoC;IACjF,cAAc,CAAC,OAAO,CAAC,CAAC;IACxB,MAAM,CAAC,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACnD,CAAC;AAHD,oCAGC;AAED;;;;;GAKG;AACH,4BAAmC,gBAAqB,EAAE,OAAoC;IAC5F,cAAc,CAAC,OAAO,CAAC,CAAC;IACxB,MAAM,CAAC,SAAS,CAAC,kBAAkB,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AACjE,CAAC;AAHD,gDAGC;AAED,wBAAwB,aAA0C;IAChE,SAAS,CAAC,cAAc,EAAE,CAAC;IAC3B,IAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;IACjE,GAAG,CAAC,CAAC,IAAI,aAAa,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;QAC7C,IAAM,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;QACzD,SAAS,CAAC,iBAAiB,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;IAC5D,CAAC;IAED,GAAG,CAAC,CAAC,IAAI,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAChD,IAAM,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACzD,SAAS,CAAC,cAAc,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;IACnD,CAAC;AACH,CAAC"} \ No newline at end of file diff --git a/lib/awsData.d.ts b/lib/awsData.d.ts new file mode 100644 index 0000000..5757313 --- /dev/null +++ b/lib/awsData.d.ts @@ -0,0 +1,97 @@ +export declare const awsExtraDocs: { + [k: string]: string; +}; +export declare type AWSPrimitiveType = 'String' | 'Integer' | 'Boolean' | 'Json' | 'Double' | 'Long' | 'Timestamp'; +export interface PropertyBase { + Required: boolean; + Documentation: string; + UpdateType: 'Mutable' | 'Immutable' | 'Conditional'; +} +export interface PrimitiveProperty extends PropertyBase { + PrimitiveType: AWSPrimitiveType; + Type: undefined; + ItemType: undefined; + PrimitiveItemType: undefined; +} +export interface ComplexProperty extends PropertyBase { + Type: string; + PrimitiveType: undefined; + ItemType: undefined; + PrimitiveItemType: undefined; +} +export interface ListPropertyBase extends PropertyBase { + Type: 'List'; + DuplicatesAllowed: boolean; + PrimitiveType: undefined; +} +export interface PrimitiveItemType { + PrimitiveItemType: AWSPrimitiveType; + ItemType: undefined; +} +export interface ItemType { + ItemType: string; + PrimitiveItemType: undefined; +} +export declare type ListProperty = ListPropertyBase & (PrimitiveItemType | ItemType); +export interface MapPropertyBase extends PropertyBase { + Type: 'Map'; + DuplicatesAllowed: boolean; + PrimitiveType: undefined; + ItemType: undefined; +} +export declare type MapProperty = MapPropertyBase & (PrimitiveItemType | ItemType); +export declare type Property = PrimitiveProperty | ComplexProperty | ListProperty | MapProperty; +export interface ResourcePropertyType { + Documentation: string; + Properties: { + [propertyName: string]: Property | undefined; + }; + AdditionalProperties: undefined; +} +export interface ResourceType { + Documentation: string; + Properties: { + [propertyName: string]: Property | undefined; + }; + Attributes?: { + [attributeName: string]: Attribute | undefined; + }; + AdditionalProperties?: boolean; +} +export interface PrimitiveAttribute { + PrimitiveType: AWSPrimitiveType; +} +export interface ListAttribute { + Type: 'List'; + PrimitiveItemType: AWSPrimitiveType; +} +export declare type Attribute = PrimitiveAttribute | ListAttribute; +export declare const awsResources: { + PropertyTypes: { + [propertyName: string]: ResourcePropertyType | undefined; + }; + ResourceTypes: { + [resourceName: string]: ResourceType | undefined; + }; +}; +export declare const awsResourceRefTypes: { + [resourceName: string]: string | undefined; +}; +export declare const awsParameterTypes: { + [parameterName: string]: "string" | "number" | "array" | undefined; +}; +export declare const awsIntrinsicFunctions: { + [functionName: string]: { + supportedFunctions: string[]; + }; +}; +export declare const awsRefOverrides: { + [refOverride: string]: any; + "AWS::AccountId": string; + "AWS::NotificationARNs": string[]; + "AWS::NoValue": undefined; + "AWS::Region": string; + "AWS::StackId": string; + "AWS::StackName": string; + "AWS::URLSuffix": string; +}; diff --git a/lib/awsData.js b/lib/awsData.js new file mode 100644 index 0000000..a487f20 --- /dev/null +++ b/lib/awsData.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.awsExtraDocs = require('../data/aws_extra_docs.json'); +exports.awsResources = require('../data/aws_resources_specification.json'); +exports.awsResourceRefTypes = require('../data/aws_resource_ref_types.json'); +exports.awsParameterTypes = require('../data/aws_parameter_types.json'); +exports.awsIntrinsicFunctions = require('../data/aws_intrinsic_functions.json'); +// avoid "does this exist" checks everywhere +for (var functionName in exports.awsIntrinsicFunctions) { + exports.awsIntrinsicFunctions[functionName].supportedFunctions = exports.awsIntrinsicFunctions[functionName].supportedFunctions || []; +} +exports.awsRefOverrides = require('../data/aws_ref_override.json'); +exports.awsRefOverrides["AWS::NoValue"] = undefined; +//# sourceMappingURL=awsData.js.map \ No newline at end of file diff --git a/lib/awsData.js.map b/lib/awsData.js.map new file mode 100644 index 0000000..f08b76b --- /dev/null +++ b/lib/awsData.js.map @@ -0,0 +1 @@ +{"version":3,"file":"awsData.js","sourceRoot":"","sources":["../src/awsData.ts"],"names":[],"mappings":";;AAEa,QAAA,YAAY,GAAG,OAAO,CAAC,6BAA6B,CAAiB,CAAC;AAyFtE,QAAA,YAAY,GAAG,OAAO,CAAC,0CAA0C,CAA8B,CAAC;AAIhG,QAAA,mBAAmB,GAAG,OAAO,CAAC,qCAAqC,CAAqB,CAAC;AAIzF,QAAA,iBAAiB,GAAG,OAAO,CAAC,kCAAkC,CAAmB,CAAC;AAQlF,QAAA,qBAAqB,GAAG,OAAO,CAAC,sCAAsC,CAAuB,CAAC;AAE3G,4CAA4C;AAC5C,GAAG,CAAC,CAAC,IAAI,YAAY,IAAI,6BAAqB,CAAC,CAAC,CAAC;IAC7C,6BAAqB,CAAC,YAAY,CAAC,CAAC,kBAAkB,GAAG,6BAAqB,CAAC,YAAY,CAAC,CAAC,kBAAkB,IAAI,EAAE,CAAC;AAC1H,CAAC;AAaY,QAAA,eAAe,GAAG,OAAO,CAAC,+BAA+B,CAAiB,CAAC;AACxF,uBAAe,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC"} \ No newline at end of file diff --git a/lib/docs.d.ts b/lib/docs.d.ts new file mode 100644 index 0000000..f6cb3ce --- /dev/null +++ b/lib/docs.d.ts @@ -0,0 +1,2 @@ +export declare function getDoc(search: string | null, browse?: boolean): string; +export declare function getUrls(search?: string | null): string[]; diff --git a/lib/docs.js b/lib/docs.js new file mode 100644 index 0000000..ee528bd --- /dev/null +++ b/lib/docs.js @@ -0,0 +1,124 @@ +"use strict"; +var __values = (this && this.__values) || function (o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +}; +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var awsData_1 = require("./awsData"); +var opn = require("opn"); +function getDoc(search, browse) { + if (browse === void 0) { browse = true; } + var formattedSearch = search; + // TODO: Make the searching case insensitive + var docs = exports.getUrls(search); + if (browse) { + try { + for (var docs_1 = __values(docs), docs_1_1 = docs_1.next(); !docs_1_1.done; docs_1_1 = docs_1.next()) { + var u = docs_1_1.value; + opn(u); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (docs_1_1 && !docs_1_1.done && (_a = docs_1.return)) _a.call(docs_1); + } + finally { if (e_1) throw e_1.error; } + } + } + var j = docs.join(", "); + return "Opening " + j + " in your browser..."; + var e_1, _a; +} +exports.getDoc = getDoc; +; +function getUrls(search) { + if (search === void 0) { search = ''; } + if (search == null) + search = ''; + var docs = searchExtraDocs(search); + if (docs.length == 0) { + docs = searchInResources(search); + } + if (docs.length == 0) { + var urlencoded = encodeURI(search); + docs = ["http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation-guide&searchQuery=" + urlencoded + "&x=0&y=0&this_doc_product=AWS+CloudFormation&this_doc_guide=User+Guide&doc_locale=en_us#facet_doc_product=AWS%20CloudFormation&facet_doc_guide=User%20Guide"]; + } + return docs; +} +exports.getUrls = getUrls; +; +function searchInResources(search) { + var dotCount = (search.match(/\./g) || []).length; + if (dotCount == 0) { + // Resource Type + var resourceType = awsData_1.awsResources['ResourceTypes'][search]; + if (resourceType) { + return [resourceType.Documentation]; + } + } + else if (dotCount == 1) { + var urls = new Array(); + var propertyType = awsData_1.awsResources['PropertyTypes'][search]; + // Check PropertyTypes + if (propertyType) { + urls.push(propertyType.Documentation); + } + // Split and check Resource, then a property of that resource + var _a = __read(search.split('.'), 2), resourceName = _a[0], propertyName = _a[1]; + var resourceType = awsData_1.awsResources['ResourceTypes'][resourceName]; + if (resourceType) { + var property = resourceType.Properties[propertyName]; + if (property) { + urls.push(property.Documentation); + } + } + if (urls.length > 0) { + return urls; + } + } + else if (dotCount == 2) { + // Split and find a property of a PropertyType + var split = search.split('.'); + var propertyTypeName = split[0] + '.' + split[1]; + var propertyType = awsData_1.awsResources['PropertyTypes'][propertyTypeName]; + if (propertyType) { + var property = propertyType.Properties[split[2]]; + if (property) { + return [property.Documentation]; + } + } + } + return []; +} +function searchExtraDocs(search) { + if (awsData_1.awsExtraDocs.hasOwnProperty(search)) { + return [awsData_1.awsExtraDocs[search]]; + } + else { + return []; + } +} +//# sourceMappingURL=docs.js.map \ No newline at end of file diff --git a/lib/docs.js.map b/lib/docs.js.map new file mode 100644 index 0000000..a2afe17 --- /dev/null +++ b/lib/docs.js.map @@ -0,0 +1 @@ +{"version":3,"file":"docs.js","sourceRoot":"","sources":["../src/docs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAqD;AACrD,yBAA4B;AAG5B,gBAAuB,MAAqB,EAAE,MAAsB;IAAtB,uBAAA,EAAA,aAAsB;IAEhE,IAAI,eAAe,GAAG,MAAM,CAAC;IAE7B,4CAA4C;IAE5C,IAAI,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEnC,EAAE,CAAA,CAAC,MAAM,CAAC,CAAA,CAAC;;YACP,GAAG,CAAA,CAAU,IAAA,SAAA,SAAA,IAAI,CAAA,0BAAA;gBAAb,IAAI,CAAC,iBAAA;gBACL,GAAG,CAAC,CAAC,CAAC,CAAC;aACV;;;;;;;;;IACL,CAAC;IAED,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,MAAM,CAAC,aAAW,CAAC,wBAAqB,CAAC;;AAE7C,CAAC;AAjBD,wBAiBC;AAAA,CAAC;AAEF,iBAAwB,MAA0B;IAA1B,uBAAA,EAAA,WAA0B;IAE9C,EAAE,CAAA,CAAC,MAAM,IAAI,IAAI,CAAC;QAAC,MAAM,GAAG,EAAE,CAAC;IA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AC,CAAE,sBAAY,CAAC,MAAM,CAAC,CAAE,CAAC;IACpC,CAAC;IAAA,IAAI,CAAA,CAAC;QACF,MAAM,CAAC,EAAE,CAAC;IACd,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/lib/index.d.ts b/lib/index.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..6ebebf1 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,245 @@ +#!/usr/bin/env node +"use strict"; +var __values = (this && this.__values) || function (o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var yaml = require("js-yaml"); +var program = require("commander"); +require('colors'); +var util = require('util'); +var version = require('../package').version; +/** + * Used for parsing comma separated commandline argument values whilst, taking into account backslash escapes. + * Returns an array of strings (e.g. ["Arg1=Val1", "Arg2=Val2"]). + */ +function list(val) { + // prepare for a negated lookahead + val = val.replace(/\\,/g, ',\\'); + // split and remove escapes + return val.split(/,(?!\\)/g) + .map(function (x) { + return x.replace(/,\\/g, ','); + }) + .filter(function (x) { + return !!x; + }); +} +function doNoCommand() { + console.error('\n', 'No command provided!'); + process.exit(1); +} +function doNoArgument() { + console.error('\n', 'Missing required argument!'); + process.exit(1); +} +program + .version(version) + .action(function () { + program.help(); + doNoCommand(); +}) + .on('--help', function () { + doNoCommand(); +}); +program + .command('validate') + .usage(' [options]') + .option('-p, --parameters ', 'List of params', list) + .option('-p, --pseudo ', 'List of pseudo overrides', list) + .option('--guess-parameters', 'Guess any parameters that are not explicitely passed in and have no Default. This is the default behaviour.') + .option('-G, --no-guess-parameters', 'Fail validation if a parameter with no Default is not passed') + .option('-g, --only-guess-parameters ', 'Guess the provided parameters, and fail validation if a parameter with no Default is passed', list) + .option('-c, --custom-resource-attributes ', 'List of attributes', list) + .option('-v, --verbose', 'Verbose error messages') + .action(function (file, cmd) { + // Patch for CommanderJS bug that defaults this to true + if (cmd.parent.rawArgs.indexOf('--guess-parameters') != -1) { + cmd.guessParameters = true; + } + var validator = require('./validator'); + if (cmd.parameters) { + try { + for (var _a = __values(cmd.parameters), _b = _a.next(); !_b.done; _b = _a.next()) { + var param = _b.value; + // Set the parameter + var kv = param.split('='); + validator.addParameterValue(kv[0], kv[1]); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (_b && !_b.done && (_c = _a.return)) _c.call(_a); + } + finally { if (e_1) throw e_1.error; } + } + } + if (cmd.pseudo) { + try { + for (var _d = __values(cmd.pseudo), _e = _d.next(); !_e.done; _e = _d.next()) { + var pseudo = _e.value; + // Set the parameter + var kv = pseudo.split('='); + validator.addPseudoValue(kv[0], kv[1]); + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (_e && !_e.done && (_f = _d.return)) _f.call(_d); + } + finally { if (e_2) throw e_2.error; } + } + } + if (cmd.customResourceAttributes) { + try { + for (var _g = __values(cmd.customResourceAttributes), _h = _g.next(); !_h.done; _h = _g.next()) { + var customResourceAttribute = _h.value; + // Set the parameter + var kv = customResourceAttribute.split('='); + var key_kv = kv[0].split('.'); + var resource = key_kv[0]; + var attribute = key_kv[1]; + var value = yaml.safeLoad(kv[1]); + validator.addCustomResourceAttributeValue(resource, attribute, value); + } + } + catch (e_3_1) { e_3 = { error: e_3_1 }; } + finally { + try { + if (_h && !_h.done && (_j = _g.return)) _j.call(_g); + } + finally { if (e_3) throw e_3.error; } + } + } + var guessParameters; + if (cmd.guessParameters === false) { + guessParameters = []; + } + else if (cmd.onlyGuessParameters) { + guessParameters = cmd.onlyGuessParameters; + } + else { + guessParameters = undefined; + } + var options = { + guessParameters: guessParameters + }; + var result = Object(); + try { + result = validator.validateFile(file, options); + } + catch (err) { + var error = function (msg, errors) { + try { + for (var _a = __values(Object.keys(errors)), _b = _a.next(); !_b.done; _b = _a.next()) { + var error_1 = _b.value; + if (RegExp(error_1).test(msg)) { + return errors[error_1]; + } + } + } + catch (e_4_1) { e_4 = { error: e_4_1 }; } + finally { + try { + if (_b && !_b.done && (_c = _a.return)) _c.call(_a); + } + finally { if (e_4) throw e_4.error; } + } + return errors['']; + var e_4, _c; + }(err.message, { + 'Could not find file .*. Check the input path.': 'No such file.', + '': 'Unable to parse template! Use --verbose for more information.' + }); + console.log(error); + if (cmd.verbose) { + console.error(err); + } + process.exit(1); + } + // Show the errors + console.log((result['errors']['info'].length + " infos").grey); + try { + for (var _k = __values(result['errors']['info']), _l = _k.next(); !_l.done; _l = _k.next()) { + var info = _l.value; + console.log('Resource: ' + info['resource'].grey); + console.log('Message: ' + info['message'].grey); + console.log('Documentation: ' + info['documentation'].grey + '\n'); + } + } + catch (e_5_1) { e_5 = { error: e_5_1 }; } + finally { + try { + if (_l && !_l.done && (_m = _k.return)) _m.call(_k); + } + finally { if (e_5) throw e_5.error; } + } + console.log((result['errors']['warn'].length + " warn").yellow); + try { + for (var _o = __values(result['errors']['warn']), _p = _o.next(); !_p.done; _p = _o.next()) { + var warn = _p.value; + console.log('Resource: ' + warn['resource'].yellow); + console.log('Message: ' + warn['message'].yellow); + console.log('Documentation: ' + warn['documentation'].yellow + '\n'); + } + } + catch (e_6_1) { e_6 = { error: e_6_1 }; } + finally { + try { + if (_p && !_p.done && (_q = _o.return)) _q.call(_o); + } + finally { if (e_6) throw e_6.error; } + } + console.log((result['errors']['crit'].length + " crit").red); + try { + for (var _r = __values(result['errors']['crit']), _s = _r.next(); !_s.done; _s = _r.next()) { + var crit = _s.value; + console.log('Resource: ' + crit['resource'].red); + console.log('Message: ' + crit['message'].red); + console.log('Documentation: ' + crit['documentation'].red + '\n'); + } + } + catch (e_7_1) { e_7 = { error: e_7_1 }; } + finally { + try { + if (_s && !_s.done && (_t = _r.return)) _t.call(_r); + } + finally { if (e_7) throw e_7.error; } + } + if (result['templateValid'] === false) { + console.log('Template invalid!'.red.bold); + process.exit(1); + } + else { + console.log('Template valid!'.green); + process.exit(0); + } + var e_1, _c, e_2, _f, e_3, _j, e_5, _m, e_6, _q, e_7, _t; +}) + .on('--help', function () { + doNoArgument(); +}); +program + .command('docs') + .usage(' [options]') + .action(function (reference) { + var docs = require('./docs'); + console.log(docs.getDoc(reference)); +}) + .on('--help', function () { + doNoArgument(); +}); +if (process.argv.length < 4) { + process.argv.push('--help'); +} +program.parse(process.argv); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map new file mode 100644 index 0000000..36e5491 --- /dev/null +++ b/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAMA,8BAAiC;AACjC,mCAAsC;AAItC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAClB,IAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC7B,IAAI,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC;AAE5C;;;GAGG;AACH,cAAc,GAAW;IACrB,kCAAkC;IAClC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjC,2BAA2B;IAC3B,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC;SACvB,GAAG,CAAC,UAAC,CAAC;QACH,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC;SACD,MAAM,CAAC,UAAC,CAAC;QACN,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;AACX,CAAC;AAED;IACI,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;IAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED;IACI,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,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AE;IACV,YAAY,EAAE,CAAC;AACnB,CAAC,CAAC,CAAC;AAEP,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAChC,CAAC;AAED,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/logger.d.ts b/lib/logger.d.ts new file mode 100644 index 0000000..e06a400 --- /dev/null +++ b/lib/logger.d.ts @@ -0,0 +1,4 @@ +/// +import winston = require('winston'); +declare let logger: winston.LoggerInstance; +export = logger; diff --git a/lib/logger.js b/lib/logger.js new file mode 100644 index 0000000..8ca06d5 --- /dev/null +++ b/lib/logger.js @@ -0,0 +1,13 @@ +"use strict"; +var winston = require("winston"); +var logger = new (winston.Logger)({ + transports: [ + new (winston.transports.Console)({ json: false, timestamp: true, level: 'debug' }), + ], + exceptionHandlers: [ + new (winston.transports.Console)({ json: false, timestamp: true }), + ], + exitOnError: true +}); +module.exports = logger; +//# sourceMappingURL=logger.js.map \ No newline at end of file diff --git a/lib/logger.js.map b/lib/logger.js.map new file mode 100644 index 0000000..16d8322 --- /dev/null +++ b/lib/logger.js.map @@ -0,0 +1 @@ +{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA,iCAAoC;AAEpC,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9B,UAAU,EAAE;QACR,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;KACrF;IACD,iBAAiB,EAAE;QACf,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KACrE;IACD,WAAW,EAAE,IAAI;CACpB,CAAC,CAAC;AAEH,iBAAS,MAAM,CAAC"} \ No newline at end of file diff --git a/lib/parser.d.ts b/lib/parser.d.ts new file mode 100644 index 0000000..03dcea6 --- /dev/null +++ b/lib/parser.d.ts @@ -0,0 +1 @@ +export declare function openFile(path: string): any; diff --git a/lib/parser.js b/lib/parser.js new file mode 100644 index 0000000..b7dd293 --- /dev/null +++ b/lib/parser.js @@ -0,0 +1,46 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var yaml = require("js-yaml"); +var fs = require("fs"); +var yamlSchema_1 = require("./yamlSchema"); +var yamlSchema = yamlSchema_1.default(); +function openFile(path) { + // Check the file path is valid + if (!fs.existsSync(path)) { + throw Error("Could not find file " + path + ". Check the input path."); + } + // Try JSON loading + try { + return openJson(path); + } + catch (e) { + } + // Try YAML loading + try { + return openYaml(path); + } + catch (e) { + throw Error("Could not determine file type. Check your template is not malformed. " + e.message); + } +} +exports.openFile = openFile; +; +function openYaml(path) { + // Try and load the Yaml + var yamlParse = yaml.safeLoad(fs.readFileSync(path, 'utf8'), { + filename: path, + schema: yamlSchema, + onWarning: function (warning) { + console.error(warning); + } + }); + if (typeof yamlParse == 'object') { + return yamlParse; + } + // Yaml Parsing error + throw new Error("YAML could not be parsed."); +} +function openJson(path) { + return JSON.parse(fs.readFileSync(path, 'utf8')); +} +//# sourceMappingURL=parser.js.map \ No newline at end of file diff --git a/lib/parser.js.map b/lib/parser.js.map new file mode 100644 index 0000000..de3049c --- /dev/null +++ b/lib/parser.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parser.js","sourceRoot":"","sources":["../src/parser.ts"],"names":[],"mappings":";;AAAA,8BAAiC;AACjC,uBAA0B;AAC1B,2CAA2C;AAE3C,IAAM,UAAU,GAAG,oBAAe,EAAE,CAAC;AAErC,kBAAyB,IAAY;IAEjC,+BAA+B;IAC/B,EAAE,CAAC,CAAC,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e09d4 --- /dev/null +++ b/lib/resourcesSpec.d.ts @@ -0,0 +1,54 @@ +import { ResourceType, ResourcePropertyType, AWSPrimitiveType, Attribute } from './awsData'; +import CustomError = require('./util/CustomError'); +export declare class NoSuchProperty extends CustomError { + type: string; + propertyName: string; + constructor(type: string, propertyName: string); +} +export declare class NoSuchResourceType extends CustomError { + resourceType: string; + constructor(type: string); +} +export declare class NoSuchPropertyType extends CustomError { + propertyType: string; + constructor(type: string); +} +export declare class NoSuchResourceTypeAttribute extends CustomError { + resourceType: string; + attributeName: string; + constructor(type: string, attributeName: string); +} +export declare function getResourceType(type: string): ResourceType; +export declare function getResourceTypeAttribute(type: string, attributeName: string): Attribute; +/** + * Get a Resource or Property type from the specification. + */ +export declare function getType(type: string): ResourceType | ResourcePropertyType; +export declare function getRefOverride(resourceType: string): string | null; +/** + * Checks a ResourceType or PropertyType for the presence of a propertyName + * @param parentPropertyType a ResourceType or PropertyType + * @param propertyName name of the property to check against the specification + */ +export declare function isValidProperty(parentPropertyType: string, propertyName: string): boolean; +/** + * Checks the resource type and returns true if the propertyName is required. + */ +export declare function isRequiredProperty(parentPropertyType: string, propertyName: string): boolean; +export declare function isArnProperty(propertyName: string): boolean; +declare function isSinglePrimitivePropertyType(parentPropertyType: string, propertyName: string): boolean; +export { isSinglePrimitivePropertyType as isPrimitiveProperty }; +export declare function isAdditionalPropertiesEnabled(resourceType: string): boolean; +export declare function isPropertyTypeList(type: string, propertyName: string): boolean; +export declare function isPropertyTypeMap(type: string, propertyName: string): boolean; +declare function getPropertyTypeApi(baseType: string, propType: string, key: string): string | undefined; +export { getPropertyTypeApi as getPropertyType }; +export declare function getItemType(baseType: string, propType: string, key: string): string | undefined; +export declare function hasPrimitiveItemType(type: string, propertyName: string): boolean; +export declare function getPrimitiveItemType(type: string, key: string): AWSPrimitiveType | undefined; +export declare function getPrimitiveType(type: string, key: string): AWSPrimitiveType | undefined; +export declare function getRequiredProperties(type: string): string[]; +/** + * Allows extending the AWS Resource Specification with custom definitions. + */ +export declare function extendSpecification(spec: any): void; diff --git a/lib/resourcesSpec.js b/lib/resourcesSpec.js new file mode 100644 index 0000000..8a2fa58 --- /dev/null +++ b/lib/resourcesSpec.js @@ -0,0 +1,211 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var awsData_1 = require("./awsData"); +var mergeOptions = require('merge-options'); +var CustomError = require("./util/CustomError"); +var NoSuchProperty = /** @class */ (function (_super) { + __extends(NoSuchProperty, _super); + function NoSuchProperty(type, propertyName) { + var _this = _super.call(this, "No such property " + propertyName + " on " + type) || this; + CustomError.fixErrorInheritance(_this, NoSuchProperty); + _this.type = type; + _this.propertyName = propertyName; + return _this; + } + return NoSuchProperty; +}(CustomError)); +exports.NoSuchProperty = NoSuchProperty; +var NoSuchResourceType = /** @class */ (function (_super) { + __extends(NoSuchResourceType, _super); + function NoSuchResourceType(type) { + var _this = _super.call(this, "No such resource " + type) || this; + CustomError.fixErrorInheritance(_this, NoSuchResourceType); + return _this; + } + return NoSuchResourceType; +}(CustomError)); +exports.NoSuchResourceType = NoSuchResourceType; +var NoSuchPropertyType = /** @class */ (function (_super) { + __extends(NoSuchPropertyType, _super); + function NoSuchPropertyType(type) { + var _this = _super.call(this, "No such property type " + type) || this; + CustomError.fixErrorInheritance(_this, NoSuchPropertyType); + return _this; + } + return NoSuchPropertyType; +}(CustomError)); +exports.NoSuchPropertyType = NoSuchPropertyType; +var NoSuchResourceTypeAttribute = /** @class */ (function (_super) { + __extends(NoSuchResourceTypeAttribute, _super); + function NoSuchResourceTypeAttribute(type, attributeName) { + var _this = _super.call(this, "No such attribute " + attributeName + " on " + type) || this; + CustomError.fixErrorInheritance(_this, NoSuchResourceTypeAttribute); + _this.resourceType = type; + _this.attributeName = attributeName; + return _this; + } + return NoSuchResourceTypeAttribute; +}(CustomError)); +exports.NoSuchResourceTypeAttribute = NoSuchResourceTypeAttribute; +function getResourceType(type) { + // If the type starts with Custom::, it's a custom resource. + if (type.indexOf('Custom::') === 0) { + // return the generic type if there's no such custom type defined + if (!awsData_1.awsResources.ResourceTypes[type]) { + type = 'AWS::CloudFormation::CustomResource'; + } + return awsData_1.awsResources.ResourceTypes[type]; + } + // A normal resource type + var resourceType = awsData_1.awsResources.ResourceTypes[type]; + if (!resourceType) { + throw new NoSuchResourceType(type); + } + return resourceType; +} +exports.getResourceType = getResourceType; +function getResourceTypeAttribute(type, attributeName) { + var resourceAttributes = getResourceType(type).Attributes; + if (!resourceAttributes) { + throw new NoSuchResourceTypeAttribute(type, attributeName); + } + var resourceAttribute = resourceAttributes[attributeName]; + if (!resourceAttribute) { + throw new NoSuchResourceTypeAttribute(type, attributeName); + } + return resourceAttribute; +} +exports.getResourceTypeAttribute = getResourceTypeAttribute; +function getPropertyType(type) { + var propertyType = awsData_1.awsResources.PropertyTypes[type]; + if (!propertyType) { + throw new NoSuchPropertyType(type); + } + return propertyType; +} +/** + * Get a Resource or Property type from the specification. + */ +function getType(type) { + if (isPropertyTypeFormat(type)) { + return getPropertyType(type); + } + else { + return getResourceType(type); + } +} +exports.getType = getType; +function getProperty(type, propertyName) { + var spec = getType(type); + var property = spec.Properties[propertyName]; + if (!property) { + throw new NoSuchProperty(type, propertyName); + } + return property; +} +function isPropertyTypeFormat(type) { + return (type.indexOf('.') != -1) || type == 'Tag'; +} +function getRefOverride(resourceType) { + return awsData_1.awsResourceRefTypes[resourceType] || null; +} +exports.getRefOverride = getRefOverride; +/** + * Checks a ResourceType or PropertyType for the presence of a propertyName + * @param parentPropertyType a ResourceType or PropertyType + * @param propertyName name of the property to check against the specification + */ +function isValidProperty(parentPropertyType, propertyName) { + return getType(parentPropertyType).Properties.hasOwnProperty(propertyName); +} +exports.isValidProperty = isValidProperty; +/** + * Checks the resource type and returns true if the propertyName is required. + */ +function isRequiredProperty(parentPropertyType, propertyName) { + return getProperty(parentPropertyType, propertyName).Required; +} +exports.isRequiredProperty = isRequiredProperty; +function isArnProperty(propertyName) { + // Check if the parentPropertyType exists + return (propertyName.indexOf('Arn') != -1); +} +exports.isArnProperty = isArnProperty; +function isSinglePrimitivePropertyType(parentPropertyType, propertyName) { + return Boolean(getProperty(parentPropertyType, propertyName).PrimitiveType); +} +exports.isPrimitiveProperty = isSinglePrimitivePropertyType; +function isAdditionalPropertiesEnabled(resourceType) { + return getType(resourceType).AdditionalProperties === true; +} +exports.isAdditionalPropertiesEnabled = isAdditionalPropertiesEnabled; +function isPropertyTypeList(type, propertyName) { + return getProperty(type, propertyName).Type === 'List'; +} +exports.isPropertyTypeList = isPropertyTypeList; +function isPropertyTypeMap(type, propertyName) { + return getProperty(type, propertyName).Type === 'Map'; +} +exports.isPropertyTypeMap = isPropertyTypeMap; +function getPropertyTypeApi(baseType, propType, key) { + var property = getProperty(propType, key); + if (!property.Type) { + return undefined; + } + return baseType + '.' + property.Type; +} +exports.getPropertyType = getPropertyTypeApi; +function getItemType(baseType, propType, key) { + var property = getProperty(propType, key); + if (!property.ItemType) { + return undefined; + } + else if (property.ItemType === 'Tag') { + return 'Tag'; + } + else { + return baseType + '.' + property.ItemType; + } +} +exports.getItemType = getItemType; +function hasPrimitiveItemType(type, propertyName) { + return Boolean(getProperty(type, propertyName).PrimitiveItemType); +} +exports.hasPrimitiveItemType = hasPrimitiveItemType; +function getPrimitiveItemType(type, key) { + return getProperty(type, key).PrimitiveItemType; +} +exports.getPrimitiveItemType = getPrimitiveItemType; +function getPrimitiveType(type, key) { + return getProperty(type, key).PrimitiveType; +} +exports.getPrimitiveType = getPrimitiveType; +function getRequiredProperties(type) { + var spec = getType(type); + var requiredProperties = []; + for (var prop in spec['Properties']) { + if (spec['Properties'][prop]['Required'] === true) { + requiredProperties.push(prop); + } + } + return requiredProperties; +} +exports.getRequiredProperties = getRequiredProperties; +/** + * Allows extending the AWS Resource Specification with custom definitions. + */ +function extendSpecification(spec) { + Object.assign(awsData_1.awsResources, mergeOptions(awsData_1.awsResources, spec)); +} +exports.extendSpecification = extendSpecification; +//# sourceMappingURL=resourcesSpec.js.map \ No newline at end of file diff --git a/lib/resourcesSpec.js.map b/lib/resourcesSpec.js.map new file mode 100644 index 0000000..2917f79 --- /dev/null +++ b/lib/resourcesSpec.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resourcesSpec.js","sourceRoot":"","sources":["../src/resourcesSpec.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAQmB;AAEnB,IAAM,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAE9C,gDAAmD;AACnD;IAAoC,kCAAW;IAG3C,wBAAY,IAAY,EAAE,YAAoB;QAA9C,YACI,kBAAM,sBAAoB,YAAY,YAAO,IAAM,CAAC,SAMvD;QAJG,WAAW,CAAC,mBAAmB,CAAC,KAAI,EAAE,cAAc,CAAC,CAAA;QAErD,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,YAAY,GAAG,YAAY,CAAC;;IACrC,CAAC;IACL,qBAAC;AAAD,CAAC,AAXD,CAAoC,WAAW,GAW9C;AAXY,wCAAc;AAa3B;IAAwC,sCAAW;IAE/C,4BAAY,IAAY;QAAxB,YACI,kBAAM,sBAAoB,IAAM,CAAC,SAEpC;QADG,WAAW,CAAC,mBAAmB,CAAC,KAAI,EAAE,kBAAkB,CAAC,CAAA;;IAC7D,CAAC;IACL,yBAAC;AAAD,CAAC,AAND,CAAwC,WAAW,GAMlD;AANY,gDAAkB;AAQ/B;IAAwC,sCAAW;IAE/C,4BAAY,IAAY;QAAxB,YACI,kBAAM,2BAAyB,IAAM,CAAC,SAEzC;QADG,WAAW,CAAC,mBAAmB,CAAC,KAAI,EAAE,kBA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AI,CAAC,CAAC;IACzB,IAAI,kBAAkB,GAAG,EAAE,CAAC;IAE5B,GAAG,CAAA,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAA,CAAC;QAChC,EAAE,CAAA,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAE,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC,CAAA,CAAC;YAC/C,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC;AAC9B,CAAC;AAXD,sDAWC;AAED;;GAEG;AACH,6BAAoC,IAAS;IACzC,MAAM,CAAC,MAAM,CAAC,sBAAa,EAAE,YAAY,CAAC,sBAAa,EAAE,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC;AAFD,kDAEC"} \ No newline at end of file diff --git a/lib/test/apiTest.d.ts b/lib/test/apiTest.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/lib/test/apiTest.js b/lib/test/apiTest.js new file mode 100644 index 0000000..632a91f --- /dev/null +++ b/lib/test/apiTest.js @@ -0,0 +1,54 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var chai_1 = require("chai"); +var path = require("path"); +var api = require("../api"); +describe('api', function () { + describe('validateFile', function () { + it('should validate a file', function () { + var file = path.join(__dirname, '../../testData/valid/yaml/1.yaml'); + var result = api.validateFile(file); + chai_1.expect(result).to.have.property('templateValid', true); + chai_1.expect(result.errors.crit).to.have.length(0); + }); + it('should pass properties', function () { + var file = path.join(__dirname, '../../testData/valid/yaml/2.yaml'); + var result = api.validateFile(file, { + parameters: { + CertificateArn: 'arn:aws:something' + } + }); + chai_1.expect(result).to.have.property('templateValid', true); + chai_1.expect(result.errors.crit).to.have.length(0); + }); + it('should pass pseudo-parameters', function () { + var file = path.join(__dirname, '../../testData/valid/yaml/pseudo-parameters.yaml'); + var result = api.validateFile(file, { + pseudoParameters: { + 'AWS::AccountId': '000000000000', + 'AWS::Region': 'us-east-1' + } + }); + chai_1.expect(result).to.have.property('templateValid', true); + chai_1.expect(result.errors.crit).to.have.length(0); + }); + it('should reset validator state', function () { + var file = path.join(__dirname, '../../testData/valid/yaml/2.yaml'); + var validator = require('../validator'); + validator.addParameterValue('CertificateArn', 'arn:aws:something'); + var result = api.validateFile(file); + chai_1.expect(result).to.have.property('templateValid', false); + chai_1.expect(result.errors.crit).to.have.length(1); + chai_1.expect(result.errors.crit[0].message).to.contain('\'string_input_CertificateArn\''); + }); + }); + describe('validateJsonObject', function () { + it('should validate an object', function () { + var cfn = require('../../testData/valid/json/1.json'); + var result = api.validateJsonObject(cfn); + chai_1.expect(result).to.have.property('templateValid', true); + chai_1.expect(result.errors.crit).to.have.length(0); + }); + }); +}); +//# sourceMappingURL=apiTest.js.map \ No newline at end of file diff --git a/lib/test/apiTest.js.map b/lib/test/apiTest.js.map new file mode 100644 index 0000000..339bcf7 --- /dev/null +++ b/lib/test/apiTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"apiTest.js","sourceRoot":"","sources":["../../src/test/apiTest.ts"],"names":[],"mappings":";;AAAA,6BAA4B;AAC5B,2BAA8B;AAC9B,4BAA+B;AAE/B,QAAQ,CAAC,KAAK,EAAE;IACd,QAAQ,CAAC,cAAc,EAAE;QACvB,EAAE,CAAC,wBAAwB,EAAE;YAC3B,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kCAAkC,CAAC,CAAC;YACtE,IAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACtC,aAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;YACvD,aAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,C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AC,CAAC;YACnE,IAAM,MAAM,GAAG,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YACtC,aAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;YACxD,aAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC7C,aAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,iCAAiC,CAAC,CAAC;QACtF,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,oBAAoB,EAAE;QAC7B,EAAE,CAAC,2BAA2B,EAAE;YAC9B,IAAM,GAAG,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;YACxD,IAAM,MAAM,GAAG,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;YAC3C,aAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;YACvD,aAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/test/docsTest.d.ts b/lib/test/docsTest.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/lib/test/docsTest.js b/lib/test/docsTest.js new file mode 100644 index 0000000..c1d49f9 --- /dev/null +++ b/lib/test/docsTest.js @@ -0,0 +1,26 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var chai = require("chai"); +var expect = chai.expect; +var assert = chai.assert; +var docs = require("../docs"); +describe('docs', function () { + it('resource type', function () { + var result = docs.getDoc("AWS::Lambda::Function", false); + expect(result).to.contain("aws-resource-lambda-function.html"); + }); + it('resource type property', function () { + var result = docs.getDoc("AWS::Lambda::Function.Handler", false); + expect(result).to.contain("aws-resource-lambda-function.html#cfn-lambda-function-handler"); + }); + it('parameter type', function () { + var result = docs.getDoc("AWS::Lambda::Function.Code", false); + expect(result).to.contain("aws-properties-lambda-function-code.html"); + expect(result).to.contain("aws-resource-lambda-function.html#cfn-lambda-function-code"); + }); + it('parameter type property', function () { + var result = docs.getDoc("AWS::Lambda::Function.Code.S3Bucket", false); + expect(result).to.contain("aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3bucket"); + }); +}); +//# sourceMappingURL=docsTest.js.map \ No newline at end of file diff --git a/lib/test/docsTest.js.map b/lib/test/docsTest.js.map new file mode 100644 index 0000000..ad4e3a3 --- /dev/null +++ b/lib/test/docsTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"docsTest.js","sourceRoot":"","sources":["../../src/test/docsTest.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,8BAAiC;AAEjC,QAAQ,CAAC,MAAM,EAAE;IAEb,EAAE,CAAC,eAAe,EAAE;QAChB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAC;QACzD,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE;QACzB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;QACjE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,+DAA+D,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE;QACjB,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;QAC9D,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,0CAA0C,CAAC,CAAC;QACtE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,4DAA4D,CAAC,CAAC;IAC5F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE;QAC1B,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;QACvE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,4EAA4E,CAAC,CAAC;IAC5G,CAAC,CAAC,CAAC;AAKP,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/test/indexTest.d.ts b/lib/test/indexTest.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/lib/test/indexTest.js b/lib/test/indexTest.js new file mode 100644 index 0000000..0619998 --- /dev/null +++ b/lib/test/indexTest.js @@ -0,0 +1,201 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var chai = require("chai"); +var expect = chai.expect; +var assert = chai.assert; +var childProcess = require("child_process"); +var exec = childProcess.exec; +var proxyquire = require('proxyquire-2').noPreserveCache(); +var logToConsole = true; +var _log = console.log; +console.log = function () { + if (logToConsole) { + return _log.apply(this, arguments); + } +}; +var _err = console.error; +console.error = function () { + if (logToConsole) { + return _err.apply(this, arguments); + } +}; +describe('index', function () { + describe('CLI', function () { + it('no parameters', function (done) { + exec('node lib/index.js', function (error, stdout, stderr) { + expect(stderr).to.contain('No command provided!'); + done(); + }); + }).timeout(5000); + ; + it('missing file parameter', function (done) { + exec('node lib/index.js validate', function (error, stdout, stderr) { + expect(stderr).to.contain('Missing required argument!'); + done(); + }); + }).timeout(5000); + ; + it('validate simple yaml', function (done) { + exec('node lib/index.js validate testData/valid/yaml/issue-28-custom-resource.yaml', function (error, stdout, stderr) { + expect(stdout).to.contain('0 crit'); + done(); + }); + }).timeout(5000); + it('validate parameter flag', function (done) { + exec('node lib/index.js validate testData/valid/json/2.json --parameters InstanceType="t1.micro"', function (error, stdout, stderr) { + expect(stdout).to.contain('0 crit'); + done(); + }); + }).timeout(5000); + it('validate pseudo flag', function (done) { + exec('node lib/index.js validate testData/valid/yaml/pseudo-parameters.yaml ' + + '--pseudo AWS::Region=us-east-1,AWS::AccountId=000000000000', function (error, stdout, stderr) { + expect(stdout).to.contain('0 crit'); + done(); + }); + }).timeout(5000); + it('validate pseudo + parameter flag', function (done) { + exec('node lib/index.js validate testData/valid/yaml/pseudo-w-parameter.yaml ' + + '--parameters MyInput=abcd --pseudo AWS::Region=us-east-1', function (error, stdout, stderr) { + expect(stdout).to.contain('0 crit'); + done(); + }); + }).timeout(5000); + it('invalid pseudo flag throws 2 critical error', function (done) { + exec('node lib/index.js validate testData/valid/yaml/pseudo-parameters.yaml ' + + '--pseudo AWS::Region=us-east-1,Something=000000000000', function (error, stdout, stderr) { + expect(stdout).to.contain('2 crit'); + done(); + }); + }).timeout(5000); + it('guess-parameters should explicitely opt in to parameter mocking', function (done) { + exec('node lib/index.js validate testData/valid/yaml/no-guess-parameters.yaml --guess-parameters', function (error, stdout, stderr) { + expect(stdout).to.contain('0 crit'); + done(); + }); + }).timeout(5000); + it('no-guess-parameters throws errors if we leave out parameters', function (done) { + exec('node lib/index.js validate testData/valid/yaml/no-guess-parameters.yaml --no-guess-parameters', function (error, stdout, stderr) { + expect(stdout).to.contain('2 crit'); + expect(stdout).to.contain('Value for parameter was not provided'); + done(); + }); + }).timeout(5000); + it('only-guess-parameters should allow opting in to parameter mocking', function (done) { + exec('node lib/index.js validate testData/valid/yaml/no-guess-parameters.yaml --only-guess-parameters Param1', function (error, stdout, stderr) { + expect(stdout).to.contain('1 crit'); + expect(stdout).to.contain('Value for parameter was not provided'); + done(); + }); + }).timeout(5000); + it('only-guess-parameters should allow opting in to parameter mocking with multiple params', function (done) { + exec('node lib/index.js validate testData/valid/yaml/no-guess-parameters.yaml --only-guess-parameters Param1,Param2', function (error, stdout, stderr) { + expect(stdout).to.contain('0 crit'); + done(); + }); + }).timeout(5000); + it('handle validation exceptions - non-verbose', function (done) { + exec('node lib/index.js validate testData/invalid/yaml/invalid_yaml.yaml', function (error, stdout, stderr) { + expect(error).to.have.property('code', 1); + expect(stdout).to.contain('Unable to parse template! Use --verbose for more information.'); + expect(stderr).to.be.empty; + done(); + }); + }).timeout(5000); + it('handle validation exceptions - verbose', function (done) { + exec('node lib/index.js validate testData/invalid/yaml/invalid_yaml.yaml --verbose', function (error, stdout, stderr) { + expect(error).to.have.property('code', 1); + expect(stdout).to.contain('Unable to parse template! Use --verbose for more information.'); + expect(stderr).to.contain('Error: Could not determine file type'); + done(); + }); + }).timeout(5000); + it('parameters of the CommaDelimitedList type should accept lists as values', function (done) { + exec('node lib/index.js validate testData/valid/yaml/parameters_type_commadelimitedlist.yaml --parameters SomeParam="test\\,dev\\,prod"', function (error, stdout, stderr) { + expect(stdout).to.contain('0 warn'); + expect(stdout).to.contain('0 crit'); + expect(stderr).to.be.empty; + done(); + }); + }).timeout(5000); + it('parameters of the List type should accept lists as values', function (done) { + exec('node lib/index.js validate testData/valid/yaml/parameters_type_list_number.yaml --parameters SomeParam="1\\,2\\,3"', function (error, stdout, stderr) { + expect(stdout).to.contain('0 warn'); + expect(stdout).to.contain('0 crit'); + expect(stderr).to.be.empty; + done(); + }); + }).timeout(5000); + it('custom resource attribute parameter should accept an arbitrary attribute value using resource-type notation', function (done) { + process.exit = function () { return undefined; }; + process.argv = ['', '', 'validate', 'testData/valid/yaml/smoke.yaml', '--custom-resource-attributes', 'AWS::CloudFormation::CustomResource.SomeAttribute=[1\\,2]']; + logToConsole = false; + proxyquire('../index', { + './validator': { + addCustomResourceAttributeValue: function (x, y, z) { + logToConsole = true; + expect(x).to.equal('AWS::CloudFormation::CustomResource'); + expect(y).to.equal('SomeAttribute'); + expect(z).to.deep.equal([1, 2]); + done(); + logToConsole = false; + }, + validateFile: function () { return { errors: { info: [], warn: [], crit: [] } }; }, + '@global': true + } + }); + logToConsole = true; + }).timeout(5000); + it('custom resource attribute parameter should accept an arbitrary attribute value using logical-name notation', function (done) { + process.exit = function () { return undefined; }; + process.argv = ['', '', 'validate', 'testData/valid/yaml/smoke.yaml', '--custom-resource-attributes', 'SomethingBeautiful.SomeAttribute=test']; + logToConsole = false; + proxyquire('../index', { + './validator': { + addCustomResourceAttributeValue: function (x, y, z) { + logToConsole = true; + expect(x).to.equal('SomethingBeautiful'); + expect(y).to.equal('SomeAttribute'); + expect(z).to.equal('test'); + done(); + logToConsole = false; + }, + validateFile: function () { return { errors: { info: [], warn: [], crit: [] } }; }, + '@global': true + } + }); + logToConsole = true; + }).timeout(5000); + it('custom resource attribute parameter should accept an arbitrary attribute value using mixed notation', function (done) { + process.exit = function () { return undefined; }; + process.argv = ['', '', 'validate', 'testData/valid/yaml/smoke.yaml', '--custom-resource-attributes', 'AWS::CloudFormation::CustomResource.SomeAttribute=hello,SomethingBeautiful.SomeAttribute=test,Custom::Dooby.SomeAttribute=blabla']; + logToConsole = false; + var expectedValues = [ + ['AWS::CloudFormation::CustomResource', 'SomeAttribute', 'hello'], + ['SomethingBeautiful', 'SomeAttribute', 'test'], + ['Custom::Dooby', 'SomeAttribute', 'blabla'], + ]; + proxyquire('../index', { + './validator': { + addCustomResourceAttributeValue: function (x, y, z) { + logToConsole = true; + var expected = expectedValues.shift(); + if (!!expected) { + expect(x).to.equal(expected[0]); + expect(y).to.equal(expected[1]); + expect(z).to.equal(expected[2]); + } + if (expectedValues.length == 0) { + done(); + } + logToConsole = false; + }, + validateFile: function () { return { errors: { info: [], warn: [], crit: [] } }; }, + '@global': true + } + }); + logToConsole = true; + }).timeout(5000); + }); +}); +//# sourceMappingURL=indexTest.js.map \ No newline at end of file diff --git a/lib/test/indexTest.js.map b/lib/test/indexTest.js.map new file mode 100644 index 0000000..83be02a --- /dev/null +++ b/lib/test/indexTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"indexTest.js","sourceRoot":"","sources":["../../src/test/indexTest.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAE3B,4CAA+C;AAC/C,IAAM,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;AAE/B,IAAM,UAAU,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,eAAe,EAAE,CAAC;AAE7D,IAAI,YAAY,GAAG,IAAI,CAAC;AACxB,IAAI,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC;AACvB,OAAO,CAAC,GAAG,GAAG;IACZ,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACvC,CAAC;AACH,CAAC,CAAA;AACD,IAAI,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC;AACzB,OAAO,CAAC,KAAK,GAAG;IACd,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACvC,CAAC;AACH,CAAC,CAAA;AAED,QAAQ,CAAC,OAAO,EAAE;IAGd,QAAQ,CAAC,KAAK,EAAE;QAGZ,EAAE,CAAC,eAAe,EAAE,UAAC,IAAI;YACrB,IAAI,CAAC,mBAAmB,EAAE,UAAS,KAAK,EAAE,MAAM,EAAE,MAAM;gBACpD,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;gBAClD,IAAI,EAAE,CAAC;YACX,CAAC,CAAC,CAAC;QACP,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;QACxB,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/test/parserTest.d.ts b/lib/test/parserTest.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/lib/test/parserTest.js b/lib/test/parserTest.js new file mode 100644 index 0000000..163f428 --- /dev/null +++ b/lib/test/parserTest.js @@ -0,0 +1,41 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var chai = require("chai"); +var expect = chai.expect; +var assert = chai.assert; +var parser = require("../parser"); +describe('parser', function () { + describe('openFile', function () { + it('valid yaml should return valid javascript object', function () { + var result = parser.openFile("./testData/valid/yaml/1.yaml"); + expect(result).to.not.equal(undefined); + expect(result).to.not.equal(null); + expect(result['Outputs']['PublicIP']['Value']).to.have.any.keys('Fn::GetAtt'); + expect(result['Resources']['WebServer']['Properties']['ImageId']['Fn::FindInMap']).to.not.equal(null); + expect(result['Resources']['WebServer']['Properties']['ImageId']['Fn::FindInMap'][1]['Ref']).to.equal("AWS::Region"); + }); + it('valid yaml with shorthand should return valid javascript object', function () { + var result = parser.openFile("./testData/valid/yaml/valid_shorthand_sub.yaml"); + expect(result).to.not.equal(undefined); + expect(result).to.not.equal(null); + }); + it('valid yaml !GetAtt as array should return valid javascript object', function () { + var result = parser.openFile("./testData/valid/yaml/issue_164_getatt_shorthand_parsing.yaml"); + expect(result).to.not.equal(undefined); + expect(result).to.not.equal(null); + }); + it('invalid yaml should throw an Error', function () { + var fn = function () { parser.openFile("./testData/invalid/yaml/invalid_yaml.yaml"); }; + expect(fn).to.throw(/Could not determine file type. Check your template is not malformed./); + }); + it('invalid json should throw an Error', function () { + var fn = function () { parser.openFile("./testData/invalid/json/invalid_json.json"); }; + expect(fn).to.throw(/Could not determine file type. Check your template is not malformed./); + }); + it('invalid file path should throw an Error', function () { + var fn = function () { parser.openFile("some_invalid_path"); }; + expect(fn).to.throw(/Could not find file/); + }); + }); +}); +//# sourceMappingURL=parserTest.js.map \ No newline at end of file diff --git a/lib/test/parserTest.js.map b/lib/test/parserTest.js.map new file mode 100644 index 0000000..7bfbb94 --- /dev/null +++ b/lib/test/parserTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parserTest.js","sourceRoot":"","sources":["../../src/test/parserTest.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,kCAAqC;AAErC,QAAQ,CAAC,QAAQ,EAAE;IAEf,QAAQ,CAAC,UAAU,EAAE;QAEjB,EAAE,CAAC,kDAAkD,EAAE;YACnD,IAAI,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC;YAC7D,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACvC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAClC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YAC9E,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACtG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,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AC,CAAC,CAAC;YAC7D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IAGP,CAAC,CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/test/resourcesTest.d.ts b/lib/test/resourcesTest.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/lib/test/resourcesTest.js b/lib/test/resourcesTest.js new file mode 100644 index 0000000..3f930c8 --- /dev/null +++ b/lib/test/resourcesTest.js @@ -0,0 +1,109 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var chai = require("chai"); +var expect = chai.expect; +var assert = chai.assert; +var resourceSpec = require("../resourcesSpec"); +describe('resourceSpec', function () { + describe('getType', function () { + it('should return a resource type', function () { + var result = resourceSpec.getType("AWS::Lambda::Function"); + expect(result).to.not.equal(null); + }); + it('should return a property type', function () { + var result = resourceSpec.getType("AWS::Lambda::Function.Code"); + expect(result).to.not.equal(null); + }); + it('should throw for invalid type', function () { + expect(function () { return resourceSpec.getType("AWS::Lambda::InvalidFunction"); }).to.throw(resourceSpec.NoSuchResourceType); + }); + }); + describe('isValidProperty', function () { + it('should return True for AWS::Lambda::Function > Code', function () { + var result = resourceSpec.isValidProperty("AWS::Lambda::Function", "Code"); + expect(result).to.equal(true); + }); + it('should return False for AWS::Lambda::Function > MyCode', function () { + var result = resourceSpec.isValidProperty("AWS::Lambda::Function", "MyCode"); + expect(result).to.equal(false); + }); + it('should throw for AWS::Lambda::InvalidFunction > Code', function () { + expect(function () { return resourceSpec.isValidProperty("AWS::Lambda::InvalidFunction", "Code"); }).to.throw(resourceSpec.NoSuchResourceType); + }); + }); + describe('isRequiredProperty', function () { + it('should return True for AWS::IAM::User.Policy > PolicyName', function () { + var result = resourceSpec.isRequiredProperty("AWS::IAM::User.Policy", "PolicyName"); + expect(result).to.equal(true); + }); + it('should return True for AWS::Lambda::Function > Code', function () { + var result = resourceSpec.isRequiredProperty("AWS::Lambda::Function", "Code"); + expect(result).to.equal(true); + }); + it('should return False for AWS::Lambda::Function > Description', function () { + var result = resourceSpec.isRequiredProperty("AWS::Lambda::Function", "Description"); + expect(result).to.equal(false); + }); + it('should throw for AWS::Lambda::InvalidFunction > Description', function () { + expect(function () { return resourceSpec.isRequiredProperty("AWS::Lambda::InvalidFunction", "Description"); }).to.throw(resourceSpec.NoSuchResourceType); + }); + }); + describe('isSinglePrimitivePropertyType', function () { + it('should return True for AWS::Lambda::Function > Description', function () { + var result = resourceSpec.isPrimitiveProperty("AWS::Lambda::Function", "Description"); + expect(result).to.equal(true); + }); + it('should return False for AWS::Lambda::Function > Code', function () { + var result = resourceSpec.isPrimitiveProperty("AWS::Lambda::Function", "Code"); + expect(result).to.equal(false); + }); + it('should return False for AWS::Lambda::InvalidFunction > Code', function () { + expect(function () { return resourceSpec.isPrimitiveProperty("AWS::Lambda::InvalidFunction", "Code"); }).to.throw(resourceSpec.NoSuchResourceType); + }); + }); + describe('isArnProperty', function () { + it('should return True for KmsKeyArn', function () { + var result = resourceSpec.isArnProperty("KmsKeyArn"); + expect(result).to.equal(true); + }); + // TODO: Check for ARNs + it('should return True for TopicArn', function () { + var result = resourceSpec.isArnProperty("TopicArn"); + expect(result).to.equal(true); + }); + it('should return False for Code', function () { + var result = resourceSpec.isArnProperty("Code"); + expect(result).to.equal(false); + }); + }); + describe('getRefOverride', function () { + it('should return "arn" for AWS::ECS::Service', function () { + var result = resourceSpec.getRefOverride("AWS::ECS::Service"); + expect(result).to.equal("arn"); + }); + it('should return null for AWS::Lambda::Function', function () { + var result = resourceSpec.getRefOverride("AWS::Lambda::Function"); + expect(result).to.equal(null); + }); + }); + describe('getResourceTypeAttribute', function () { + it('should return "String" for AWS::ECS::Service attribute Name', function () { + var result = resourceSpec.getResourceTypeAttribute("AWS::ECS::Service", "Name"); + var res = result; + expect(res.PrimitiveType).to.equal("String"); + }); + it('should return "List of String" for AWS::Route53::HostedZone attribute NameServers', function () { + var result = resourceSpec.getResourceTypeAttribute("AWS::Route53::HostedZone", "NameServers"); + var res = result; + expect(res.Type).to.equal("List"); + expect(res.PrimitiveItemType).to.equal("String"); + }); + it('should throw NoSuchResourceTypeAttribute for any attrbute on a type with no attributes', function () { + expect(function () { return resourceSpec.getResourceTypeAttribute("AWS::CloudFormation::WaitConditionHandle", "Anything"); }).to.throw(resourceSpec.NoSuchResourceTypeAttribute); + }); + it('should throw NoSuchResourceTypeAttribute for an attrbute that does not exist on a type', function () { + expect(function () { return resourceSpec.getResourceTypeAttribute("AWS::ECS::Service", "AttributeThatDoesNotExist"); }).to.throw(resourceSpec.NoSuchResourceTypeAttribute); + }); + }); +}); +//# sourceMappingURL=resourcesTest.js.map \ No newline at end of file diff --git a/lib/test/resourcesTest.js.map b/lib/test/resourcesTest.js.map new file mode 100644 index 0000000..8cb1e56 --- /dev/null +++ b/lib/test/resourcesTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resourcesTest.js","sourceRoot":"","sources":["../../src/test/resourcesTest.ts"],"names":[],"mappings":";;AAAA,2BAA8B;AAC9B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,+CAAkD;AAMlD,QAAQ,CAAC,cAAc,EAAE;IAErB,QAAQ,CAAC,SAAS,EAAE;QAEhB,EAAE,CAAC,+BAA+B,EAAE;YAChC,IAAI,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;YAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,+BAA+B,EAAE;YAChC,IAAI,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;YAChE,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,C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CAAC,CAAC;AAEP,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/test/validatorTest.d.ts b/lib/test/validatorTest.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/lib/test/validatorTest.js b/lib/test/validatorTest.js new file mode 100644 index 0000000..2913ad0 --- /dev/null +++ b/lib/test/validatorTest.js @@ -0,0 +1,1244 @@ +"use strict"; +var __values = (this && this.__values) || function (o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var chai = require("chai"); +var expect = chai.expect; +var assert = chai.assert; +var validator = require("../validator"); +var yaml = require("js-yaml"); +var awsData_1 = require("../awsData"); +var util = require("util"); +describe('validator', function () { + beforeEach(function () { + validator.resetValidator(); + }); + describe('validateJsonObject', function () { + it('a valid (1.json) template should return an object with validTemplate = true, no crit errors', function () { + var input = require('../../testData/valid/json/1.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('a valid (2.json) template should return an object with validTemplate = true, no crit errors', function () { + var input = require('../../testData/valid/json/2.json'); + validator.addParameterValue('InstanceType', 't1.micro'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('a valid (3.json) template should return an object with validTemplate = true, no crit errors', function () { + var input = require('../../testData/valid/json/3.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('a valid (4.json) template should return an object with validTemplate = true, no crit errors', function () { + var input = require('../../testData/valid/json/4.json'); + validator.addParameterValue('InstanceType', 't1.micro'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('2 invalid resource types should return an object with validTemplate = false, 2 crit errors', function () { + var input = require('../../testData/invalid/json/1_invalid_resource_type.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(2); + }); + it('1 missing parameter type should return an object with validTemplate = false, 1 crit errors', function () { + var input = require('../../testData/invalid/json/1_missing_parameter_type.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('1 invalid parameter type should return an object with validTemplate = false, 1 crit errors', function () { + var input = require('../../testData/invalid/json/1_invalid_parameter_type.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('missing section resources should return an object with validTemplate = false, 1 crit errors', function () { + var input = require('../../testData/invalid/json/no_resources.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('empty section resources should return an object with validTemplate = false, 1 crit errors', function () { + var input = require('../../testData/invalid/json/empty_resources.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('1 invalid resource reference should return an object with validTemplate = false, 1 crit errors', function () { + var input = require('../../testData/invalid/json/1_invalid_resource_reference.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('1 invalid parameter reference should return an object with validTemplate = false, 1 crit errors', function () { + var input = require('../../testData/invalid/json/1_invalid_parameter_reference.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('2 invalid Fn::Join\'s should return an object with validTemplate = false, 2 crit errors', function () { + var input = require('../../testData/invalid/json/2_invalid_intrinsic_join.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(2); + }); + it('1 invalid Fn::GetAtt should return an object with validTemplate = false, 1 crit errors', function () { + var input = require('../../testData/invalid/json/1_invalid_intrinsic_get_att.json'); + validator.addParameterValue('InstanceType', 't1.micro'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('1 invalid Fn::FindInMap should return an object with validTemplate = false, 1 crit errors', function () { + var input = require('../../testData/invalid/json/1_invalid_intrinsic_mappings.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('1 invalid Ref within Parameters should return an object with validTemplate = false, 1 crit errors', function () { + var input = require('../../testData/invalid/json/1_intrinsic_function_in_parameters.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('1 invalid GetAZs parameter should return an object with validTemplate = false, 1 crit errors', function () { + var input = require('../../testData/invalid/json/1_invalid_get_azs_parameter.json'); + validator.addParameterValue('InstanceType', 't1.micro'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('1 reference non AWS::Region GetAZs parameter should return an object with validTemplate = false, 1 warn errors', function () { + var input = require('../../testData/invalid/json/1_warning_ref_get_azs_parameter.json'); + validator.addParameterValue('InstanceType', 't1.micro'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['warn']).to.have.lengthOf(1); + }); + }); + describe('Fn::Join', function () { + it('should error if it attempts to join anything but a list of values', function () { + var input = './testData/invalid/yaml/invalid_join_parts.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.include('Invalid parameters for Fn::Join'); + }); + }); + describe('Fn::Select JSON', function () { + it("should pass validation, with flat list and intrinsic list", function () { + var input = require('../../testData/valid/json/5_valid_intrinsic_select.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should pass validation with Parameter Collection", function () { + var input = require('../../testData/valid/json/5_valid_intrinsic_select_2.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if index is greater than list size", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_1.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf('First element of Fn::Select exceeds the length of the list.')).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if second element is not a list or a function", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_2.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select requires the second element to resolve to a list")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if first element is not a number or does not parse to a number", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_3.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("First element of Fn::Select must be a number, or it must use an intrinsic fuction that returns a number")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if first element is not defined or is null", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_4.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select first element cannot be null or undefined")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if only one element as argument list", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_5.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select only supports an array of two elements")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if second element is null or undefined", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_6.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select Second element cannot be null or undefined")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if second element does not resolve to a list", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_7.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select requires the second element to be a list, function call did not resolve to a list.")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if first element does not resolve to a number", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_8.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select's first argument did not resolve to a string for parsing or a numeric value.")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if first element attempts an invalid intrinsic function", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_9.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select does not support the Fn::Select function in argument 1")).to.be.greaterThan(-1); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if first element is anything other than non-array object, number or string", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_10.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit'][0]['message'].indexOf("Fn:Select's first argument must be a number or resolve to a number")).to.be.greaterThan(-1); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if second element attempts an invalid intrinsic function", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_11.json'); + var result = validator.validateJsonObject(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit'][0]['message'].indexOf("n::Select does not support the Fn::Select function in argument 2")).to.be.greaterThan(-1); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if second element contains a list with null values", function () { + var input = require('../../testData/invalid/json/5_invalid_intrinsic_select_12.json'); + var result = validator.validateJsonObject(input); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select requires that the list be free of null values")).to.be.greaterThan(-1); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + }); + describe('Fn::Select YAML', function () { + it('should validate in yaml with literal and intrinic elements in array', function () { + var input = './testData/valid/yaml/5_valid_intrinsic_select.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it('should validate in yaml with Comma Separated List Param', function () { + var input = './testData/valid/yaml/5_valid_intrinsic_select_2.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if index is greater than list size", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_1.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf('First element of Fn::Select exceeds the length of the list.')).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if second element is not a list or a function", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_2.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select requires the second element to resolve to a list")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if first element is not a number or does not parse to a number", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_3.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("First element of Fn::Select must be a number, or it must use an intrinsic fuction that returns a number")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if first element is not defined or is null", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_4.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select first element cannot be null or undefined")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if only one element as argument list", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_5.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select only supports an array of two elements")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if second element is null or undefined", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_6.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select Second element cannot be null or undefined")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if second element does not resolve to a list", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_7.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select requires the second element to be a list, function call did not resolve to a list.")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if first element does not resolve to a number", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_8.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select's first argument did not resolve to a string for parsing or a numeric value.")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if first element attempts an invalid intrinsic function", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_9.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select does not support the Fn::Select function in argument 1")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if first element is anything other than non-array object, number or string", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_10.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn:Select's first argument must be a number or resolve to a number")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if second element attempts an invalid intrinsic function", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_11.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("n::Select does not support the Fn::Select function in argument 2")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should error if second element contains a list with null values", function () { + var input = './testData/invalid/yaml/5_invalid_intrinsic_select_12.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message'].indexOf("Fn::Select requires that the list be free of null values")).to.be.greaterThan(-1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + }); + describe('Fn::Sub', function () { + it('3 valid Fn::Sub should return an object with validTemplate = true, 0 crit errors', function () { + var input = './testData/valid/yaml/valid_sub_operations.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('a sub referencing an invalid resource should result in validTemplate = false, 1 crit errors, no warnings', function () { + var input = 'testData/invalid/yaml/invalid_sub_reference.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it('a sub getatt an invalid resource should result in validTemplate = false, 2 crit errors, no warnings', function () { + var input = 'testData/invalid/yaml/invalid_sub_getatt.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(2); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + }); + describe('Fn::ImportValue', function () { + it('1 invalid Fn::ImportValue should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_import_value_intrinsic_function.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Fn::ImportValue does not support function'); + }); + it('1 invalid Fn::ImportValue should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_import_value_type.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Expecting an integer'); + }); + it('a valid Fn::ImportValue should return an object with validTemplate = true, 0 crit errors', function () { + var input = './testData/valid/yaml/valid_import_value.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + }); + describe('Fn::GetAtt', function () { + it('Fn::GetAtt for an arbitrary attribute on a custom resource should return a mock result', function () { + var input = 'testData/valid/yaml/valid_getatt_custom_resource.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.property('templateValid', true); + expect(validator.fnGetAtt('Custom', 'SomeAttribute')).to.equal('mockAttr_Custom_SomeAttribute'); + expect(validator.fnGetAtt('Custom2', 'SomeAttribute')).to.equal('mockAttr_Custom2_SomeAttribute'); + }); + it("should pass validation where !GetAtt returns a list", function () { + var input = 'testData/valid/yaml/issue-134-valid-fngetatt-returns-array.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should not pass validation where !GetAtt returns a list", function () { + var input = 'testData/valid/yaml/issue-134-invalid-fngetatt-returns-array.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should not pass validation with !GetAtt where attribute does not exist", function () { + var input = 'testData/valid/yaml/issue-134-invalid-fngetatt-att-does-not-exist.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(2); + expect(result['errors']['crit'][0]).to.have.property('message', 'No such attribute VeryLostNameServers on AWS::Route53::HostedZone'); + expect(result['errors']['crit'][0]).to.have.property('resource', 'Resources > DNSVPCDelegation > Properties > ResourceRecords'); + expect(result['errors']['crit'][0]).to.have.property('documentation', 'http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-route53-hostedzone.html'); + expect(result['errors']['crit'][1]).to.have.property('message', "Expecting a list, got 'INVALID_REFERENCE_OR_ATTR_ON_GET_ATT'"); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should pass validation where !GetAtt returns some unexpected attribute for AWS::CloudFormation::Stack", function () { + var input = 'testData/valid/yaml/issue-149-valid-fngetatt-aws_cloudformation_stack.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it("should not pass validation with !GetAtt where the resource does not exist", function () { + var input = 'testData/invalid/yaml/issue_51_missing_resource.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]).to.have.property('message', 'No resource with logical name of Database!'); + expect(result['errors']['crit'][0]).to.have.property('resource', 'Outputs > DBDNS > Value'); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + }); + describe('conditions', function () { + it('1 invalid if condition arguments should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_if_statement_arguments.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Fn::If must have 3 arguments'); + }); + it('1 invalid if condition should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_if_statement_condition.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Condition \'UseProdConditionnnnn\' must reference a valid condition'); + }); + it('1 invalid condition value should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_condition_value.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Condition does not allow function \'Ref\' here'); + }); + it('1 invalid condition value type should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_condition_value_type.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Condition should consist of an intrinsic function of type'); + }); + }); + describe('Fn::Split', function () { + it('should split a basic string', function () { + var input = { + 'Fn::Split': ['-', 'asdf-fdsa'] + }; + var result = validator.doInstrinsicSplit(input, 'Fn::Split'); + expect(result).to.deep.equal(['asdf', 'fdsa']); + }); + it('should split a string that doesn\'t contain the delimiter', function () { + var input = { + 'Fn::Split': ['-', 'asdffdsa'] + }; + var result = validator.doInstrinsicSplit(input, 'Fn::Split'); + expect(result).to.deep.equal(['asdffdsa']); + }); + it('should resolve an intrinsic function', function () { + var input = { + 'Fn::Split': ['-', { + 'Fn::Select': [1, ['0-0', '1-1', '2-2']] + }] + }; + var result = validator.doInstrinsicSplit(input, 'Fn::Split'); + expect(result).to.deep.equal(['1', '1']); + }); + it('should reject a parameter that is an object', function () { + var input = { + 'Fn::Split': {} + }; + var result = validator.doInstrinsicSplit(input, 'Fn::Split'); + expect(result).to.deep.equal(['INVALID_SPLIT']); + }); + it('should reject a parameter that is a string', function () { + var input = { + 'Fn::Split': 'split-me-plz' + }; + var result = validator.doInstrinsicSplit(input, 'Fn::Split'); + expect(result).to.deep.equal(['INVALID_SPLIT']); + }); + it('should reject a parameter that is an empty array', function () { + var input = { + 'Fn::Split': [] + }; + var result = validator.doInstrinsicSplit(input, 'Fn::Split'); + expect(result).to.deep.equal(['INVALID_SPLIT']); + }); + it('should reject a parameter that is a single length array', function () { + var input = { + 'Fn::Split': ['delim'] + }; + var result = validator.doInstrinsicSplit(input, 'Fn::Split'); + expect(result).to.deep.equal(['INVALID_SPLIT']); + }); + it('should reject a delimiter that isn\'t a string', function () { + var input = { + 'Fn::Split': [{}, 'asd-asd-asd'] + }; + var result = validator.doInstrinsicSplit(input, 'Fn::Split'); + expect(result).to.deep.equal(['INVALID_SPLIT']); + }); + describe('validator test', function () { + var result; + before(function () { + validator.resetValidator(); + var input = './testData/valid/yaml/split.yaml'; + result = validator.validateFile(input); + }); + it('should have no errors', function () { + console.dir(result['errors']); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('should resolve a simple split', function () { + expect(result['outputs']['Simple']).to.deep.equal(['asdf', 'fdsa']); + }); + it('should resolve a split of a join', function () { + expect(result['outputs']['Nested']).to.deep.equal(['asdf', 'fdsa_asdf', 'fdsa']); + }); + it('should resolve a select of a split', function () { + expect(result['outputs']['SelectASplit']).to.deep.equal('b'); + }); + }); + }); + describe('templateVersion', function () { + it('1 invalid template version should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_template_format_version.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('AWSTemplateFormatVersion should be'); + }); + // Check for optional template version + it('1 missing template version should return an object with validTemplate = true, 0 crit errors', function () { + var input = './testData/valid/yaml/valid_missing_template_format_version.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('1 unquouted template format version should return an object with validTemplate = true, no crit errors, 1 warn error', function () { + var input = 'testData/valid/yaml/valid_unquoted_template_version.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(1); + expect(result['errors']['warn'][0]['message']).to.contain('AWSTemplateFormatVersion is recommended to be of type string'); + }); + }); + describe('propertyValidation', function () { + it('1 invalid arn property should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_arn.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Expecting an ARN'); + }); + it('1 invalid property name of ResourceType should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_resourcetype_property_name.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('is not a valid property of'); + expect(result['errors']['crit'][0]['resource']).to.contain('Resources > Rule'); + }); + it('1 invalid property name of PropertyType should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_propertytype_property_name.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('S3Buckettttt is not a valid property of AWS::Lambda::Function.Code'); + }); + it('1 invalid property name of Tag list should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_ec2_tags_property_name.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Keyyyyy is not a valid property of'); + }); + it('1 string property should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_property_type_string.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(2); + expect(result['errors']['crit'][0]['message']).to.contain('Expecting a string'); + expect(result['errors']['crit'][1]['message']).to.contain('Expecting a string'); + }); + it('1 missing propertyType property should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_required_propertytype_prop_missing.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Required property Key missing for type Tag'); + }); + it('1 missing resourceType property should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_required_resourcetype_prop_missing.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Required property Runtime missing for type AWS::Lambda::Function'); + }); + it('1 missing (via AWS::NoValue) property should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_required_resourcetype_prop_no_value.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Required property Runtime missing for type AWS::Lambda::Function'); + }); + it('1 invalid boolean property should return an object with validTemplate = false, 1 crit errors', function () { + var input = './testData/invalid/yaml/invalid_boolean_type.yaml'; + validator.addParameterValue('CertificateArn', 'arn:aws:region:something'); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Expecting a Boolean, got \'trueeeee\''); + expect(result['errors']['crit'][0]['resource']).to.contain('Resources > CloudFrontDistribution > Properties > DistributionConfig > DefaultCacheBehavior > Compress'); + }); + it('4 invalid nested properties should return an object with validTemplate = false, 4 crit errors', function () { + var input = './testData/invalid/yaml/invalid_missing_nested_property.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(4); + expect(result['errors']['crit'][0]['message']).to.contain('Required property TargetOriginId missing for type AWS::CloudFront::Distribution.DefaultCacheBehavior'); + expect(result['errors']['crit'][0]['resource']).to.contain('Resources > CloudFrontDistribution > Properties > DistributionConfig > DefaultCacheBehavior'); + expect(result['errors']['crit'][1]['message']).to.contain('Required property Forward missing for type AWS::CloudFront::Distribution.Cookies'); + expect(result['errors']['crit'][1]['resource']).to.contain('Resources > CloudFrontDistribution > Properties > DistributionConfig > DefaultCacheBehavior > ForwardedValues > Cookies'); + expect(result['errors']['crit'][2]['message']).to.contain('Something is not a valid property of AWS::CloudFront::Distribution.Cookies'); + expect(result['errors']['crit'][2]['resource']).to.contain('Resources > CloudFrontDistribution > Properties > DistributionConfig > DefaultCacheBehavior > ForwardedValues > Cookies'); + expect(result['errors']['crit'][3]['message']).to.contain('Required property Bucket missing for type AWS::CloudFront::Distribution.Logging'); + expect(result['errors']['crit'][3]['resource']).to.contain('Resources > CloudFrontDistribution > Properties > DistributionConfig > Logging'); + }); + it('a valid template with a Map property should return an object with validTemplate = true, no crit errors', function () { + var input = 'testData/valid/yaml/maps.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('an invalid template with a Map property should return an object with validTemplate = false, 1 crit error', function () { + var input = 'testData/invalid/yaml/invalid_maps.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]['message']).to.contain('Expecting a string, got { not: \'a string\' }'); + expect(result['errors']['crit'][0]['resource']).to.contain('Resources > 0-ParameterGroupWithAMap > Properties > Parameters > key'); + }); + it('a valid (valid_timestamp.yaml) template with a Timestamp should return an objcet with validTemplate = true', function () { + var input = 'testData/valid/yaml/valid_timestamp.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('a (invalid_timestamp.yaml) template with an invalid Timestamp should return an objcet with validTemplate = false, 2 crit errors', function () { + var input = 'testData/invalid/yaml/invalid_timestamp.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(3); + expect(result['errors']['crit'][0]).to.have.property('message', 'Expecting an ISO8601-formatted string, got \'some random string\''); + expect(result['errors']['crit'][1]).to.have.property('message', 'Expecting an ISO8601-formatted string, got \'2017-08-08 00:08\''); + expect(result['errors']['crit'][2]).to.have.property('message', 'Expecting an ISO8601-formatted string, got 1502150400'); + }); + it('a valid template with APIG string results in validTemplate = true, 0 crit error', function () { + var input = 'testData/valid/yaml/issue-81-api-gateway.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + }); + describe('validateYamlFile', function () { + it('a valid (1.yaml) template should return an object with validTemplate = true, no crit errors', function () { + var input = 'testData/valid/yaml/1.yaml'; + validator.addParameterValue('InstanceType', 't1.micro'); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('a valid (2.yaml) template should return an object with validTemplate = true, no crit errors', function () { + var input = 'testData/valid/yaml/2.yaml'; + validator.addParameterValue('CertificateArn', 'arn:aws:region:something'); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + expect(result['errors']['info']).to.have.lengthOf(0); + }); + it('a valid (valid_minus_one_as_string.yaml) template should return an object with validTemplate = true, no crit errors', function () { + var input = 'testData/valid/yaml/valid_minus_one_as_string.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + }); + describe('issues', function () { + it('a valid ASG template with Tags property should return an object with validTemplate = true, no crit errors', function () { + var input = 'testData/valid/yaml/issue-24.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('both methods of defining a custom resource should result in validTemplate = true, no crit errors', function () { + var input = 'testData/valid/yaml/issue-28-custom-resource.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('numeric properties should result in validTemplate = true, no crit errors, no warn errors', function () { + var input = 'testData/valid/yaml/issue-27-numeric-properties.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it('IAM with ManagedPolicyName should result in validTemplate=true, no crit errors, no warn errors', function () { + var input = 'testData/valid/yaml/issue-42-managed-policy-name.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('Reference to RDS attribute validTemplate=true, no crit errors, no warn errors', function () { + var input = 'testData/valid/yaml/issue-44-database-endpoint.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('if condition not working as expected, no crit errors, no warn errors', function () { + var input = 'testData/valid/yaml/issue-61.yaml'; + validator.addParameterValue('Env', 'Production'); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('if condition not working as expected, 2 crit errors, no warn errors', function () { + var input = 'testData/valid/yaml/issue-61.yaml'; + validator.addParameterValue('Env', 'Dev'); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(2); + expect(result['errors']['crit'][0]).to.have.property('message', 'Required property FunctionName missing for type AWS::Lambda::Version'); + expect(result['errors']['crit'][1]).to.have.property('message', 'Required property FunctionName missing for type AWS::Lambda::Version'); + }); + it('a list of an extended parameter type should be properly mocked without causing an exception', function () { + var input = 'testData/valid/yaml/issue-94-list-security-group.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('a null property value should not cause an exception', function () { + var input = 'testData/invalid/yaml/null_value.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]).to.have.property('message', 'Expecting a list, got null'); + }); + }); + describe('parameters-validation', function () { + it('an unallowed parameter value provided at runtime gets rejected', function () { + var input = 'testData/valid/yaml/parameters-allowed-values.yaml'; + validator.addParameterValue('Env', 'InvalidValue'); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + }); + it('an allowed parameter value provided at runtime gets allowed', function () { + var input = 'testData/valid/yaml/parameters-allowed-values.yaml'; + validator.addParameterValue('Env', 'Dev'); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('an empty parameter value provided at runtime picks up the empty default (which will throw an error)', function () { + var input = 'testData/valid/yaml/parameters-allowed-values.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]).to.has.property('message', 'Parameter value \'\' for Env is not within the parameters AllowedValues'); + }); + it('missing parameters should cause an error when guessParameters is set', function () { + var input = 'testData/valid/yaml/parameters.yaml'; + var result = validator.validateFile(input, { guessParameters: [] }); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]).to.has.property('message', 'Value for parameter was not provided'); + }); + it('parameters in guessParameters should be permitted to be guessed', function () { + var input = 'testData/valid/yaml/parameters.yaml'; + var result = validator.validateFile(input, { guessParameters: ['Env'] }); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['info']).to.have.lengthOf(0); + }); + it('List should return a list', function () { + var input = './testData/valid/yaml/parameters_type_list_aws_ec2_availabilityzone_name.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['info']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('List should return a list', function () { + var input = './testData/valid/yaml/parameters_type_list_aws_ec2_image_id.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['info']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('List should return a list', function () { + var input = './testData/valid/yaml/parameters_type_list_aws_ec2_instance_id.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['info']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('List should return a list', function () { + var input = './testData/valid/yaml/parameters_type_list_aws_ec2_securitygroup_groupname.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['info']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('List should return a list', function () { + var input = './testData/valid/yaml/parameters_type_list_aws_ec2_securitygroup_id.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['info']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('List should return a list', function () { + var input = './testData/valid/yaml/parameters_type_list_aws_ec2_subnet_id.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['info']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('List should return a list', function () { + var input = './testData/valid/yaml/parameters_type_list_aws_ec2_volume_id.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['info']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('List should return a list', function () { + var input = './testData/valid/yaml/parameters_type_list_aws_ec2_vpc_id.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['info']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + it('List should return a list', function () { + var input = './testData/valid/yaml/parameters_type_list_aws_route53_hostedzone_id.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['info']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + expect(result['errors']['crit']).to.have.lengthOf(0); + }); + }); + describe('pseudo-parmeters', function () { + it('defining an override for accountId should result in validTemplate = true, no crit errors, no warnings', function () { + var input = 'testData/valid/yaml/pseudo-parameters.yaml'; + validator.addPseudoValue("AWS::AccountId", "000000000000"); + validator.addPseudoValue("AWS::Region", "us-east-1"); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + }); + describe('custom-resource-attributes', function () { + it('should validate using custom resource attribute values for generic and custom types', function () { + var input = 'testData/valid/yaml/valid_custom_resource_attributes.yaml'; + validator.addCustomResourceAttributeValue('Custom::Dooby', 'SomeAttribute', 'test'); + validator.addCustomResourceAttributeValue('AWS::CloudFormation::CustomResource', 'SomeAttribute', [1, 2, 3]); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it('should validate using custom resource attribute values for logical-names', function () { + var input = 'testData/valid/yaml/valid_custom_resource_attributes.yaml'; + validator.addCustomResourceAttributeValue('Custom', 'SomeAttribute', 'test'); + validator.addCustomResourceAttributeValue('Custom2', 'SomeAttribute', [1, 2, 3]); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it('should validate using custom resource attribute values for generic-type and logical-name', function () { + var input = 'testData/valid/yaml/valid_custom_resource_attributes.yaml'; + validator.addCustomResourceAttributeValue('Custom', 'SomeAttribute', 'test'); + validator.addCustomResourceAttributeValue('AWS::CloudFormation::CustomResource', 'SomeAttribute', [1, 2, 3]); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it('should validate using custom resource attribute values for custom-type and logical-name', function () { + var input = 'testData/valid/yaml/valid_custom_resource_attributes.yaml'; + validator.addCustomResourceAttributeValue('Custom::Dooby', 'SomeAttribute', 'test'); + validator.addCustomResourceAttributeValue('Custom2', 'SomeAttribute', [1, 2, 3]); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it('should validate when a logical-name overrides a resource-type custom attribute value', function () { + var input = 'testData/valid/yaml/valid_custom_resource_attributes.yaml'; + validator.addCustomResourceAttributeValue('Custom::Dooby', 'SomeAttribute', [1, 2, 3]); + validator.addCustomResourceAttributeValue('AWS::CloudFormation::CustomResource', 'SomeAttribute', [1, 2, 3]); + validator.addCustomResourceAttributeValue('Custom', 'SomeAttribute', 'test'); + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + }); + describe('output-references', function () { + it('an output referencing an invalid resource should result in validTemplate = false, 1 crit errors, no warnings', function () { + var input = 'testData/invalid/yaml/issue-39-output-reference-invalid.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(3); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + it('an output referencing an valid resource should result in validTemplate = true, 0 crit errors, no warnings', function () { + var input = 'testData/valid/yaml/issue-39-output-reference-check.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', true); + expect(result['errors']['crit']).to.have.lengthOf(0); + expect(result['errors']['warn']).to.have.lengthOf(0); + }); + describe('a template with an output referencing a resource and a resource attribute', function () { + var result; + var input = 'testData/valid/yaml/outputs.yaml'; + result = validator.validateFile(input); + it('should result in a valid template', function () { + expect(result).to.have.deep.property('templateValid', true); + }); + it('should populate errorObject outputs correctly', function () { + expect(Object.keys(result['outputs'])).to.have.lengthOf(2); + expect(result['outputs']['Bucket']).to.equal('mock-ref-Bucket'); + expect(result['outputs']['BucketArn']).to.match(/^arn:aws:/); + }); + it('should populate errorObject exports correctly', function () { + expect(Object.keys(result['exports'])).to.have.lengthOf(1); + expect(result['exports']['my-global-bucket-export']).to.match(/^arn:aws:/); + }); + }); + it('a template with an exported output missing a Name should result in validTemplate = false, 1 crit error', function () { + var input = 'testData/invalid/yaml/invalid_outputs.yaml'; + var result = validator.validateFile(input); + expect(result).to.have.deep.property('templateValid', false); + expect(result['errors']['crit']).to.have.lengthOf(1); + expect(result['errors']['crit'][0]).to.have.property('message', 'Output BucketArn exported with no Name'); + expect(result['errors']['crit'][0]).to.have.property('resource', 'Outputs > BucketArn'); + }); + }); + describe('type checking coverage', function () { + it('should be able to determine the type of every property of every resource', function () { + var _loop_1 = function (resourceName) { + var resource = awsData_1.awsResources.ResourceTypes[resourceName]; + var _loop_2 = function (propertyName) { + expect(function () { return validator.getPropertyType({ + 'type': 'PROPERTY', + resourceType: resourceName, + parentType: resourceName, + propertyName: propertyName + }); }).not.to.throw(); + }; + for (var propertyName in resource.Properties) { + _loop_2(propertyName); + } + }; + for (var resourceName in awsData_1.awsResources.ResourceTypes) { + _loop_1(resourceName); + } + }); + it('should be able to determine the type of every property of every propertytype', function () { + var _loop_3 = function (propertyTypeName) { + var propertyType = awsData_1.awsResources.PropertyTypes[propertyTypeName]; + var _loop_4 = function (propertyName) { + expect(function () { return validator.getPropertyType({ + 'type': 'PROPERTY', + resourceType: 'TEST', + parentType: propertyTypeName, + propertyName: propertyName + }); }).not.to.throw(); + }; + for (var propertyName in propertyType.Properties) { + _loop_4(propertyName); + } + }; + for (var propertyTypeName in awsData_1.awsResources.PropertyTypes) { + _loop_3(propertyTypeName); + } + }); + }); + describe('type checking unit tests', function () { + function runTests(checkFunction, valid, invalid) { + var _loop_5 = function (validValue) { + it(util.inspect(validValue) + " should be valid", function () { + expect(checkFunction(validValue)).to.be.true; + }); + }; + try { + for (var valid_1 = __values(valid), valid_1_1 = valid_1.next(); !valid_1_1.done; valid_1_1 = valid_1.next()) { + var validValue = valid_1_1.value; + _loop_5(validValue); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (valid_1_1 && !valid_1_1.done && (_a = valid_1.return)) _a.call(valid_1); + } + finally { if (e_1) throw e_1.error; } + } + ; + var _loop_6 = function (invalidValue) { + it(util.inspect(invalidValue) + " should be invalid", function () { + expect(checkFunction(invalidValue)).to.be.false; + }); + }; + try { + for (var invalid_1 = __values(invalid), invalid_1_1 = invalid_1.next(); !invalid_1_1.done; invalid_1_1 = invalid_1.next()) { + var invalidValue = invalid_1_1.value; + _loop_6(invalidValue); + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (invalid_1_1 && !invalid_1_1.done && (_b = invalid_1.return)) _b.call(invalid_1); + } + finally { if (e_2) throw e_2.error; } + } + ; + var e_1, _a, e_2, _b; + } + describe('isObject', function () { + var validObjects = [ + {}, + JSON.parse("{}"), + yaml.safeLoad("{}") + ]; + var invalidObjects = [ + 'string', + ['array'], + 42, + ]; + // not checked: the pathlogical primitive wrapper objects (new Number()) etc. They will + // return True if checked by isObject when arguably they should be False. + // However in practice these are never used in this project. + runTests(validator.isObject, validObjects, invalidObjects); + }); + describe('isList', function () { + var validLists = [ + ['a', 'b'], + JSON.parse("[42]"), + ]; + var invalidLists = [ + 'string', + 42, + {} + ]; + runTests(validator.isList, validLists, invalidLists); + }); + describe('isArn', function () { + var validArns = [ + 'arn:aws:region:something', + 'arn:aws::::' + ]; + var invalidArns = [ + 'notarn:aws:region:something', + 'not even close', + 42, + {}, + ['arn:aws:region:something'] + ]; + runTests(validator.isArn, validArns, invalidArns); + }); + describe('isString', function () { + var validStrings = [ + 'string', + 42 // because CloudFormation. e.g. Route53.Recordset.TTL is "String" but accepts an integer. + // http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html#cfn-route53-recordset-ttl + ]; + var invalidStrings = [ + ['asd'], + {}, + ]; + runTests(validator.isString, validStrings, invalidStrings); + }); + describe('isInteger', function () { + var validIntegers = [ + 123, + '123', + '-123', + '0', + '-0', + '00', + ]; + var invalidIntegers = [ + 123.32, + '123.32', + '-123.32', + '123asdf', + 'not even close' + ]; + runTests(validator.isInteger, validIntegers, invalidIntegers); + }); + describe('isDouble', function () { + var validDoubles = [ + 123, + 123.123, + '123.123', + '0', + '0.0', + '-123.0', + '-123' + ]; + var invalidDoubles = [ + '123.32asdf', + 'not even close', + '123.123.123' + ]; + runTests(validator.isDouble, validDoubles, invalidDoubles); + }); + describe('isBoolean', function () { + var validBooleans = [ + true, + false, + 'TrUe', + 'FaLse', + 'true', + 'false' + ]; + var invalidBooleans = [ + 'true1', + 'y', + 1, + 0, + ]; + runTests(validator.isBoolean, validBooleans, invalidBooleans); + }); + describe('isJson', function () { + var validJson = [ + {}, + { obj: { with: 'values' } }, + // these are accepted for some PrimitiveType: Json (e.g. IAM Policies, EMR::SecurityConfiguration), + // but rejected for others, e.g. RDS cluster parameters. Yay cfn. Erring on the side of + // accepting them here. + JSON.stringify({}), + JSON.stringify({ obj: { with: 'values' } }), + ]; + var invalidJson = [ + [], + 'string', + JSON.stringify([]), + JSON.stringify('string') + ]; + runTests(validator.isJson, validJson, invalidJson); + }); + describe('isTimestamp', function () { + var validTimestamps = [ + '2012-12-30', + '2012-12-30T20:10', + '2012-12-30T20:12Z', + '2012-12-30T20:12:22', + '2012-12-30T20:12:22+01:00', + // valid ISO8601 but invalid Javascript date string (Date.parse -> NaN). + // Cloudformation does actually accept this format but + // it will be a huge pain for us to support. + // '2012-12-30T20:12:22+01', + '2012-12-30T20:12:22+0100', + '2012-12-30T20:12:22-05:00', + '2012-12-30T20:12:22.222', + '2012-12-30T20:12:22.222Z', + '2012-12-30T20:12:22.222222' + ]; + var invalidTimestamps = [ + '2012', + '2012-12', + '2012-12-30T', + '2012-12-30T10', + '2012-12-30T20:12:22+1', + '2012-12-30T20:12:22+100', + ]; + runTests(validator.isTimestamp, validTimestamps, invalidTimestamps); + }); + }); +}); +//# sourceMappingURL=validatorTest.js.map \ No newline at end of file diff --git a/lib/test/validatorTest.js.map b/lib/test/validatorTest.js.map new file mode 100644 index 0000000..fc187a0 --- /dev/null +++ b/lib/test/validatorTest.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validatorTest.js","sourceRoot":"","sources":["../../src/test/validatorTest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2BAA8B;AAC9B,IAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAC3B,IAAM,MAAM,GAAG,IAAI,CAAC,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AG;gBAChB,EAAE;gBACF,QAAQ;gBACR,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;gBAClB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;aAC3B,CAAC;YAEF,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;QAGvD,CAAC,CAAC,CAAA;QAEF,QAAQ,CAAC,aAAa,EAAE;YACpB,IAAM,eAAe,GAAG;gBACpB,YAAY;gBACZ,kBAAkB;gBAClB,mBAAmB;gBACnB,qBAAqB;gBACrB,2BAA2B;gBAC3B,wEAAwE;gBACxE,sDAAsD;gBACtD,4CAA4C;gBAC5C,4BAA4B;gBAC5B,0BAA0B;gBAC1B,2BAA2B;gBAC3B,yBAAyB;gBACzB,0BAA0B;gBAC1B,4BAA4B;aAC/B,CAAC;YAGF,IAAM,iBAAiB,GAAG;gBACtB,MAAM;gBACN,SAAS;gBACT,aAAa;gBACb,eAAe;gBACf,uBAAuB;gBACvB,yBAAyB;aAC5B,CAAC;YAEF,QAAQ,CAAC,SAAS,CAAC,WAAW,EAAE,eAAe,EAAE,iBAAiB,CAAC,CAAC;QAExE,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/test/yamlSchema.d.ts b/lib/test/yamlSchema.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/lib/test/yamlSchema.js b/lib/test/yamlSchema.js new file mode 100644 index 0000000..4922d37 --- /dev/null +++ b/lib/test/yamlSchema.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var yamlSchema_1 = require("../yamlSchema"), yamlSchema = yamlSchema_1; +var yaml = require("js-yaml"); +var assert = require("assert"); +describe('yamlSchema', function () { + describe('buildYamlSchema', function () { + it('should build a yaml schema', function () { + assert(yamlSchema_1.default() instanceof yaml.Schema, 'yamlSchema didn\'t return a yaml schema'); + }); + }); + describe('functionTag', function () { + it('should work on a Fn::Thing', function () { + assert.strictEqual(yamlSchema.functionTag('Fn::Name'), 'Name'); + }); + it('should work on a Thing', function () { + assert.strictEqual(yamlSchema.functionTag('Name'), 'Name'); + }); + }); + describe('buildYamlType', function () { + it('should return a type that builds the JSON representation of the yaml tag', function () { + var type = yamlSchema.buildYamlType('Fn::Join', 'sequence'); + var input = ['asdf', 'asdf']; + var representation = type.construct(input); + assert.deepStrictEqual(representation, { 'Fn::Join': ['asdf', 'asdf'] }); + }); + it('should special-case Fn::GetAtt', function () { + var type = yamlSchema.buildYamlType('Fn::GetAtt', 'scalar'); + var input = 'Resource.Attribute'; + var representation = type.construct(input); + assert.deepStrictEqual(representation, { 'Fn::GetAtt': ['Resource', 'Attribute'] }); + }); + }); +}); +//# sourceMappingURL=yamlSchema.js.map \ No newline at end of file diff --git a/lib/test/yamlSchema.js.map b/lib/test/yamlSchema.js.map new file mode 100644 index 0000000..198d7af --- /dev/null +++ b/lib/test/yamlSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"yamlSchema.js","sourceRoot":"","sources":["../../src/test/yamlSchema.ts"],"names":[],"mappings":";;AAAA,uEAA6D;AAC7D,8BAAiC;AACjC,+BAAkC;AAElC,QAAQ,CAAC,YAAY,EAAE;IACnB,QAAQ,CAAC,iBAAiB,EAAE;QACxB,EAAE,CAAC,4BAA4B,EAAE;YAC7B,MAAM,CAAC,oBAAe,EAAE,YAAY,IAAI,CAAC,MAAM,EAAE,yCAAyC,CAAC,CAAC;QAChG,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,aAAa,EAAE;QACpB,EAAE,CAAC,4BAA4B,EAAE;YAC7B,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,CAAC;QACnE,CAAC,CAAC,CAAA;QACF,EAAE,CAAC,wBAAwB,EAAE;YACzB,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;QAC/D,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,eAAe,EAAE;QACtB,EAAE,CAAC,0EAA0E,EAAE;YAC3E,IAAM,IAAI,GAAG,UAAU,CAAC,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;YAC9D,IAAM,KAAK,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC/B,IAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC7C,MAAM,CAAC,eAAe,CAAC,cAAc,EAAE,EAAC,UAAU,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAC,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gCAAgC,EAAE;YACjC,IAAM,IAAI,GAAG,UAAU,CAAC,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;YAC9D,IAAM,KAAK,GAAG,oBAAoB,CAAC;YACnC,IAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC7C,MAAM,CAAC,eAAe,CAAC,cAAc,EAAE,EAAC,YAAY,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC,EAAC,CAAC,CAAC;QACtF,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AAGN,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/lib/util/CustomError.d.ts b/lib/util/CustomError.d.ts new file mode 100644 index 0000000..24ba6fb --- /dev/null +++ b/lib/util/CustomError.d.ts @@ -0,0 +1,13 @@ +/// +declare const _default: { + new (message: string): { + name: string; + message: string; + stack?: string | undefined; + }; + fixErrorInheritance(e: Error, constructor: Function): void; + captureStackTrace(targetObject: Object, constructorOpt?: Function | undefined): void; + prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined; + stackTraceLimit: number; +}; +export = _default; diff --git a/lib/util/CustomError.js b/lib/util/CustomError.js new file mode 100644 index 0000000..ada7272 --- /dev/null +++ b/lib/util/CustomError.js @@ -0,0 +1,26 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +module.exports = /** @class */ (function (_super) { + __extends(CustomError, _super); + function CustomError(message) { + var _this = _super.call(this, message) || this; + Error.captureStackTrace(_this, _this.constructor); + return _this; + } + // https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work + // safe to remove when targeting es6 + CustomError.fixErrorInheritance = function (e, constructor) { + e.__proto__ = constructor.prototype; + }; + return CustomError; +}(Error)); +//# sourceMappingURL=CustomError.js.map \ No newline at end of file diff --git a/lib/util/CustomError.js.map b/lib/util/CustomError.js.map new file mode 100644 index 0000000..af2d431 --- /dev/null +++ b/lib/util/CustomError.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CustomError.js","sourceRoot":"","sources":["../../src/util/CustomError.ts"],"names":[],"mappings":";;;;;;;;;;;AAGA;IAAmC,+BAAK;IACtC,qBAAY,OAAe;QAA3B,YACE,kBAAM,OAAO,CAAC,SAEf;QADC,KAAK,CAAC,iBAAiB,CAAC,KAAI,EAAE,KAAI,CAAC,WAAW,CAAC,CAAC;;IAClD,CAAC;IAED,+IAA+I;IAC/I,oCAAoC;IAC7B,+BAAmB,GAA1B,UAA2B,CAAQ,EAAE,WAAqB;QACvD,CAAS,CAAC,SAAS,GAAG,WAAW,CAAC,SAAS,CAAC;IAC/C,CAAC;IACH,kBAAC;AAAD,CAAC,AAXQ,CAA0B,KAAK,GAWvC"} \ No newline at end of file diff --git a/lib/util/polyfills.d.ts b/lib/util/polyfills.d.ts new file mode 100644 index 0000000..e69de29 diff --git a/lib/util/polyfills.js b/lib/util/polyfills.js new file mode 100644 index 0000000..6e73503 --- /dev/null +++ b/lib/util/polyfills.js @@ -0,0 +1,6 @@ +"use strict"; +require('core-js/fn/string/raw'); +require('core-js/fn/object/assign'); +require('core-js/fn/array/entries'); +Buffer = require('safe-buffer').Buffer; +//# sourceMappingURL=polyfills.js.map \ No newline at end of file diff --git a/lib/util/polyfills.js.map b/lib/util/polyfills.js.map new file mode 100644 index 0000000..206515d --- /dev/null +++ b/lib/util/polyfills.js.map @@ -0,0 +1 @@ +{"version":3,"file":"polyfills.js","sourceRoot":"","sources":["../../src/util/polyfills.ts"],"names":[],"mappings":";AAAA,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACjC,OAAO,CAAC,0BAA0B,CAAC,CAAC;AACpC,OAAO,CAAC,0BAA0B,CAAC,CAAC;AACpC,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC"} \ No newline at end of file diff --git a/lib/validator.d.ts b/lib/validator.d.ts new file mode 100644 index 0000000..05f5d5b --- /dev/null +++ b/lib/validator.d.ts @@ -0,0 +1,82 @@ +export declare type ParameterValue = string | string[]; +export interface ErrorRecord { + message: string; + resource: string; + documentation: string; +} +export interface ErrorObject { + templateValid: boolean; + errors: { + crit: ErrorRecord[]; + warn: ErrorRecord[]; + info: ErrorRecord[]; + }; + outputs: { + [outputName: string]: string; + }; + exports: { + [outputName: string]: string; + }; +} +export declare function resetValidator(): void; +export interface ValidateOptions { + /** + * List of parameters for which guessing is allowed. + * undefined implies all parameters can be guessed. + */ + guessParameters: string[] | undefined; +} +export declare function validateFile(path: string, options?: Partial): ErrorObject; +export declare function validateJsonObject(obj: any, options?: Partial): ErrorObject; +export declare function addParameterValue(parameter: string, value: ParameterValue): void; +export declare function addPseudoValue(parameter: string, value: string): void; +export declare function addCustomResourceAttributeValue(resource: string, attribute: string, value: any): void; +export declare function doInstrinsicSplit(ref: any, key: string): string[]; +export declare function fnGetAtt(reference: string, attributeName: string): any; +export interface ResourceType { + type: 'RESOURCE'; + resourceType: string; +} +export interface NamedProperty { + type: 'PROPERTY'; + resourceType: string; + parentType: string; + propertyName: string; +} +export interface PropertyType { + type: 'PROPERTY_TYPE'; + propertyType: string; + resourceType: string; +} +export interface PrimitiveType { + type: 'PRIMITIVE_TYPE'; + resourceType: string; + primitiveType: string; +} +export declare type ObjectType = ResourceType | NamedProperty | PropertyType | PrimitiveType; +export declare enum KnownTypes { + ComplexObject = 0, + List = 1, + Map = 2, + Arn = 3, + String = 4, + Integer = 5, + Boolean = 6, + Json = 7, + Double = 8, + Timestamp = 9, +} +export declare function getPropertyType(objectType: NamedProperty | PrimitiveType): KnownTypes; +export interface VerificationFunction { + (o: any): boolean; + failureMessage: string; +} +export declare const isList: VerificationFunction; +export declare const isObject: VerificationFunction; +export declare const isString: VerificationFunction; +export declare const isArn: VerificationFunction; +export declare const isInteger: VerificationFunction; +export declare const isDouble: VerificationFunction; +export declare const isBoolean: VerificationFunction; +export declare const isJson: VerificationFunction; +export declare const isTimestamp: VerificationFunction; diff --git a/lib/validator.js b/lib/validator.js new file mode 100644 index 0000000..b7bf3d2 --- /dev/null +++ b/lib/validator.js @@ -0,0 +1,1633 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; +var __values = (this && this.__values) || function (o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +}; +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var workingInput = null; +var stopValidation = false; +var resourcesSpec = require("./resourcesSpec"); +var logger = require("./logger"); +var parser = require("./parser"); +var mockArnPrefix = "arn:aws:mock:region:123456789012:"; +var awsData_1 = require("./awsData"); +var docs = require("./docs"); +var util = require("util"); +var CustomError = require("./util/CustomError"); +var sms = require("source-map-support"); +sms.install(); +var mergeOptions = require('merge-options'); +require('./util/polyfills'); +var parameterRuntimeOverride = {}; +var errorObject = { + "templateValid": true, + "errors": { + "info": [], + "warn": [], + "crit": [] + }, + "outputs": {}, + "exports": {} +}; +function resetValidator() { + errorObject = { "templateValid": true, "errors": { "info": [], "warn": [], "crit": [] }, outputs: {}, exports: {} }; + stopValidation = false; + parameterRuntimeOverride = {}; +} +exports.resetValidator = resetValidator; +; +var defaultValidateOptions = { + guessParameters: undefined +}; +function validateFile(path, options) { + // Convert to object, this will throw an exception on an error + workingInput = parser.openFile(path); + // Let's go! + return validateWorkingInput(options); +} +exports.validateFile = validateFile; +; +function validateJsonObject(obj, options) { + workingInput = obj; + return validateWorkingInput(options); +} +exports.validateJsonObject = validateJsonObject; +; +function addParameterValue(parameter, value) { + addParameterOverride(parameter, value); +} +exports.addParameterValue = addParameterValue; +; +function addPseudoValue(parameter, value) { + // Silently drop requests to change AWS::NoValue + if (parameter == 'AWS::NoValue') { + return; + } + // Only process items which are already defined in overrides + if (parameter in awsData_1.awsRefOverrides) { + // Put NotificationARNs in an array if required + if (parameter == 'AWS::NotificationARNs') { + if (awsData_1.awsRefOverrides['AWS::NotificationARNs'][0] == 'arn:aws:sns:us-east-1:123456789012:MyTopic') { + awsData_1.awsRefOverrides['AWS::NotificationARNs'][0] = value; + } + else { + awsData_1.awsRefOverrides['AWS::NotificationARNs'].push(value); + } + } + else { + // By default, replace the value + awsData_1.awsRefOverrides[parameter] = value; + } + } + else { + addError('crit', parameter + " is not an allowed pseudo parameter", ['cli-options'], 'pseudo parameters'); + } +} +exports.addPseudoValue = addPseudoValue; +; +function addCustomResourceAttributeValue(resource, attribute, value) { + var attrType = determineValueType(value); + var oldSpec = {}; + var newSpec = { + 'Attributes': (_a = {}, + _a[attribute] = { + PrimitiveType: attrType, + Value: value + }, + _a) + }; + // extend defintion for existing resource type + if (!!~resource.indexOf('::')) { + try { + oldSpec = resourcesSpec.getResourceType(resource); + } + catch (e) { } + newSpec = mergeOptions(oldSpec, newSpec); + } + resourcesSpec.extendSpecification({ + 'ResourceTypes': (_b = {}, _b[resource] = newSpec, _b) + }); + var _a, _b; +} +exports.addCustomResourceAttributeValue = addCustomResourceAttributeValue; +; +function determineValueType(val) { + // check descendants of object + if (val instanceof Object) { + if (Array.isArray(val)) { + return 'List'; + } + if (val instanceof Map) { + return 'Map'; + } + return 'ComplexObject'; + } + // check primitives + switch (typeof val) { + case 'string': + try { + JSON.parse(val); + return 'Json'; + } + catch (e) { } + if (!!Date.parse(val)) { + return 'Timestamp'; + } + if (RegExp(/arn:/i).test(val)) { + return 'Arn'; + } + return 'String'; + case 'number': + return (val % 1 == 0) ? 'Integer' : 'Double'; + case 'boolean': + return 'Boolean'; + } + throw new Error('Invalid KnownType!'); +} +function addParameterOverride(parameter, value) { + parameterRuntimeOverride[parameter] = value; +} +function validateWorkingInput(passedOptions) { + // Ensure we are working from a clean slate + //exports.resetValidator(); + var options = Object.assign({}, defaultValidateOptions, passedOptions); + // Check AWS Template Format Version + if (workingInput.hasOwnProperty(['AWSTemplateFormatVersion'])) { + var testValue = workingInput['AWSTemplateFormatVersion']; + if (typeof workingInput['AWSTemplateFormatVersion'] == 'object') { + addError('warn', 'AWSTemplateFormatVersion is recommended to be of type string \'2010-09-09\'', ['AWSTemplateFormatVersion'], 'AWSTemplateFormatVersion'); + testValue = testValue.toUTCString(); + } + var allowedDateRegex = /^Thu, 09 Sep 2010 00:00:00 GMT$|^2010-09-09$/; + if (!allowedDateRegex.test(testValue)) { + addError('crit', 'AWSTemplateFormatVersion should be \'2010-09-09\'', ['AWSTemplateFormatVersion'], 'AWSTemplateFormatVersion'); + } + } + // TODO: Check keys for parameter are valid, ex. MinValue/MaxValue + // Check parameters and assign outputs + assignParametersOutput(options.guessParameters); + // Evaluate Conditions + assignConditionsOutputs(); + // Apply resource specification overrides + assignCustomResources(); + // Assign outputs to all the resources + assignResourcesOutputs(); + if (stopValidation) { + // Stop the validation early, we can't join stuff if we don't know what to expect + if (process.env.DEBUG) { + logger.error("Stopping validation early as a resource type is invalid."); + } + return errorObject; + } + // Use the outputs assigned to resources to resolve references + resolveReferences(); + // Go through the hopefully resolved properties of each resource + checkResourceProperties(); + // Assign template outputs to the error object + collectOutputs(); + return errorObject; +} +function assignParametersOutput(guessParameters) { + if (!workingInput.hasOwnProperty('Parameters')) { + return false; // This isn't an issue + } + var guessAll = (guessParameters === undefined); + var guessParametersSet = new Set(guessParameters || []); + var _loop_1 = function (parameterName) { + var parameter = workingInput['Parameters'][parameterName]; + if (!parameter.hasOwnProperty('Type')) { + // We are going to assume type if a string to continue validation, but will throw a critical + addError('crit', "Parameter " + parameterName + " does not have a Type defined.", ['Parameters', parameterName], "Parameters"); + parameter['Type'] = 'String'; + } + // if the user hasn't specified any parameters to mock, assume all are ok; otherwise, + // only mock the allowed ones. + var okToGuess = (guessAll) || (guessParametersSet.has(parameterName)); + var parameterValue = inferParameterValue(parameterName, parameter, okToGuess); + if (parameter.hasOwnProperty('AllowedValues') && parameter['AllowedValues'].indexOf(parameterValue) < 0) { + addError('crit', "Parameter value '" + parameterValue + "' for " + parameterName + " is" + + " not within the parameters AllowedValues", ['Parameters', parameterName], "Parameters"); + } + if (parameter['Type'] === "CommaDelimitedList" && typeof parameterValue === 'string') { + parameterValue = parameterValue.split(',').map(function (x) { return x.trim(); }); + parameterValue.forEach(function (val) { + if (val === "") { + addError('crit', "Parameter " + parameterName + " contains a CommaDelimitedList where the number of commas appears to be equal or greater than the list of items.", ['Parameters', parameterName], "Parameters"); + } + }); + } + // The List parameter value is inferred as string with comma delimited values and must be converted to array + var listParameterTypesSpec = Object.keys(awsData_1.awsParameterTypes).filter(function (x) { return !!x.match(/List<.*>/); }); + if (!!~listParameterTypesSpec.indexOf(parameter['Type']) && (typeof parameterValue === 'string')) { + parameterValue = parameterValue.split(',').map(function (x) { return x.trim(); }); + parameterValue.forEach(function (val) { + if (val === "") { + addError('crit', "Parameter " + parameterName + " contains a List<" + parameter['Type'] + "> where the number of commas appears to be equal or greater than the list of items.", ['Parameters', parameterName], "Parameters"); + } + }); + } + // Assign an Attribute Ref regardless of any failures above + workingInput['Parameters'][parameterName]['Attributes'] = {}; + workingInput['Parameters'][parameterName]['Attributes']['Ref'] = parameterValue; + }; + // For through each parameter + for (var parameterName in workingInput['Parameters']) { + _loop_1(parameterName); + } +} +function inferParameterValue(parameterName, parameter, okToGuess) { + var parameterDefaultsByType = { + 'string': "string_input_" + parameterName, + 'array': undefined, + 'number': '42' + }; + // Check if the Ref for the parameter has been defined at runtime + var parameterOverride = parameterRuntimeOverride[parameterName]; + if (parameterOverride !== undefined) { + // Check the parameter provided at runtime is within the allowed property list (if specified) + return parameterOverride; + } + else if (parameter.hasOwnProperty('Default')) { + // See if Default property is present and populate + return parameter['Default']; + } + else { + if (!okToGuess) { + addError('crit', 'Value for parameter was not provided', ['Parameters', parameterName], 'Parameters'); + } + if (parameter.hasOwnProperty('AllowedValues') && parameter['AllowedValues'].length > 0) { + // See if AllowedValues has been specified + return parameter['AllowedValues'][0]; + } + else { + var rawParameterType = parameter['Type']; + var listMatch = /^List<(.+)>$/.exec(rawParameterType); + var isList_1; + var parameterType = void 0; + if (listMatch) { + isList_1 = true; + parameterType = listMatch[1]; + } + else { + parameterType = rawParameterType; + isList_1 = false; + } + if (!awsData_1.awsParameterTypes.hasOwnProperty(parameterType)) { + addError('crit', "Parameter " + parameterName + " has an invalid type of " + rawParameterType + ".", ['Parameters', parameterName], "Parameters"); + parameterType = 'String'; + } + var normalizedType = awsData_1.awsParameterTypes[parameterType]; + if (normalizedType == 'array') { + isList_1 = true; + parameterType = 'String'; + normalizedType = 'string'; + } + var parameterDefault = parameterDefaultsByType[awsData_1.awsParameterTypes[parameterType]]; + if (isList_1) { + return [parameterDefault]; + } + else { + return parameterDefault; + } + } + } +} +function addError(severity, message, resourceStack, help) { + if (resourceStack === void 0) { resourceStack = []; } + var obj = { + 'message': message, + 'resource': resourceStack.join(' > '), + 'documentation': docs.getUrls(help).join(', ') + }; + // Set the information + errorObject.errors[severity].push(obj); + // Template invalid if critical error + if (severity == 'crit') { + errorObject.templateValid = false; + } + // Debug + if (process.env.DEBUG) { + var strResourceStack = resourceStack.join(' > '); + logger.debug("Error thrown: " + severity + ": " + message + " (" + strResourceStack + ")"); + } +} +function assignConditionsOutputs() { + var allowedIntrinsicFunctions = ['Fn::And', 'Fn::Equals', 'Fn::If', 'Fn::Not', 'Fn::Or']; + if (!workingInput.hasOwnProperty('Conditions')) { + return; + } + // For through each condition + placeInTemplate.push('Conditions'); + for (var cond in workingInput['Conditions']) { + if (workingInput['Conditions'].hasOwnProperty(cond)) { + placeInTemplate.push(cond); + var condition = workingInput['Conditions'][cond]; + // Check the value of condition is an object + if (typeof condition != 'object') { + addError('crit', "Condition should consist of an intrinsic function of type " + allowedIntrinsicFunctions.join(', '), placeInTemplate, 'Conditions'); + workingInput['Conditions'][cond] = {}; + workingInput['Conditions'][cond]['Attributes'] = {}; + workingInput['Conditions'][cond]['Attributes']['Output'] = false; + } + else { + // Check the value of this is Fn::And, Fn::Equals, Fn::If, Fn::Not or Fn::Or + var keys = Object.keys(condition); + if (allowedIntrinsicFunctions.indexOf(keys[0]) != -1) { + // Resolve recursively + var val = resolveIntrinsicFunction(condition, keys[0]); + // Check is boolean type + workingInput['Conditions'][cond]['Attributes'] = {}; + workingInput['Conditions'][cond]['Attributes']['Output'] = false; + if (val === true || val === false) { + workingInput['Conditions'][cond]['Attributes']['Output'] = val; + } + else { + addError('crit', "Condition did not resolve to a boolean value, got " + val, placeInTemplate, 'Conditions'); + } + } + else { + // Invalid intrinsic function + addError('crit', "Condition does not allow function '" + keys[0] + "' here", placeInTemplate, 'Conditions'); + } + } + placeInTemplate.pop(); + } + } + placeInTemplate.pop(); +} +function assignCustomResources() { + for (var res in workingInput['Resources']) { + if (workingInput['Resources'].hasOwnProperty(res)) { + // Apply resource specification overrides based on logical name + try { + var type = workingInput['Resources'][res]['Type']; + var spec = resourcesSpec.getResourceType(type); + var logicalNameSpec = resourcesSpec.getResourceType(res); + resourcesSpec.extendSpecification({ + 'ResourceTypes': (_a = {}, _a[res] = mergeOptions(spec, logicalNameSpec), _a) + }); + workingInput['Resources'][res]['Type'] = res; + } + catch (e) { } + } + } + var _a; +} +function assignResourcesOutputs() { + if (!workingInput.hasOwnProperty('Resources')) { + addError('crit', 'Resources section is not defined', [], "Resources"); + stopValidation = true; + return false; + } + if (workingInput['Resources'].length == 0) { + addError('crit', 'Resources is empty', [], "Resources"); + stopValidation = true; + return false; + } + // For through each resource + for (var res in workingInput['Resources']) { + if (workingInput['Resources'].hasOwnProperty(res)) { + // Check if Type is defined + var resourceType = null; + var spec = null; + if (!workingInput['Resources'][res].hasOwnProperty('Type')) { + stopValidation = true; + addError('crit', "Resource " + res + " does not have a Type.", ['Resources', res], "Resources"); + } + else { + // Check if Type is valid + resourceType = workingInput['Resources'][res]['Type']; + try { + spec = resourcesSpec.getResourceType(workingInput['Resources'][res]['Type']); + } + catch (e) { + if (e instanceof resourcesSpec.NoSuchResourceType) { + addError('crit', "Resource " + res + " has an invalid Type of " + resourceType + ".", ['Resources', res], "Resources"); + } + else { + throw e; + } + } + } + // Create a map for storing the output attributes for this Resource + var refValue = "mock-ref-" + res; + var refOverride = resourcesSpec.getRefOverride(resourceType); + if (refOverride !== null) { + if (refOverride == "arn") { + refValue = mockArnPrefix + res; + } + else { + refValue = refOverride; + } + } + // Create a return attributes for the resource, assume every resource has a Ref + workingInput['Resources'][res]['Attributes'] = {}; + workingInput['Resources'][res]['Attributes']['Ref'] = refValue; + // Go through the attributes of the specification, and assign them + if (spec != null && spec.Attributes) { + for (var attr in spec.Attributes) { + var value = null; + // use user-defined attribute value if provided for the specific type + try { + var attrSpec = resourcesSpec.getResourceTypeAttribute(resourceType, attr); + if (attrSpec.hasOwnProperty('Value')) { + value = attrSpec['Value']; + } + } + catch (e) { } + // use user-defined attribute value if provided for the specific logical name + try { + var attrSpec = resourcesSpec.getResourceTypeAttribute(res, attr); + if (attrSpec.hasOwnProperty('Value')) { + value = attrSpec['Value']; + } + } + catch (e) { } + // otherwise use an implicit mock value + if (!value) { + if (attr.indexOf('Arn') != -1) { + value = mockArnPrefix + res; + } + else { + value = "mockAttr_" + res; + } + } + workingInput['Resources'][res]['Attributes'][attr] = value; + } + } + } + } +} +function resolveReferences() { + // TODO: Go through and resolve... + // TODO: Ref, Attr, Join, + // Resolve all Ref + lastPositionInTemplate = workingInput; + recursiveDecent(lastPositionInTemplate); + var stop = workingInput; +} +var placeInTemplate = []; +var lastPositionInTemplate = null; +var lastPositionInTemplateKey = null; +function recursiveDecent(ref) { + // Step into next attribute + for (var i = 0; i < Object.keys(ref).length; i++) { + var key = Object.keys(ref)[i]; + // Resolve the function + if (awsData_1.awsIntrinsicFunctions.hasOwnProperty(key)) { + // Check if an Intrinsic function is allowed here + var inResourceProperty = (placeInTemplate[0] == "Resources" || placeInTemplate[2] == "Properties"); + var inResourceMetadata = (placeInTemplate[0] == "Resources" || placeInTemplate[2] == "Metadata"); + var inOutputs = (placeInTemplate[0] == "Outputs"); + var inConditions = (placeInTemplate[0] == "Conditions"); + // TODO Check for usage inside update policy + if (!(inResourceProperty || inResourceMetadata || inOutputs || inConditions)) { + addError("crit", "Intrinsic function " + key + " is not supported here", placeInTemplate, key); + } + else { + // Resolve the function + var functionOutput = resolveIntrinsicFunction(ref, key); + if (functionOutput !== null && lastPositionInTemplateKey !== null) { + // Overwrite the position with the resolved value + lastPositionInTemplate[lastPositionInTemplateKey] = functionOutput; + } + } + } + else if (key != 'Attributes' && ref[key] instanceof Object) { + placeInTemplate.push(key); + lastPositionInTemplate = ref; + lastPositionInTemplateKey = key; + recursiveDecent(ref[key]); + } + } + placeInTemplate.pop(); +} +function resolveCondition(ref, key) { + var toGet = ref[key]; + var condition = false; + if (workingInput.hasOwnProperty('Conditions') && workingInput['Conditions'].hasOwnProperty(toGet)) { + // Check the valid of the condition, returning argument 1 on true or 2 on failure + if (typeof workingInput['Conditions'][toGet] == 'object') { + if (workingInput['Conditions'][toGet].hasOwnProperty('Attributes') && + workingInput['Conditions'][toGet]['Attributes'].hasOwnProperty('Output')) { + condition = workingInput['Conditions'][toGet]['Attributes']['Output']; + } // If invalid, we will default to false, a previous error would have been thrown + } + else { + condition = workingInput['Conditions'][toGet]; + } + } + else { + addError('crit', "Condition '" + toGet + "' must reference a valid condition", placeInTemplate, 'Condition'); + } + return condition; +} +function resolveIntrinsicFunction(ref, key) { + switch (key) { + case 'Ref': + return doIntrinsicRef(ref, key); + case 'Condition': + return resolveCondition(ref, key); + case 'Fn::Join': + return doIntrinsicJoin(ref, key); + case 'Fn::Base64': + return doIntrinsicBase64(ref, key); + case 'Fn::GetAtt': + return doIntrinsicGetAtt(ref, key); + case 'Fn::FindInMap': + return doIntrinsicFindInMap(ref, key); + case 'Fn::GetAZs': + return doIntrinsicGetAZs(ref, key); + case 'Fn::Sub': + return doIntrinsicSub(ref, key); + case 'Fn::If': + return doIntrinsicIf(ref, key); + case 'Fn::Equals': + return doIntrinsicEquals(ref, key); + case 'Fn::Or': + return doIntrinsicOr(ref, key); + case 'Fn::Not': + return doIntrinsicNot(ref, key); + case 'Fn::ImportValue': + return doIntrinsicImportValue(ref, key); + case 'Fn::Select': + return doIntrinsicSelect(ref, key); + case 'Fn::Split': + return doInstrinsicSplit(ref, key); + default: + addError("warn", "Unhandled Intrinsic Function " + key + ", this needs implementing. Some errors might be missed.", placeInTemplate, "Functions"); + return null; + } +} +function doIntrinsicRef(ref, key) { + var refValue = ref[key]; + var resolvedVal = "INVALID_REF"; + // Check if it's of a String type + if (typeof refValue != "string") { + addError("crit", "Intrinsic Function Ref expects a string", placeInTemplate, "Ref"); + } + else { + // Check if the value of the Ref exists + resolvedVal = getRef(refValue); + if (resolvedVal === null) { + addError('crit', "Referenced value " + refValue + " does not exist", placeInTemplate, "Ref"); + resolvedVal = "INVALID_REF"; + } + } + // Return the resolved value + return resolvedVal; +} +function doIntrinsicBase64(ref, key) { + // Only base64 encode strings + var toEncode = ref[key]; + if (typeof toEncode != "string") { + toEncode = resolveIntrinsicFunction(ref[key], Object.keys(ref[key])[0]); + if (typeof toEncode != "string") { + addError("crit", "Parameter of Fn::Base64 does not resolve to a string", placeInTemplate, "Fn::Base64"); + return "INVALID_FN_BASE64"; + } + } + // Return base64 + return Buffer.from(toEncode).toString('base64'); +} +function doIntrinsicJoin(ref, key) { + // Ensure that all objects in the join array have been resolved to string, otherwise + // we need to resolve them. + // Expect 2 parameters + var join = ref[key][0]; + var parts = ref[key][1] || null; + if (ref[key].length != 2 || parts == null) { + addError('crit', 'Invalid parameters for Fn::Join', placeInTemplate, "Fn::Join"); + // Specify this as an invalid string + return "INVALID_JOIN"; + } + else { + // Join + return fnJoin(join, parts); + } +} +function doIntrinsicGetAtt(ref, key) { + var toGet = ref[key]; + if (toGet.length < 2) { + addError("crit", "Invalid parameters for Fn::GetAtt", placeInTemplate, "Fn::GetAtt"); + return "INVALID_GET_ATT"; + } + else { + if (typeof toGet[0] != "string") { + addError("crit", "Fn::GetAtt does not support functions for the logical resource name", placeInTemplate, "Fn::GetAtt"); + } + // If we have more than 2 parameters, merge other parameters + if (toGet.length > 2) { + var root = toGet[0]; + var parts = toGet.slice(1).join('.'); + toGet = [root, parts]; + } + // The AttributeName could be a Ref, so check if it needs resolving + if (typeof toGet[1] != "string") { + var keys = Object.keys(toGet[1]); + if (keys[0] == "Ref") { + toGet[1] = resolveIntrinsicFunction(toGet[1], "Ref"); + } + else { + addError("crit", "Fn::GetAtt only supports Ref within the AttributeName", placeInTemplate, "Fn::GetAtt"); + } + } + var attr = fnGetAtt(toGet[0], toGet[1]); + if (attr != null) { + return attr; + } + else { + return "INVALID_REFERENCE_OR_ATTR_ON_GET_ATT"; + } + } +} +function doIntrinsicFindInMap(ref, key) { + var toGet = ref[key]; + if (toGet.length != 3) { + addError("crit", "Invalid parameters for Fn::FindInMap", placeInTemplate, "Fn::FindInMap"); + return "INVALID_FN_FIND_IN_MAP"; + } + else { + for (var x in toGet) { + if (toGet.hasOwnProperty(x)) { + if (typeof toGet[x] != "string") { + toGet[x] = resolveIntrinsicFunction(toGet[x], Object.keys(toGet[x])[0]); + } + } + } + // Find in map + var val = fnFindInMap(toGet[0], toGet[1], toGet[2]); + if (val == null) { + addError("crit", "Could not find value in map " + toGet[0] + "|" + toGet[1] + "|" + toGet[2] + ". Have you tried specifying input parameters?", placeInTemplate, "Fn::FindInMap"); + return "INVALID_MAPPING"; + } + else { + return val; + } + } +} +function doIntrinsicGetAZs(ref, key) { + var toGet = ref[key]; + var region = awsData_1.awsRefOverrides['AWS::Region']; + // If the argument is not a string, check it's Ref and resolve + if (typeof toGet != "string") { + var key_1 = Object.keys(toGet)[0]; + if (key_1 == "Ref") { + if (toGet[key_1] != 'AWS::Region') { + addError("warn", "Fn::GetAZs expects a region, ensure this reference returns a region", placeInTemplate, "Fn::GetAZs"); + } + region = resolveIntrinsicFunction(toGet, "Ref"); + } + else { + addError("crit", "Fn::GetAZs only supports Ref or string as a parameter", placeInTemplate, "Fn::GetAZs"); + } + } + else { + if (toGet != "") { + region = toGet; + } + } + // We now have a string, assume it's a real region + // Lets create an array with 3 AZs + var AZs = []; + AZs.push(region + 'a'); + AZs.push(region + 'b'); + AZs.push(region + 'c'); + return AZs; +} +function doIntrinsicSelect(ref, key) { + var toGet = ref[key]; + if (!Array.isArray(toGet) || toGet.length < 2) { + addError('crit', "Fn::Select only supports an array of two elements", placeInTemplate, "Fn::Select"); + return 'INVALID_SELECT'; + } + if (toGet[0] === undefined || toGet[0] === null) { + addError('crit', "Fn::Select first element cannot be null or undefined", placeInTemplate, "Fn::Select"); + return 'INVALID_SELECT'; + } + var index; + if (typeof toGet[0] == 'object' && !Array.isArray(toGet[0])) { + var keys = Object.keys(toGet[0]); + if (awsData_1.awsIntrinsicFunctions['Fn::Select::Index']['supportedFunctions'].indexOf(keys[0]) != -1) { + var resolvedIndex = resolveIntrinsicFunction(toGet[0], keys[0]); + if (typeof resolvedIndex === 'string') { + index = parseInt(resolvedIndex); + } + else if (typeof resolvedIndex === 'number') { + index = resolvedIndex; + } + else { + addError('crit', "Fn::Select's first argument did not resolve to a string for parsing or a numeric value.", placeInTemplate, "Fn::Select"); + return 'INVALID_SELECT'; + } + } + else { + addError('crit', "Fn::Select does not support the " + keys[0] + " function in argument 1"); + return 'INVALID_SELECT'; + } + } + else if (typeof toGet[0] === 'string') { + index = parseInt(toGet[0]); + } + else if (typeof toGet[0] === 'number') { + index = toGet[0]; + } + else { + addError('crit', "Fn:Select's first argument must be a number or resolve to a number, it appears to be a " + typeof (toGet[0]), placeInTemplate, "Fn::Select"); + return 'INVALID_SELECT'; + } + if (typeof index === undefined || typeof index !== 'number' || isNaN(index)) { + addError('crit', "First element of Fn::Select must be a number, or it must use an intrinsic fuction that returns a number", placeInTemplate, "Fn::Select"); + return 'INVALID_SELECT'; + } + if (toGet[1] === undefined || toGet[1] === null) { + addError('crit', "Fn::Select Second element cannot be null or undefined", placeInTemplate, "Fn::Select"); + return 'INVALID_SELECT'; + } + var list = toGet[1]; + if (!Array.isArray(list)) { + //we may need to resolve it + if (typeof list !== 'object') { + addError('crit', "Fn::Select requires the second element to resolve to a list, it appears to be a " + typeof list, placeInTemplate, "Fn::Select"); + return 'INVALID_SELECT'; + } + else if (typeof list == 'object') { + var keys = Object.keys(list); + if (awsData_1.awsIntrinsicFunctions['Fn::Select::List']['supportedFunctions'].indexOf(keys[0]) != -1) { + list = resolveIntrinsicFunction(list, keys[0]); + } + else { + addError('crit', "Fn::Select does not support the " + keys[0] + " function in argument 2"); + return 'INVALID_SELECT'; + } + if (keys[0] === "Ref") { + // check if it was a paramter which might be converted to a list + var parameterName = toGet[1][keys[0]]; + if (workingInput['Parameters'][parameterName] !== undefined) { + list = workingInput['Parameters'][parameterName]['Attributes']['Ref']; + } + } + } + if (!Array.isArray(list)) { + addError('crit', "Fn::Select requires the second element to be a list, function call did not resolve to a list. It contains value " + list, placeInTemplate, "Fn::Select"); + return 'INVALID_SELECT'; + } + } + else if (list.indexOf(null) > -1) { + addError('crit', "Fn::Select requires that the list be free of null values", placeInTemplate, "Fn::Select"); + } + if (index >= 0 && index < list.length) { + return list[index]; + } + else { + addError('crit', "First element of Fn::Select exceeds the length of the list.", placeInTemplate, "Fn::Select"); + return 'INVALID_SELECT'; + } +} +function doIntrinsicSub(ref, key) { + var toGet = ref[key]; + var replacementStr = null; + var definedParams = null; + // We have a simple replace + if (typeof toGet == 'string') { + replacementStr = toGet; + } + else { + // We should have an array of parameters + if (toGet[0]) { + if (typeof toGet[0] == 'string') { + replacementStr = toGet[0]; + } + else { + addError('crit', 'Fn::Sub expects first argument to be a string', placeInTemplate, 'Fn::Sub'); + } + if (typeof toGet[1] == 'object') { + definedParams = toGet[1]; + } + else { + addError('crit', 'Fn::Sub expects second argument to be a variable map', placeInTemplate, 'Fn::Sub'); + } + } + else { + addError('crit', 'Fn::Sub function malformed, first array element should be present', placeInTemplate, "Fn::Sub"); + } + } + // Extract the replacement parts + var regex = /\${([A-Za-z0-9:.!]+)/gm; + var matches = []; + var match; + while (match = regex.exec(replacementStr)) { + matches.push(match[1]); + } + try { + // Resolve the replacement and replace into string using Ref or GetAtt + for (var matches_1 = __values(matches), matches_1_1 = matches_1.next(); !matches_1_1.done; matches_1_1 = matches_1.next()) { + var m = matches_1_1.value; + var replacementVal = ""; + if (m.indexOf('!') == 1) { + // Literal Value + replacementVal = m; + } + else if (m.indexOf('.') != -1) { + // Check if m is within the key value map + if (definedParams !== null && definedParams.hasOwnProperty(m) && typeof definedParams[m] !== 'string') { + definedParams[m] = resolveIntrinsicFunction(definedParams[m], Object.keys(m)[0]); + replacementVal = definedParams[m]; + } + else { + // Use Fn::GetAtt + var parts = m.split('.'); + replacementVal = fnGetAtt(parts[0], parts[1]); + if (replacementVal === null) { + addError('crit', "Intrinsic Sub does not reference valid resource attribute '" + m + "'", placeInTemplate, 'Fn::Sub'); + } + } + } + else { + if (definedParams !== null && definedParams.hasOwnProperty(m)) { + if (typeof definedParams[m] !== 'string') { + replacementVal = resolveIntrinsicFunction(definedParams[m], Object.keys(m)[0]); + } + else { + replacementVal = definedParams[m]; + } + } + else { + // Use Ref + replacementVal = getRef(m); + if (replacementVal === null) { + addError('crit', "Intrinsic Sub does not reference valid resource or mapping '" + m + "'", placeInTemplate, 'Fn::Sub'); + } + } + } + // Do a string replace on the string + replacementStr = replacementStr.replace("${" + m + "}", replacementVal); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (matches_1_1 && !matches_1_1.done && (_a = matches_1.return)) _a.call(matches_1); + } + finally { if (e_1) throw e_1.error; } + } + // Set the resolved value as a string + return replacementStr; + var e_1, _a; +} +function doIntrinsicIf(ref, key) { + var toGet = ref[key]; + // Check the value of the condition + if (toGet.length == 3) { + // Check toGet[0] is a valid condition + toGet[0] = resolveCondition({ 'Condition': toGet[0] }, 'Condition'); + // Set the value + var value = null; + if (toGet[0]) { + value = toGet[1]; + } + else { + value = toGet[2]; + } + if (value instanceof Array) { + // Go through each element in the array, resolving if needed. + var resolvedValue = []; + for (var i = 0; i < value.length; i++) { + var keys = Object.keys(value[i]); + if (awsData_1.awsIntrinsicFunctions['Fn::If']['supportedFunctions'].indexOf(keys[0]) !== -1) { + resolvedValue.push(resolveIntrinsicFunction(value[i], keys[0])); + } + else { + addError('crit', "Fn::If does not allow " + keys[0] + " as a nested function within an array", placeInTemplate, 'Fn::If'); + } + } + // Return the resolved array + return resolvedValue; + } + else if (typeof value === "object") { + var keys = Object.keys(value); + if (awsData_1.awsIntrinsicFunctions['Fn::If']['supportedFunctions'].indexOf(keys[0]) !== -1) { + return resolveIntrinsicFunction(value, keys[0]); + } + else { + addError('crit', "Fn::If does not allow " + keys[0] + " as a nested function", placeInTemplate, 'Fn::If'); + } + } + else { + return value; + } + } + else { + addError('crit', "Fn::If must have 3 arguments, only " + toGet.length + " given.", placeInTemplate, 'Fn::If'); + } + // Set the 1st or 2nd param as according to the condition + return "INVALID_IF_STATEMENT"; +} +function doIntrinsicEquals(ref, key) { + var toGet = ref[key]; + // Check the value of the condition + if (toGet.length == 2) { + // Resolve first argument + if (typeof toGet[0] == 'object') { + var keys = Object.keys(toGet[0]); + if (awsData_1.awsIntrinsicFunctions['Fn::If']['supportedFunctions'].indexOf(keys[0]) != -1) { + toGet[0] = resolveIntrinsicFunction(toGet[0], keys[0]); + } + else { + addError('crit', "Fn::Equals does not support the " + keys[0] + " function in argument 1"); + } + } + // Resolve second argument + if (typeof toGet[1] == 'object') { + var keys = Object.keys(toGet[1]); + if (awsData_1.awsIntrinsicFunctions['Fn::If']['supportedFunctions'].indexOf(keys[0]) != -1) { + toGet[0] = resolveIntrinsicFunction(toGet[1], keys[0]); + } + else { + addError('crit', "Fn::Equals does not support the " + keys[1] + " function in argument 2"); + } + } + // Compare + return (toGet[0] == toGet[1]); + } + else { + addError('crit', "Fn::Equals expects 2 arguments, " + toGet.length + " given.", placeInTemplate, 'Fn::Equals'); + } + return false; +} +function doIntrinsicOr(ref, key) { + var toGet = ref[key]; + // Check the value of the condition + if (toGet.length > 1 && toGet.length < 11) { + var argumentIsTrue = false; + // Resolve each argument + for (var arg in toGet) { + if (toGet.hasOwnProperty(arg)) { + if (typeof toGet[arg] == 'object') { + var keys = Object.keys(toGet[arg]); + if (awsData_1.awsIntrinsicFunctions['Fn::Or']['supportedFunctions'].indexOf(keys[0]) != -1) { + toGet[arg] = resolveIntrinsicFunction(toGet[arg], keys[0]); + } + else { + addError('crit', "Fn::Or does not support function '" + keys[0] + "' here", placeInTemplate, 'Fn::Or'); + } + } + // Set to true if needed + if (toGet[arg] === true) { + argumentIsTrue = true; + } + } + } + return argumentIsTrue; + } + else { + addError('crit', "Expecting Fn::Or to have between 2 and 10 arguments", placeInTemplate, 'Fn::Or'); + } +} +function doIntrinsicNot(ref, key) { + var toGet = ref[key]; + // Check the value of the condition + if (toGet.length == 1) { + // Resolve if an object + if (typeof toGet[0] == 'object') { + var keys = Object.keys(toGet[0]); + if (awsData_1.awsIntrinsicFunctions['Fn::Not']['supportedFunctions'].indexOf(keys[0]) != -1) { + toGet[0] = resolveIntrinsicFunction(toGet[0], keys[0]); + } + else { + addError('crit', "Fn::Not does not support function '" + keys[0] + "' here", placeInTemplate, 'Fn::Or'); + } + } + // Negate + if (toGet[0] === true || toGet[0] === false) { + return !toGet[0]; + } + else { + addError('crit', "Fn::Not did not resolve to a boolean value, " + toGet[0] + " given", placeInTemplate, 'Fn::Not'); + } + } + else { + addError('crit', "Expecting Fn::Not to have exactly 1 argument", placeInTemplate, 'Fn::Not'); + } + return false; +} +function doIntrinsicImportValue(ref, key) { + var toGet = ref[key]; + // If not string, resolve using the supported functions + if (typeof toGet == 'object') { + var keys = Object.keys(toGet); + if (awsData_1.awsIntrinsicFunctions['Fn::ImportValue']['supportedFunctions'].indexOf(keys[0]) != -1) { + toGet = resolveIntrinsicFunction(toGet, keys[0]); + } + else { + addError('crit', "Fn::ImportValue does not support function '" + keys[0] + "' here", placeInTemplate, 'Fn::ImportValue'); + return 'INVALID_FN_IMPORTVALUE'; + } + } + // Resolve + if (typeof toGet == 'string') { + return "IMPORTEDVALUE" + toGet; // TODO: Consider making this commandline defined + } + else { + addError('warn', "Something went wrong when resolving references for a Fn::ImportValue", placeInTemplate, 'Fn::ImportValue'); + return 'INVALID_FN_IMPORTVALUE'; + } +} +function doInstrinsicSplit(ref, key) { + var args = ref[key]; + if (!Array.isArray(args) || args.length !== 2) { + addError('crit', 'Invalid parameter for Fn::Split. It needs an Array of length 2.', placeInTemplate, 'Fn::Split'); + return ['INVALID_SPLIT']; + } + var delimiter = args[0]; + if (typeof delimiter !== 'string') { + addError('crit', "Invalid parameter for Fn::Split. The delimiter, " + util.inspect(delimiter) + ", needs to be a string.", placeInTemplate, 'Fn::Split'); + return ['INVALID_SPLIT']; + } + var stringOrInstrinsic = args[1]; + var stringToSplit; + if (typeof stringOrInstrinsic === 'object') { + var fnName = Object.keys(stringOrInstrinsic)[0]; + if (awsData_1.awsIntrinsicFunctions['Fn::Split']['supportedFunctions'].indexOf(fnName) == -1) { + addError('crit', "Fn::Split does not support function '" + fnName + "' here", placeInTemplate, 'Fn::Split'); + return ['INVALID_SPLIT']; + } + stringToSplit = resolveIntrinsicFunction(stringOrInstrinsic, fnName); + } + else if (typeof stringOrInstrinsic === 'string') { + stringToSplit = stringOrInstrinsic; + } + else { + addError('crit', "Invalid parameters for Fn::Split. The parameter, " + stringOrInstrinsic + ", needs to be a string or a supported intrinsic function.", placeInTemplate, 'Fn::Split'); + return ['INVALID_SPLIT']; + } + return fnSplit(delimiter, stringToSplit); +} +exports.doInstrinsicSplit = doInstrinsicSplit; +function fnSplit(delimiter, stringToSplit) { + return stringToSplit.split(delimiter); +} +function fnJoin(join, parts) { + // Resolve instrinsic functions that return the parts array + if (!Array.isArray(parts)) { + // TODO Check the key is within the valid functions which can be called from a Fn::Join + parts = resolveIntrinsicFunction(parts, Object.keys(parts)[0]); + if (!Array.isArray(parts)) { + addError('crit', 'Invalid parameters for Fn::Join', placeInTemplate, "Fn::Join"); + // Specify this as an invalid string + return "INVALID_JOIN"; + } + } + // Otherwise go through each parts and ensure they are resolved + for (var p in parts) { + if (parts.hasOwnProperty(p)) { + if (typeof parts[p] == "object") { + // Something needs resolving + // TODO Check the key is within the valid functions which can be called from a Fn::Join + parts[p] = resolveIntrinsicFunction(parts[p], Object.keys(parts[p])[0]); + } + } + } + return parts.join(join); +} +function fnGetAtt(reference, attributeName) { + if (workingInput['Resources'].hasOwnProperty(reference)) { + var resource = workingInput['Resources'][reference]; + try { + // Lookup attribute + var attribute = resourcesSpec.getResourceTypeAttribute(resource['Type'], attributeName); + var primitiveAttribute = attribute; + if (!!primitiveAttribute['PrimitiveType']) { + return resource['Attributes'][attributeName]; + } + var listAttribute = attribute; + if (listAttribute['Type'] == 'List') { + return [resource['Attributes'][attributeName], resource['Attributes'][attributeName]]; + } + } + catch (e) { + // Coerce missing custom resource attribute value to string + if ((resource['Type'].indexOf('Custom::') === 0) || + (resource['Type'] === 'AWS::CloudFormation::CustomResource') || + (resource['Type'] === 'AWS::CloudFormation::Stack')) { + return "mockAttr_" + reference + "_" + attributeName; + ; + } + if (e instanceof resourcesSpec.NoSuchResourceTypeAttribute) { + addError('crit', e.message, placeInTemplate, resource['Type']); + } + else { + throw e; + } + } + } + else { + addError('crit', "No resource with logical name of " + reference + "!", placeInTemplate, reference); + } + // Return null if not found + return null; +} +exports.fnGetAtt = fnGetAtt; +function fnFindInMap(map, first, second) { + if (workingInput.hasOwnProperty('Mappings')) { + if (workingInput['Mappings'].hasOwnProperty(map)) { + if (workingInput['Mappings'][map].hasOwnProperty(first)) { + if (workingInput['Mappings'][map][first].hasOwnProperty(second)) { + return workingInput['Mappings'][map][first][second]; + } + } + } + } + return null; +} +function getRef(reference) { + // Check in Resources + if (workingInput['Resources'].hasOwnProperty(reference)) { + return workingInput['Resources'][reference]['Attributes']['Ref']; + } + // Check in Parameters + if (workingInput['Parameters'] && workingInput['Parameters'].hasOwnProperty(reference)) { + return workingInput['Parameters'][reference]['Attributes']['Ref']; + } + // Check for customs refs + if (awsData_1.awsRefOverrides.hasOwnProperty(reference)) { + return awsData_1.awsRefOverrides[reference]; + } + // We have not found a ref + return null; +} +function collectOutputs() { + placeInTemplate.push('Outputs'); + var outputs = workingInput['Outputs'] || {}; + for (var outputName in outputs) { + placeInTemplate.push(outputName); + try { + var output = outputs[outputName]; + var outputValue = output['Value']; + if (outputValue === undefined) { + continue; + } + errorObject['outputs'][outputName] = outputValue; + if (output['Export']) { + var exportName = output['Export']['Name']; + if (!exportName) { + addError('crit', "Output " + outputName + " exported with no Name", placeInTemplate, 'Outputs'); + continue; + } + errorObject['exports'][exportName] = outputValue; + } + } + finally { + placeInTemplate.pop(); + } + } + placeInTemplate.pop(); +} +var baseResourceType = null; +/** + * get the name of the ResourceType or PropertyType that this ObjectType refers to. + */ +function getTypeName(objectType) { + switch (objectType.type) { + case 'RESOURCE': + return objectType.resourceType; + case 'PROPERTY': + return resourcesSpec.getPropertyType(objectType.resourceType, objectType.parentType, objectType.propertyName); + case 'PROPERTY_TYPE': + return objectType.propertyType; + default: + throw new Error('unknown type!'); + } +} +/** + * + */ +function getItemType(objectType) { + var maybePrimitiveType = resourcesSpec.getPrimitiveItemType(objectType.parentType, objectType.propertyName); + var maybePropertyType = resourcesSpec.getItemType(objectType.resourceType, objectType.parentType, objectType.propertyName); + if (maybePrimitiveType) { + return { + type: 'PRIMITIVE_TYPE', + primitiveType: maybePrimitiveType, + resourceType: objectType.resourceType + }; + } + else if (maybePropertyType) { + return { + type: 'PROPERTY_TYPE', + propertyType: maybePropertyType, + resourceType: objectType.resourceType + }; + } + else { + throw new Error(objectType.parentType + "." + objectType.propertyName + " is not a container type, but we tried to get an item type for it anyway."); + } +} +function checkResourceProperties() { + // Go into resources + placeInTemplate.push('Resources'); + var resources = workingInput['Resources']; + // Go through each resource + for (var res in resources) { + // Check the property exists + try { + var spec = resourcesSpec.getType(resources[res]['Type']); + } + catch (e) { + if (e instanceof resourcesSpec.NoSuchResourceType) { + continue; + } + else { + throw e; + } + } + // Add the resource name to stack + placeInTemplate.push(res); + // Set the baseResourceType for PropertyType derivation + baseResourceType = resources[res]['Type']; + // Do property validation if Properties in present + if (resources[res].hasOwnProperty('Properties')) { + // Add Properties to the location stack + placeInTemplate.push('Properties'); + var resourceType = resources[res]['Type']; + check({ type: 'RESOURCE', resourceType: resourceType }, resources[res]['Properties']); + // Remove Properties + placeInTemplate.pop(); + } + // Remove resources + placeInTemplate.pop(); + } + // Remove Resource + placeInTemplate.pop(); +} +var KnownTypes; +(function (KnownTypes) { + KnownTypes[KnownTypes["ComplexObject"] = 0] = "ComplexObject"; + KnownTypes[KnownTypes["List"] = 1] = "List"; + KnownTypes[KnownTypes["Map"] = 2] = "Map"; + KnownTypes[KnownTypes["Arn"] = 3] = "Arn"; + KnownTypes[KnownTypes["String"] = 4] = "String"; + KnownTypes[KnownTypes["Integer"] = 5] = "Integer"; + KnownTypes[KnownTypes["Boolean"] = 6] = "Boolean"; + KnownTypes[KnownTypes["Json"] = 7] = "Json"; + KnownTypes[KnownTypes["Double"] = 8] = "Double"; + KnownTypes[KnownTypes["Timestamp"] = 9] = "Timestamp"; +})(KnownTypes = exports.KnownTypes || (exports.KnownTypes = {})); +function getPropertyType(objectType) { + if (objectType.type === 'PROPERTY' && isPropertySchema(objectType)) { + return KnownTypes.ComplexObject; + } + else if (objectType.type === 'PROPERTY' && isListSchema(objectType)) { + return KnownTypes.List; + } + else if (objectType.type === 'PROPERTY' && isMapSchema(objectType)) { + return KnownTypes.Map; + } + else if (objectType.type === 'PROPERTY' && isArnSchema(objectType)) { + return KnownTypes.Arn; + } + else if (isStringSchema(objectType)) { + return KnownTypes.String; + } + else if (isIntegerSchema(objectType)) { + return KnownTypes.Integer; + } + else if (isBooleanSchema(objectType)) { + return KnownTypes.Boolean; + } + else if (isJsonSchema(objectType)) { + return KnownTypes.Json; + } + else if (isDoubleSchema(objectType)) { + return KnownTypes.Double; + } + else if (isTimestampSchema(objectType)) { + return KnownTypes.Timestamp; + } + else { + // this should never happen in production; there are tests in place to ensure + // we can determine the type of every property in the resources and propertytype specs. + throw new Error("could not determine type of " + util.inspect(objectType)); + } +} +exports.getPropertyType = getPropertyType; +function check(objectType, objectToCheck) { + try { + // if we are checking against a resource or propertytype, it must be against + // an object with subproperties. + if ((objectType.type === 'RESOURCE') || (objectType.type === 'PROPERTY_TYPE')) { + verify(exports.isObject, objectToCheck); + checkComplexObject(objectType, objectToCheck); + // otherwise, we have a named property of some resource or propertytype, + // or just a primitive. + } + else { + var propertyType = getPropertyType(objectType); + switch (propertyType) { + case KnownTypes.ComplexObject: + verify(exports.isObject, objectToCheck); + checkComplexObject(objectType, objectToCheck); + break; + case KnownTypes.Map: + verify(exports.isObject, objectToCheck); + checkMap(objectType, objectToCheck); + break; + case KnownTypes.List: + verify(exports.isList, objectToCheck); + checkList(objectType, objectToCheck); + break; + case KnownTypes.Arn: + verify(exports.isArn, objectToCheck); + break; + case KnownTypes.String: + verify(exports.isString, objectToCheck); + break; + case KnownTypes.Integer: + verify(exports.isInteger, objectToCheck); + break; + case KnownTypes.Boolean: + verify(exports.isBoolean, objectToCheck); + break; + case KnownTypes.Json: + verify(exports.isJson, objectToCheck); + break; + case KnownTypes.Double: + verify(exports.isDouble, objectToCheck); + break; + case KnownTypes.Timestamp: + verify(exports.isTimestamp, objectToCheck); + break; + default: + // this causes a typescript error if we forget to handle a KnownType. + var check_1 = propertyType; + } + } + } + catch (e) { + if (e instanceof VerificationError) { + addError('crit', e.message + (", got " + util.inspect(objectToCheck)), placeInTemplate, objectType.resourceType); + } + else { + // generic error handler; let us keep checking what we can instead of crashing. + addError('crit', "Unexpected error: " + e.message + " while checking " + util.inspect(objectToCheck) + " against " + objectType, placeInTemplate, objectType.resourceType); + console.error(e); + } + } +} +// +// Functions to work out what types our properties are expecting. +// +function isPropertySchema(objectType) { + if (objectType.type === 'PRIMITIVE_TYPE') { + return false; + } + else { + return !(resourcesSpec.isPrimitiveProperty(objectType.parentType, objectType.propertyName)) + && !(resourcesSpec.isPropertyTypeList(objectType.parentType, objectType.propertyName)) + && !(resourcesSpec.isPropertyTypeMap(objectType.parentType, objectType.propertyName)); + } +} +var isListSchema = function (property) { + return resourcesSpec.isPropertyTypeList(property.parentType, property.propertyName); +}; +var isMapSchema = function (property) { + return resourcesSpec.isPropertyTypeMap(property.parentType, property.propertyName); +}; +var isArnSchema = function (property) { + return resourcesSpec.isArnProperty(property.propertyName); +}; +function wrapCheck(f) { + function wrapped(objectType) { + var primitiveType = (objectType.type === 'PRIMITIVE_TYPE') + ? objectType.primitiveType + : resourcesSpec.getPrimitiveType(objectType.parentType, objectType.propertyName); + return f(primitiveType); + } + return wrapped; +} +var isStringSchema = wrapCheck(function (primitiveType) { return primitiveType == 'String'; }); +var isIntegerSchema = wrapCheck(function (primitiveType) { return primitiveType == 'Integer' || primitiveType == 'Long'; }); +var isBooleanSchema = wrapCheck(function (primitiveType) { return primitiveType == 'Boolean'; }); +var isJsonSchema = wrapCheck(function (primitiveType) { return primitiveType == 'Json'; }); +var isDoubleSchema = wrapCheck(function (primitiveType) { return primitiveType == 'Double'; }); +var isTimestampSchema = wrapCheck(function (primitiveType) { return primitiveType == 'Timestamp'; }); +// +// Functions to verify incoming data shapes against their expected types. +// +var VerificationError = /** @class */ (function (_super) { + __extends(VerificationError, _super); + function VerificationError(message) { + var _this = _super.call(this, message) || this; + CustomError.fixErrorInheritance(_this, VerificationError); + return _this; + } + return VerificationError; +}(CustomError)); +function verify(verifyTypeFunction, object) { + if (!verifyTypeFunction(object)) { + throw new VerificationError(verifyTypeFunction.failureMessage); + } +} +function verificationFunction(f, message) { + return Object.assign(f, { failureMessage: message }); +} +exports.isList = verificationFunction(function (o) { return (o instanceof Object && o.constructor === Array); }, 'Expecting a list'); +exports.isObject = verificationFunction(function (o) { return (o instanceof Object && o.constructor === Object); }, 'Expecting an object'); +exports.isString = verificationFunction(function (o) { return (typeof o === 'string') || (typeof o === 'number'); }, // wtf cfn. +'Expecting a string'); +exports.isArn = verificationFunction(function (o) { return (typeof o === 'string') && o.indexOf('arn:aws') == 0; }, 'Expecting an ARN'); +var integerRegex = /^-?\d+$/; +exports.isInteger = verificationFunction(function (o) { + if (typeof o === 'number') { + return (o === Math.round(o)); + } + else if (typeof o === 'string') { + return integerRegex.test(o); + } + else { + return false; + } +}, 'Expecting an integer'); +var doubleRegex = /^-?\d+(.\d*)?([eE][-+]?\d+)?$/; +exports.isDouble = verificationFunction(function (o) { + if (typeof o === 'number') { + return !isNaN(o); + } + else if (typeof o === 'string') { + return doubleRegex.test(o); + } + else { + return false; + } +}, 'Expecting a double'); +exports.isBoolean = verificationFunction(function (o) { + if (typeof o === 'boolean') { + return true; + } + else if (typeof o === 'string') { + var oLower = o.toLowerCase(); + return oLower === 'true' || oLower === 'false'; + } + else { + return false; + } +}, 'Expecting a Boolean'); +exports.isJson = verificationFunction(function (o) { + if (exports.isObject(o)) { + return true; + } + else if (typeof o === 'string') { + try { + var obj = JSON.parse(o); + return exports.isObject(obj); + } + catch (e) { + return false; + } + } + else { + return false; + } +}, 'Expecting a JSON object'); +var r = String.raw; +// adapted from https://github.com/segmentio/is-isodate (and fixed slightly) +var timestampRegex = RegExp(r(templateObject_1 || (templateObject_1 = __makeTemplateObject(["^d{4}-d{2}-d{2}"], ["^\\d{4}-\\d{2}-\\d{2}"]))) + // Match YYYY-MM-DD + r(templateObject_2 || (templateObject_2 = __makeTemplateObject(["("], ["("]))) + // time part + r(templateObject_3 || (templateObject_3 = __makeTemplateObject(["(Td{2}:d{2}(:d{2})?)"], ["(T\\d{2}:\\d{2}(:\\d{2})?)"]))) + // Match THH:mm:ss + r(templateObject_4 || (templateObject_4 = __makeTemplateObject(["(.d{1,6})?"], ["(\\.\\d{1,6})?"]))) + // Match .sssss + r(templateObject_5 || (templateObject_5 = __makeTemplateObject(["(Z|(+|-)d{2}(:?d{2}))?"], ["(Z|(\\+|-)\\d{2}(\\:?\\d{2}))?"]))) + // Time zone (Z or +hh:mm or +hhmm) + r(templateObject_6 || (templateObject_6 = __makeTemplateObject([")?$"], [")?$"])))); +exports.isTimestamp = verificationFunction(function (o) { return (typeof o === 'string') && timestampRegex.test(o) && !isNaN(Date.parse(o)); }, 'Expecting an ISO8601-formatted string'); +// +// Functions to descend into complex structures (schema'd objects, Maps, and Lists). +// +function _isKnownProperty(objectTypeName, objectType, isCustomPropertyAllowed, subPropertyName) { + var isKnownProperty = resourcesSpec.isValidProperty(objectTypeName, subPropertyName); + if (!isKnownProperty && !isCustomPropertyAllowed) { + addError("crit", subPropertyName + " is not a valid property of " + objectTypeName, placeInTemplate, objectType.resourceType); + } + return isKnownProperty; +} +function _checkForMissingProperties(properties, objectTypeName) { + var requiredProperties = resourcesSpec.getRequiredProperties(objectTypeName); + // Remove the properties we have from the required property list + var remainingProperties = requiredProperties.filter(function (propertyName) { return properties[propertyName] === undefined; }); + // If we have any items left over, they have not been defined + if (remainingProperties.length > 0) { + try { + for (var remainingProperties_1 = __values(remainingProperties), remainingProperties_1_1 = remainingProperties_1.next(); !remainingProperties_1_1.done; remainingProperties_1_1 = remainingProperties_1.next()) { + var prop = remainingProperties_1_1.value; + addError("crit", "Required property " + prop + " missing for type " + objectTypeName, placeInTemplate, objectTypeName); + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (remainingProperties_1_1 && !remainingProperties_1_1.done && (_a = remainingProperties_1.return)) _a.call(remainingProperties_1); + } + finally { if (e_2) throw e_2.error; } + } + } + var e_2, _a; +} +function checkComplexObject(objectType, objectToCheck) { + var objectTypeName = getTypeName(objectType); + if (!objectTypeName) { + var namedProperty = objectType; + throw new Error(namedProperty.parentType + "." + namedProperty.propertyName + " is not a ResourceType or PropertyType, but we tried to get its type anyway."); + } + // Check for missing required properties + _checkForMissingProperties(objectToCheck, objectTypeName); + var isCustomPropertyAllowed = resourcesSpec.isAdditionalPropertiesEnabled(objectTypeName); + for (var subPropertyName in objectToCheck) { + placeInTemplate.push(subPropertyName); + var propertyValue = objectToCheck[subPropertyName]; + try { + // check if property is recognized + if (!_isKnownProperty(objectTypeName, objectType, isCustomPropertyAllowed, subPropertyName)) { + continue; + } + // already handled in check for missing properties, above. + if (propertyValue === undefined) { + continue; + } + var subPropertyObjectType = { + type: 'PROPERTY', + resourceType: objectType.resourceType, + parentType: objectTypeName, + propertyName: subPropertyName + }; + check(subPropertyObjectType, propertyValue); + } + finally { + placeInTemplate.pop(); + } + } + // TODO How to handle optional required parameters +} +function checkList(objectType, listToCheck) { + var itemType = getItemType(objectType); + try { + for (var _a = __values(listToCheck.entries()), _b = _a.next(); !_b.done; _b = _a.next()) { + var _c = __read(_b.value, 2), index = _c[0], item = _c[1]; + placeInTemplate.push(index); + check(itemType, item); + placeInTemplate.pop(); + } + } + catch (e_3_1) { e_3 = { error: e_3_1 }; } + finally { + try { + if (_b && !_b.done && (_d = _a.return)) _d.call(_a); + } + finally { if (e_3) throw e_3.error; } + } + var e_3, _d; +} +function checkMap(objectType, mapToCheck) { + var itemType = getItemType(objectType); + for (var key in mapToCheck) { + placeInTemplate.push(key); + var item = mapToCheck[key]; + check(itemType, item); + placeInTemplate.pop(); + } +} +var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6; +//# sourceMappingURL=validator.js.map \ No newline at end of file diff --git a/lib/validator.js.map b/lib/validator.js.map new file mode 100644 index 0000000..852c07f --- /dev/null +++ b/lib/validator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"validator.js","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,YAAY,GAAQ,IAAI,CAAC;AAC7B,IAAI,cAAc,GAAG,KAAK,CAAC;AAC3B,+CAAkD;AAClD,iCAAoC;AACpC,iCAAoC;AACpC,IAAM,aAAa,GAAG,mCAAmC,CAAC;AAC1D,qCAMmB;AACnB,6BAAgC;AAEhC,2BAA8B;AAE9B,gDAAmD;AAEnD,wCAA2C;AAC3C,GAAG,CAAC,OAAO,EAAE,CAAC;AAEd,IAAM,Y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ChB,YAAY,EAAE,UAAU,CAAC,YAAY;gBACrC,UAAU,EAAE,cAAc;gBAC1B,YAAY,EAAE,eAAe;aACf,CAAC;YAEnB,KAAK,CAAC,qBAAqB,EAAE,aAAa,CAAC,CAAA;QAE/C,CAAC;gBAAS,CAAC;YACP,eAAe,CAAC,GAAG,EAAE,CAAC;QAC1B,CAAC;IACL,CAAC;IACD,kDAAkD;AACtD,CAAC;AAED,mBAAmB,UAAyB,EAAE,WAAkB;IAC5D,IAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;;QACzC,GAAG,CAAC,CAAwB,IAAA,KAAA,SAAA,WAAW,CAAC,OAAO,EAAE,CAAA,gBAAA;YAAtC,IAAA,wBAAa,EAAZ,aAAK,EAAE,YAAI;YACnB,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC5B,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACtB,eAAe,CAAC,GAAG,EAAE,CAAC;SACzB;;;;;;;;;;AACL,CAAC;AAED,kBAAkB,UAAyB,EAAE,UAA8B;IACvE,IAAM,QAAQ,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IACzC,GAAG,CAAC,CAAC,IAAI,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC;QACzB,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1B,IAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QAC7B,KAAK,CAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QACvB,eAAe,CAAC,GAAG,EAAE,CAAC;IAC1B,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/lib/yamlSchema.d.ts b/lib/yamlSchema.d.ts new file mode 100644 index 0000000..a53a2ae --- /dev/null +++ b/lib/yamlSchema.d.ts @@ -0,0 +1,6 @@ +import yaml = require('js-yaml'); +export declare function functionTag(functionName: string): string; +export default function buildYamlSchema(): yaml.Schema; +export declare type YamlKind = 'scalar' | 'mapping' | 'sequence'; +export declare function buildYamlTypes(fnName: string): yaml.Type[]; +export declare function buildYamlType(fnName: string, kind: YamlKind): yaml.Type; diff --git a/lib/yamlSchema.js b/lib/yamlSchema.js new file mode 100644 index 0000000..9f25d2d --- /dev/null +++ b/lib/yamlSchema.js @@ -0,0 +1,58 @@ +"use strict"; +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +var __spread = (this && this.__spread) || function () { + for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); + return ar; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +var yaml = require("js-yaml"); +function functionTag(functionName) { + var splitFunctionName = functionName.split('::'); + return splitFunctionName[splitFunctionName.length - 1]; +} +exports.functionTag = functionTag; +function buildYamlSchema() { + var intrinsicFunctions = require('../data/aws_intrinsic_functions.json'); + var yamlTypes = []; + for (var fn in intrinsicFunctions) { + yamlTypes.push.apply(yamlTypes, __spread(buildYamlTypes(fn))); + } + return yaml.Schema.create(yamlTypes); +} +exports.default = buildYamlSchema; +var kinds = ['scalar', 'mapping', 'sequence']; +function buildYamlTypes(fnName) { + return kinds.map(function (kind) { return buildYamlType(fnName, kind); }); +} +exports.buildYamlTypes = buildYamlTypes; +function buildYamlType(fnName, kind) { + var tagName = functionTag(fnName); + var tag = "!" + tagName; + var constructFn = (fnName === 'Fn::GetAtt') + ? function (data) { return ({ 'Fn::GetAtt': Array.isArray(data) ? data : data.split('.') }); } + : function (data) { + return (_a = {}, _a[fnName] = data, _a); + var _a; + }; + return new yaml.Type(tag, { + kind: kind, + construct: constructFn + }); +} +exports.buildYamlType = buildYamlType; +//# sourceMappingURL=yamlSchema.js.map \ No newline at end of file diff --git a/lib/yamlSchema.js.map b/lib/yamlSchema.js.map new file mode 100644 index 0000000..4ce5701 --- /dev/null +++ b/lib/yamlSchema.js.map @@ -0,0 +1 @@ +{"version":3,"file":"yamlSchema.js","sourceRoot":"","sources":["../src/yamlSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,8BAAiC;AAEjC,qBAA4B,YAAoB;IAC5C,IAAM,iBAAiB,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,MAAM,GAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAHD,kCAGC;AAED;IACI,IAAM,kBAAkB,GAAG,OAAO,CAAC,sCAAsC,CAAC,CAAC;IAC3E,IAAM,SAAS,GAAG,EAAE,CAAC;IACrB,GAAG,CAAC,CAAC,IAAM,EAAE,IAAI,kBAAkB,CAAC,CAAC,CAAC;QAClC,SAAS,CAAC,IAAI,OAAd,SAAS,WAAS,cAAc,CAAC,EAAE,CAAC,GAAE;IAC1C,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AACzC,CAAC;AAPD,kCAOC;AAGD,IAAM,KAAK,GAAe,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AAE5D,wBAA+B,MAAc;IACzC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,EAA3B,CAA2B,CAAC,CAAC;AAC5D,CAAC;AAFD,wCAEC;AAED,uBAA8B,MAAc,EAAE,IAAc;IACxD,IAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,IAAM,GAAG,GAAG,MAAI,OAAS,CAAC;IAE1B,IAAM,WAAW,GAAG,CAAC,MAAM,KAAK,YAAY,CAAC;QACzC,CAAC,CAAC,UAAC,IAAS,IAAK,OAAA,CAAC,EAAC,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAC,CAAC,EAA9D,CAA8D;QAC/E,CAAC,CAAC,UAAC,IAAS;YAAK,OAAA,UAAE,GAAC,MAAM,IAAG,IAAI,KAAE;;QAAlB,CAAkB,CAAC;IAExC,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACtB,IAAI,MAAA;QACJ,SAAS,EAAE,WAAW;KACzB,CAAC,CAAC;AACP,CAAC;AAZD,sCAYC"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..e13d386 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,715 @@ +{ + "name": "cfn-lint", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/chai": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.4.tgz", + "integrity": "sha512-h6+VEw2Vr3ORiFCyyJmcho2zALnUq9cvdB/IO8Xs9itrJVCenC7o26A6+m7D0ihTTr65eS259H5/Ghl/VjYs6g==", + "dev": true + }, + "@types/colors": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/colors/-/colors-1.1.3.tgz", + "integrity": "sha1-VBOwp6GxbdGL4OP9V9L+7Mgcx3Y=", + "dev": true + }, + "@types/commander": { + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/@types/commander/-/commander-2.12.2.tgz", + "integrity": "sha512-0QEFiR8ljcHp9bAbWxecjVRuAMr16ivPiGOw6KFQBVrVd0RQIcM3xKdRisH2EDWgVWujiYtHwhSkSUoAAGzH7Q==", + "dev": true, + "requires": { + "commander": "2.15.1" + } + }, + "@types/js-yaml": { + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-3.11.1.tgz", + "integrity": "sha512-M5qhhfuTt4fwHGqqANNQilp3Htb5cHwBxlMHDUw/TYRVkEp3s3IIFSH3Fe9HIAeEtnO4p3SSowLmCVavdRYfpw==", + "dev": true + }, + "@types/mocha": { + "version": "2.2.48", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz", + "integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==", + "dev": true + }, + "@types/node": { + "version": "8.10.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.20.tgz", + "integrity": "sha512-M7x8+5D1k/CuA6jhiwuSCmE8sbUWJF0wYsjcig9WrXvwUI5ArEoUBdOXpV4JcEMrLp02/QbDjw+kI+vQeKyQgg==", + "dev": true + }, + "@types/opn": { + "version": "3.0.28", + "resolved": "https://registry.npmjs.org/@types/opn/-/opn-3.0.28.tgz", + "integrity": "sha1-CX0NHJtXSVc6XZbfEyOHu20CEYo=", + "dev": true, + "requires": { + "@types/node": "8.10.20" + } + }, + "@types/source-map-support": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@types/source-map-support/-/source-map-support-0.4.1.tgz", + "integrity": "sha512-eoyZxYGwaeHq5zCVeoNgY1dQy6dVdm1b7K9k1FRnWkf997Tji3NLBoLAjK5WCobeh1Qs6Q5KUV1rZCmHvzaDBw==", + "dev": true, + "requires": { + "@types/node": "8.10.20" + } + }, + "@types/winston": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@types/winston/-/winston-2.3.9.tgz", + "integrity": "sha512-zzruYOEtNgfS3SBjcij1F6HlH6My5n8WrBNhP3fzaRM22ba70QBC2ATs18jGr88Fy43c0z8vFJv5wJankfxv2A==", + "dev": true, + "requires": { + "@types/node": "8.10.20" + } + }, + "acorn": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "1.0.3" + } + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "async": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/async/-/async-1.0.0.tgz", + "integrity": "sha1-+PwEyjoTeErenhZBr5hXjPvWR6k=" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "buffer-from": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", + "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==" + }, + "builtins": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-2.0.0.tgz", + "integrity": "sha512-8srrxpDx3a950BHYcbse+xMjupHHECvQYnShkoPz2ZLhTBrk/HQO6nWMh4o4ui8YYp2ourGVYXlGqFm+UYQwmA==", + "dev": true, + "requires": { + "semver": "5.5.0" + } + }, + "chai": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz", + "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", + "dev": true, + "requires": { + "assertion-error": "1.1.0", + "check-error": "1.0.2", + "deep-eql": "3.0.1", + "get-func-name": "2.0.0", + "pathval": "1.1.0", + "type-detect": "4.0.8" + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "colors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.3.0.tgz", + "integrity": "sha512-EDpX3a7wHMWFA7PUHWPHNWqOxIIRSJetuwl0AS5Oi/5FMV8kWm69RTlgm00GKjBO1xFHMtBbL49yRtMMdticBw==" + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, + "cycle": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", + "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "dependency-check": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/dependency-check/-/dependency-check-2.10.1.tgz", + "integrity": "sha512-gmLQXELyRvWwy0IeSOMgqRvs5lotLhMO9n5932lfXhkyZ7i7wqAQ/zBoued07qRvgvo9Byol98sG8HbYKoTpNA==", + "dev": true, + "requires": { + "async": "2.6.1", + "builtins": "2.0.0", + "debug": "2.6.9", + "detective": "4.7.1", + "is-relative": "0.2.1", + "minimist": "1.2.0", + "read-package-json": "1.3.3", + "resolve": "1.8.1" + }, + "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "4.17.10" + } + } + } + }, + "detective": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz", + "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==", + "dev": true, + "requires": { + "acorn": "5.7.1", + "defined": "1.0.0" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==" + }, + "eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=" + }, + "fill-keys": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/fill-keys/-/fill-keys-1.0.2.tgz", + "integrity": "sha1-mo+jb06K1jTjv2tPPIiCVRRS6yA=", + "dev": true, + "requires": { + "is-object": "1.0.1", + "merge-descriptors": "1.0.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "github-url-from-git": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.5.0.tgz", + "integrity": "sha1-+YX+3MCpqledyI16/waNVcxiUaA=", + "dev": true + }, + "github-url-from-username-repo": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-1.0.2.tgz", + "integrity": "sha1-fdeTMNKr5pwQws73lxTJchV5Hfo=", + "dev": true + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", + "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", + "dev": true, + "optional": true, + "requires": { + "natives": "1.1.4" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.1.tgz", + "integrity": "sha1-iVJojF7C/9awPsyF52ngKQMINHA=", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=" + }, + "is-relative": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", + "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", + "dev": true, + "requires": { + "is-unc-path": "0.1.2" + } + }, + "is-unc-path": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", + "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", + "dev": true, + "requires": { + "unc-path-regex": "0.1.2" + } + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jju": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.3.0.tgz", + "integrity": "sha1-2t2e8BkkvHKLA/L3l5vb1i96Kqo=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, + "json-parse-helpfulerror": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/json-parse-helpfulerror/-/json-parse-helpfulerror-1.0.3.tgz", + "integrity": "sha1-E/FM4C7tTpgSl7ZOueO5MuLdE9w=", + "dev": true, + "requires": { + "jju": "1.3.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "dev": true + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "merge-options": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-1.0.1.tgz", + "integrity": "sha512-iuPV41VWKWBIOpBsjoxjDZw8/GbSfZ2mk7N1453bwMrfzdrIk7EzBd+8UVR6rkw67th7xnk9Dytl3J+lHPdxvg==", + "requires": { + "is-plain-obj": "1.1.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "module-not-found-error": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/module-not-found-error/-/module-not-found-error-1.0.1.tgz", + "integrity": "sha1-z4tP9PKWQGdNbN0CsOO8UjwrvcA=", + "dev": true + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "natives": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.4.tgz", + "integrity": "sha512-Q29yeg9aFKwhLVdkTAejM/HvYG0Y1Am1+HUkFQGn5k2j8GS+v60TVmZh6nujpEAj/qql+wGUrlryO8bF+b1jEg==", + "dev": true, + "optional": true + }, + "normalize-package-data": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.3.tgz", + "integrity": "sha1-i+lVuJB6+XXxpFhOqLubQUkjEvU=", + "dev": true, + "requires": { + "github-url-from-git": "1.5.0", + "github-url-from-username-repo": "1.0.2", + "semver": "4.3.6" + }, + "dependencies": { + "semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", + "dev": true + } + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "opn": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz", + "integrity": "sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==", + "requires": { + "is-wsl": "1.1.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "proxyquire-2": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/proxyquire-2/-/proxyquire-2-1.0.7.tgz", + "integrity": "sha1-J+LPhFWBnAqugpPfS9D79vWD55E=", + "dev": true, + "requires": { + "fill-keys": "1.0.2", + "module-not-found-error": "1.0.1", + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "read-package-json": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-1.3.3.tgz", + "integrity": "sha1-73nf2kbhZTdu6KV++/7dTRsCm6Q=", + "dev": true, + "requires": { + "glob": "5.0.15", + "graceful-fs": "3.0.11", + "json-parse-helpfulerror": "1.0.3", + "normalize-package-data": "1.0.3" + } + }, + "resolve": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "source-map-support": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.6.tgz", + "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", + "requires": { + "buffer-from": "1.1.0", + "source-map": "0.6.1" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=" + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "typescript": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.6.2.tgz", + "integrity": "sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q=", + "dev": true + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "winston": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/winston/-/winston-2.4.3.tgz", + "integrity": "sha512-GYKuysPz2pxYAVJD2NPsDLP5Z79SDEzPm9/j4tCjkF/n89iBNGBMJcR+dMUqxgPNgoSs6fVygPi+Vl2oxIpBuw==", + "requires": { + "async": "1.0.0", + "colors": "1.0.3", + "cycle": "1.0.3", + "eyes": "0.1.8", + "isstream": "0.1.2", + "stack-trace": "0.0.10" + }, + "dependencies": { + "colors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + } + } +}