@intentius/chant-lexicon-azure 0.124.31 → 0.124.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/appservice.js +7 -0
- package/dist/actions/compute.js +9 -0
- package/dist/actions/container.js +14 -0
- package/dist/actions/identity.js +11 -0
- package/dist/actions/index.js +11 -0
- package/dist/actions/keyvault.js +12 -0
- package/dist/actions/network.js +9 -0
- package/dist/actions/sql.js +9 -0
- package/dist/actions/storage.js +15 -0
- package/dist/api/read-client.js +146 -0
- package/dist/codegen/docs-cli.js +2 -0
- package/dist/codegen/docs.js +83 -0
- package/dist/codegen/generate-cli.js +11 -0
- package/dist/codegen/generate-lexicon.js +77 -0
- package/dist/codegen/generate-typescript.js +163 -0
- package/dist/codegen/generate.js +106 -0
- package/dist/codegen/naming.js +139 -0
- package/dist/codegen/package.js +64 -0
- package/dist/composites/aks-cluster.js +68 -0
- package/dist/composites/app-service.js +62 -0
- package/dist/composites/application-gateway.js +107 -0
- package/dist/composites/catalog.js +856 -0
- package/dist/composites/container-instance.js +36 -0
- package/dist/composites/container-registry.js +62 -0
- package/dist/composites/cosmos-database.js +56 -0
- package/dist/composites/from-arm.js +47 -0
- package/dist/composites/function-app.js +57 -0
- package/dist/composites/index.js +16 -0
- package/dist/composites/keyvault.js +69 -0
- package/dist/composites/landing-zone.js +119 -0
- package/dist/composites/private-endpoint.js +61 -0
- package/dist/composites/redis-cache.js +21 -0
- package/dist/composites/service-bus-pipeline.js +54 -0
- package/dist/composites/sql-database.js +62 -0
- package/dist/composites/storage-account.js +59 -0
- package/dist/composites/vm-linux.js +139 -0
- package/dist/composites/vnet-default.js +102 -0
- package/dist/coverage.js +28 -0
- package/dist/deep-observe.js +356 -0
- package/dist/default-tags.js +50 -0
- package/dist/deploy-scopes.d.ts.map +1 -1
- package/dist/deploy-scopes.js +157 -0
- package/dist/describe-resources.js +187 -0
- package/dist/detect.js +17 -0
- package/dist/export-resources.js +108 -0
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +16598 -0
- package/dist/generated/runtime.js +4 -0
- package/dist/governance.js +144 -0
- package/dist/health.d.ts +42 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/health.js +137 -0
- package/dist/import/generator.js +140 -0
- package/dist/import/live-export.js +39 -0
- package/dist/import/parser.js +192 -0
- package/dist/index.js +44 -0
- package/dist/integrity.json +5 -5
- package/dist/intrinsics.js +179 -0
- package/dist/lint/audit-catalog.js +36 -0
- package/dist/lint/audit-lineage.js +71 -0
- package/dist/lint/post-synth/arm-refs.d.ts +1 -0
- package/dist/lint/post-synth/arm-refs.d.ts.map +1 -1
- package/dist/lint/post-synth/arm-refs.js +96 -0
- package/dist/lint/post-synth/azr010.js +45 -0
- package/dist/lint/post-synth/azr011.js +43 -0
- package/dist/lint/post-synth/azr012.js +41 -0
- package/dist/lint/post-synth/azr013.js +50 -0
- package/dist/lint/post-synth/azr014.js +49 -0
- package/dist/lint/post-synth/azr015.js +66 -0
- package/dist/lint/post-synth/azr016.js +37 -0
- package/dist/lint/post-synth/azr017.js +37 -0
- package/dist/lint/post-synth/azr018.js +42 -0
- package/dist/lint/post-synth/azr019.js +41 -0
- package/dist/lint/post-synth/azr020.js +37 -0
- package/dist/lint/post-synth/azr021.js +36 -0
- package/dist/lint/post-synth/azr022.js +39 -0
- package/dist/lint/post-synth/azr023.js +39 -0
- package/dist/lint/post-synth/azr024.js +39 -0
- package/dist/lint/post-synth/azr025.js +37 -0
- package/dist/lint/post-synth/azr026.js +38 -0
- package/dist/lint/post-synth/azr027.js +37 -0
- package/dist/lint/post-synth/azr028.js +37 -0
- package/dist/lint/post-synth/azr029.js +38 -0
- package/dist/lint/post-synth/azr030.js +44 -0
- package/dist/lint/post-synth/azr031.js +36 -0
- package/dist/lint/post-synth/azr032.js +53 -0
- package/dist/lint/post-synth/azr033.js +35 -0
- package/dist/lint/post-synth/index.js +50 -0
- package/dist/lint/rules/hardcoded-location.js +82 -0
- package/dist/lint/rules/index.js +6 -0
- package/dist/lint/rules/nsg-wildcard.js +44 -0
- package/dist/lint/rules/storage-https.js +62 -0
- package/dist/lsp/completions.d.ts.map +1 -1
- package/dist/lsp/completions.js +18 -0
- package/dist/lsp/hover.d.ts.map +1 -1
- package/dist/lsp/hover.js +44 -0
- package/dist/manifest.json +1 -1
- package/dist/meta.json +6 -1
- package/dist/okf/types/containerApps.md +5 -0
- package/dist/op/activities/az-apply.js +563 -0
- package/dist/op/activities/azure.js +48 -0
- package/dist/op/activities/floci-az.js +37 -0
- package/dist/op/activities/index.js +10 -0
- package/dist/op/builders.js +70 -0
- package/dist/ownership.js +13 -0
- package/dist/package-cli.js +21 -0
- package/dist/parameter.js +13 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +478 -0
- package/dist/pseudo.js +40 -0
- package/dist/rules/arm-refs.ts +5 -3
- package/dist/serializer.d.ts +7 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/serializer.js +543 -0
- package/dist/spec/api-versions.js +130 -0
- package/dist/spec/fetch.js +196 -0
- package/dist/spec/parse.d.ts.map +1 -1
- package/dist/spec/parse.js +318 -0
- package/dist/taggable.js +34 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/validate-cli.js +16 -0
- package/dist/validate.js +53 -0
- package/package.json +8 -8
- package/src/attributes.test.ts +17 -0
- package/src/codegen/generate-typescript.ts +1 -1
- package/src/codegen/generate.ts +1 -1
- package/src/codegen/package.ts +2 -2
- package/src/deploy-scopes.ts +2 -1
- package/src/generated/index.d.ts +5 -0
- package/src/generated/index.ts +1 -1
- package/src/generated/lexicon-azure.json +6 -1
- package/src/health.test.ts +66 -0
- package/src/health.ts +162 -0
- package/src/lint/post-synth/arm-refs.ts +5 -3
- package/src/lint/post-synth/post-synth.test.ts +1 -1
- package/src/lsp/completions.ts +2 -1
- package/src/lsp/hover.ts +2 -1
- package/src/plugin.ts +11 -2
- package/src/serializer-names.test.ts +83 -0
- package/src/serializer-outputs.test.ts +65 -0
- package/src/serializer.ts +112 -30
- package/src/spec/parse.test.ts +15 -0
- package/src/spec/parse.ts +10 -0
- package/src/taggable.ts +2 -2
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ts } from "@intentius/chant/lint/typescript";
|
|
2
|
+
/**
|
|
3
|
+
* AZR002: Storage Account HTTPS Only
|
|
4
|
+
*
|
|
5
|
+
* Detects Storage Account creation without supportsHttpsTrafficOnly: true.
|
|
6
|
+
* All storage accounts should enforce HTTPS-only traffic.
|
|
7
|
+
*/
|
|
8
|
+
export const storageHttpsRule = {
|
|
9
|
+
id: "AZR002",
|
|
10
|
+
severity: "warning",
|
|
11
|
+
category: "security",
|
|
12
|
+
description: "Detects Storage Accounts without supportsHttpsTrafficOnly enabled — all storage accounts should enforce HTTPS",
|
|
13
|
+
check(context) {
|
|
14
|
+
const { sourceFile } = context;
|
|
15
|
+
const diagnostics = [];
|
|
16
|
+
function visit(node) {
|
|
17
|
+
// Look for `new StorageAccount(...)` or `new storage.StorageAccount(...)`
|
|
18
|
+
if (ts.isNewExpression(node)) {
|
|
19
|
+
const expression = node.expression;
|
|
20
|
+
let isStorageAccount = false;
|
|
21
|
+
// Check for `new StorageAccount(...)`
|
|
22
|
+
if (ts.isIdentifier(expression) && expression.text === "StorageAccount") {
|
|
23
|
+
isStorageAccount = true;
|
|
24
|
+
}
|
|
25
|
+
// Check for `new storage.StorageAccount(...)` or `new azure.storage.StorageAccount(...)`
|
|
26
|
+
else if (ts.isPropertyAccessExpression(expression)) {
|
|
27
|
+
if (expression.name.text === "StorageAccount") {
|
|
28
|
+
isStorageAccount = true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (isStorageAccount && node.arguments && node.arguments.length > 0) {
|
|
32
|
+
const props = node.arguments[0];
|
|
33
|
+
if (ts.isObjectLiteralExpression(props)) {
|
|
34
|
+
const hasHttpsOnly = props.properties.some((prop) => {
|
|
35
|
+
if (ts.isPropertyAssignment(prop) && ts.isIdentifier(prop.name)) {
|
|
36
|
+
if (prop.name.text === "supportsHttpsTrafficOnly") {
|
|
37
|
+
// Check that it's set to true
|
|
38
|
+
return prop.initializer.kind === ts.SyntaxKind.TrueKeyword;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
});
|
|
43
|
+
if (!hasHttpsOnly) {
|
|
44
|
+
const { line, character } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
|
|
45
|
+
diagnostics.push({
|
|
46
|
+
file: sourceFile.fileName,
|
|
47
|
+
line: line + 1,
|
|
48
|
+
column: character + 1,
|
|
49
|
+
ruleId: "AZR002",
|
|
50
|
+
severity: "warning",
|
|
51
|
+
message: "Storage Account created without supportsHttpsTrafficOnly: true. Enable HTTPS-only traffic.",
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
ts.forEachChild(node, visit);
|
|
58
|
+
}
|
|
59
|
+
visit(sourceFile);
|
|
60
|
+
return diagnostics;
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/lsp/completions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/lsp/completions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAapF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,GAAG,cAAc,EAAE,CAEzE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createRequire } from "module";
|
|
2
|
+
import { moduleSourceUrl } from "@intentius/chant/module-source";
|
|
3
|
+
import { LexiconIndex, lexiconCompletions } from "@intentius/chant/lsp/lexicon-providers";
|
|
4
|
+
const require = createRequire(moduleSourceUrl(import.meta.url));
|
|
5
|
+
let cachedIndex = null;
|
|
6
|
+
function getIndex() {
|
|
7
|
+
if (cachedIndex)
|
|
8
|
+
return cachedIndex;
|
|
9
|
+
const data = require("../generated/lexicon-azure.json");
|
|
10
|
+
cachedIndex = new LexiconIndex(data);
|
|
11
|
+
return cachedIndex;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Provide Azure completions based on context.
|
|
15
|
+
*/
|
|
16
|
+
export function azureCompletions(ctx) {
|
|
17
|
+
return lexiconCompletions(ctx, getIndex(), "Azure ARM resource");
|
|
18
|
+
}
|
package/dist/lsp/hover.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../src/lsp/hover.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../src/lsp/hover.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAa1E;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS,CAEnE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createRequire } from "module";
|
|
2
|
+
import { moduleSourceUrl } from "@intentius/chant/module-source";
|
|
3
|
+
import { LexiconIndex, lexiconHover } from "@intentius/chant/lsp/lexicon-providers";
|
|
4
|
+
const require = createRequire(moduleSourceUrl(import.meta.url));
|
|
5
|
+
let cachedIndex = null;
|
|
6
|
+
function getIndex() {
|
|
7
|
+
if (cachedIndex)
|
|
8
|
+
return cachedIndex;
|
|
9
|
+
const data = require("../generated/lexicon-azure.json");
|
|
10
|
+
cachedIndex = new LexiconIndex(data);
|
|
11
|
+
return cachedIndex;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Provide hover information for Azure resource types and properties.
|
|
15
|
+
*/
|
|
16
|
+
export function azureHover(ctx) {
|
|
17
|
+
return lexiconHover(ctx, getIndex(), resourceHover);
|
|
18
|
+
}
|
|
19
|
+
function resourceHover(className, entry) {
|
|
20
|
+
if (entry.kind !== "resource")
|
|
21
|
+
return undefined;
|
|
22
|
+
const lines = [];
|
|
23
|
+
lines.push(`**${className}**`);
|
|
24
|
+
lines.push("");
|
|
25
|
+
lines.push(`ARM resource type: \`${entry.resourceType}\``);
|
|
26
|
+
const apiVersion = entry.apiVersion;
|
|
27
|
+
if (apiVersion) {
|
|
28
|
+
lines.push(`API version: \`${apiVersion}\``);
|
|
29
|
+
}
|
|
30
|
+
if (entry.attrs && Object.keys(entry.attrs).length > 0) {
|
|
31
|
+
lines.push("");
|
|
32
|
+
lines.push("**Attributes:**");
|
|
33
|
+
for (const [key, value] of Object.entries(entry.attrs)) {
|
|
34
|
+
lines.push(`- \`${key}\` → \`${value}\``);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const provider = entry.resourceType.split("/")[0]?.replace("Microsoft.", "").toLowerCase();
|
|
38
|
+
const resource = entry.resourceType.split("/").pop()?.toLowerCase();
|
|
39
|
+
if (provider && resource) {
|
|
40
|
+
lines.push("");
|
|
41
|
+
lines.push(`[Azure docs](https://learn.microsoft.com/en-us/azure/templates/${provider}/${resource})`);
|
|
42
|
+
}
|
|
43
|
+
return { contents: lines.join("\n") };
|
|
44
|
+
}
|
package/dist/manifest.json
CHANGED
package/dist/meta.json
CHANGED
|
@@ -33235,7 +33235,12 @@
|
|
|
33235
33235
|
"lexicon": "azure",
|
|
33236
33236
|
"apiVersion": "2025-02-02-preview",
|
|
33237
33237
|
"attrs": {
|
|
33238
|
-
"id": "id"
|
|
33238
|
+
"id": "id",
|
|
33239
|
+
"configuration_ingress_fqdn": "configuration.ingress.fqdn",
|
|
33240
|
+
"latestRevisionFqdn": "latestRevisionFqdn",
|
|
33241
|
+
"latestRevisionName": "latestRevisionName",
|
|
33242
|
+
"outboundIpAddresses": "outboundIpAddresses",
|
|
33243
|
+
"provisioningState": "provisioningState"
|
|
33239
33244
|
},
|
|
33240
33245
|
"propertyConstraints": {
|
|
33241
33246
|
"kind": {
|