@aws/cloudformation-languageserver 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +2 -1
  2. package/THIRD-PARTY-LICENSES.txt +457 -58
  3. package/assets/featureFlag/prod.json +2 -2
  4. package/assets/release-manifest.json +158 -572
  5. package/cfn-lsp-server-standalone.js +53 -782
  6. package/cfn-lsp-server-standalone.js.map +1 -1
  7. package/node_modules_aws-sdk_credential-provider-http_dist-es_index_js.js +4 -4
  8. package/node_modules_aws-sdk_credential-provider-ini_dist-es_index_js.js +1 -1
  9. package/node_modules_aws-sdk_credential-provider-login_dist-es_index_js.js +2 -2
  10. package/node_modules_aws-sdk_credential-provider-process_dist-es_index_js.js +1 -1
  11. package/node_modules_aws-sdk_credential-provider-sso_dist-es_index_js.js +38 -20
  12. package/node_modules_aws-sdk_credential-provider-sso_dist-es_index_js.js.map +1 -1
  13. package/node_modules_aws-sdk_credential-provider-web-identity_dist-es_index_js.js +1 -1
  14. package/node_modules_smithy_credential-provider-imds_dist-es_index_js.js +1 -1
  15. package/package.json +3 -3
  16. package/pyodide-worker.js +26 -17
  17. package/pyodide-worker.js.map +1 -1
  18. package/vendors-node_modules_aws-sdk_client-cloudcontrol_dist-es_index_js-node_modules_aws-sdk_client-4d5eee.js +17868 -8730
  19. package/vendors-node_modules_aws-sdk_client-cloudcontrol_dist-es_index_js-node_modules_aws-sdk_client-4d5eee.js.map +1 -1
  20. package/vendors-node_modules_aws-sdk_credential-provider-sso_dist-es_loadSso_js.js +13 -7
  21. package/vendors-node_modules_aws-sdk_credential-provider-sso_dist-es_loadSso_js.js.map +1 -1
  22. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_signin_index_js.js +20 -7
  23. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_signin_index_js.js.map +1 -1
  24. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sso-oidc_index_js.js +20 -7
  25. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sso-oidc_index_js.js.map +1 -1
  26. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sts_index_js.js +16 -7
  27. package/vendors-node_modules_aws-sdk_nested-clients_dist-es_submodules_sts_index_js.js.map +1 -1
  28. package/vendors-node_modules_bowser_bowser_mjs.js +2244 -0
  29. package/vendors-node_modules_bowser_bowser_mjs.js.map +1 -0
  30. package/guard_bg.wasm +0 -0
  31. package/vendor/cfn-guard/guard.js +0 -414
  32. package/vendor/cfn-guard/guard_bg.wasm +0 -0
  33. package/vendor/cfn-guard/index.js +0 -87
  34. package/vendor/cfn-guard/package.json +0 -39
  35. package/vendors-node_modules_bowser_src_bowser_js.js +0 -3300
  36. package/vendors-node_modules_bowser_src_bowser_js.js.map +0 -1
@@ -1,87 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validate = void 0;
4
- const guard_1 = require("./guard");
5
- const path = require("node:path");
6
- const fs = require("fs");
7
- const DATA_FILE_SUPPORTED_EXTENSIONS = ['.yaml', '.yml', '.json', '.jsn', '.template'];
8
- const RULE_FILE_SUPPORTED_EXTENSIONS = ['.guard', '.ruleset'];
9
- const formatOutput = ({ result, rulesNames, dataNames }) => {
10
- const dataPattern = /DATA_STDIN\[(\d+)\]/g;
11
- const rulesPattern = /RULES_STDIN\[(\d+)\]\/DEFAULT/g;
12
- const isWindows = process.platform === 'win32';
13
- const output = JSON.parse(JSON.stringify(result).replace(dataPattern, (match, index) => {
14
- const fileIndex = parseInt(index, 10) - 1;
15
- const fileName = dataNames[fileIndex];
16
- return fileName ? (isWindows ? fileName.split('\\').join('/') : fileName) : match;
17
- }).replace(rulesPattern, (match, index) => {
18
- const ruleIndex = parseInt(index, 10) - 1;
19
- const ruleName = rulesNames[ruleIndex];
20
- if (ruleName) {
21
- const fileNameWithoutExtension = path.basename(ruleName, path.extname(ruleName));
22
- return fileNameWithoutExtension.toUpperCase();
23
- }
24
- return match;
25
- }));
26
- return JSON.parse(output);
27
- };
28
- async function readFiles(dirOrFile, supportedExtensions) {
29
- const fileNames = [];
30
- const fileContents = [];
31
- const stat = await fs.promises.stat(dirOrFile);
32
- if (stat.isDirectory()) {
33
- const files = await getAllFiles(dirOrFile, supportedExtensions);
34
- const readPromises = files.map(async (file) => {
35
- const content = await fs.promises.readFile(file, 'utf8');
36
- fileNames.push(file);
37
- fileContents.push(content);
38
- });
39
- await Promise.all(readPromises);
40
- }
41
- else if (stat.isFile() && supportedExtensions.includes(path.extname(dirOrFile))) {
42
- const content = await fs.promises.readFile(dirOrFile, 'utf8');
43
- fileNames.push(dirOrFile);
44
- fileContents.push(content);
45
- }
46
- return {
47
- fileContents,
48
- fileNames,
49
- };
50
- }
51
- async function getAllFiles(dirPath, supportedExtensions) {
52
- const files = [];
53
- const dirEntries = await fs.promises.readdir(dirPath, { withFileTypes: true });
54
- const traversalPromises = dirEntries.map(async (entry) => {
55
- const entryPath = path.join(dirPath, entry.name);
56
- if (entry.isDirectory()) {
57
- const subFiles = await getAllFiles(entryPath, supportedExtensions);
58
- files.push(...subFiles);
59
- }
60
- else if (supportedExtensions.includes(path.extname(entryPath))) {
61
- files.push(entryPath);
62
- }
63
- });
64
- await Promise.all(traversalPromises);
65
- return files;
66
- }
67
- const validate = async ({ rulesPath, dataPath }) => {
68
- const rulesResult = await readFiles(rulesPath, RULE_FILE_SUPPORTED_EXTENSIONS);
69
- const dataResult = await readFiles(dataPath, DATA_FILE_SUPPORTED_EXTENSIONS);
70
- const payload = {
71
- rules: rulesResult.fileContents,
72
- data: dataResult.fileContents,
73
- };
74
- const validateBuilder = new guard_1.ValidateBuilder();
75
- const result = validateBuilder
76
- .payload(true)
77
- .structured(true)
78
- .showSummary([guard_1.ShowSummaryType.None])
79
- .outputFormat(guard_1.OutputFormatType.Sarif)
80
- .tryBuildAndExecute(JSON.stringify(payload));
81
- return formatOutput({
82
- result,
83
- rulesNames: rulesResult.fileNames,
84
- dataNames: dataResult.fileNames,
85
- });
86
- };
87
- exports.validate = validate;
@@ -1,39 +0,0 @@
1
- {
2
- "name": "cfn-guard",
3
- "collaborators": [
4
- "Diwakar Chakravarthy",
5
- "John Tompkins",
6
- "Omkar Hegde",
7
- "Priya Padmanaban",
8
- "Bryan Ayala",
9
- "Kexiang Wang",
10
- "Akshay Rane",
11
- "Tyler Southwick",
12
- "Josh Fried",
13
- "Dan Vassallo",
14
- "aws-cloudformation-developers <aws-cloudformation-developers@amazon.com>"
15
- ],
16
- "description": "AWS CloudFormation Guard is an open-source general-purpose policy-as-code evaluation tool. It provides developers with a simple-to-use, yet powerful and expressive domain-specific language (DSL) to define policies and enables developers to validate JSON- or YAML- formatted structured data with those policies.",
17
- "version": "3.1.1",
18
- "license": "Apache-2.0",
19
- "repository": {
20
- "type": "git",
21
- "url": "https://github.com/aws-cloudformation/cloudformation-guard"
22
- },
23
- "files": [
24
- "guard_bg.wasm",
25
- "guard.js",
26
- "guard.d.ts",
27
- "index.d.ts",
28
- "index.js"
29
- ],
30
- "main": "index.js",
31
- "types": "index.d.ts",
32
- "keywords": [
33
- "policy-as-code",
34
- "guard",
35
- "cfn-guard",
36
- "security",
37
- "compliance"
38
- ]
39
- }