azure-kusto-data 7.0.0-alpha.2 → 7.0.0-alpha.4
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-esm/src/cloudSettings.js +6 -1
- package/dist-esm/src/cloudSettings.js.map +1 -1
- package/dist-esm/src/kustoTrustedEndpoints.js +1 -1
- package/dist-esm/src/kustoTrustedEndpoints.js.map +1 -1
- package/dist-esm/src/{wellKnownKustoEndpoints.json → wellKnownKustoEndpoints.js} +5 -2
- package/dist-esm/src/wellKnownKustoEndpoints.js.map +1 -0
- package/package.json +2 -2
- package/types/src/cloudSettings.d.ts +1 -0
- package/types/src/wellKnownKustoEndpoints.d.ts +27 -0
|
@@ -33,7 +33,7 @@ class CloudSettings {
|
|
|
33
33
|
return this.cloudCache[kustoUri];
|
|
34
34
|
}
|
|
35
35
|
try {
|
|
36
|
-
const response = await axios.get(
|
|
36
|
+
const response = await axios.get(this.getAuthMetadataEndpointFromClusterUri(kustoUri), {
|
|
37
37
|
headers: {
|
|
38
38
|
"Cache-Control": "no-cache",
|
|
39
39
|
// Disable caching - it's being cached in memory (Service returns max-age).
|
|
@@ -76,6 +76,11 @@ class CloudSettings {
|
|
|
76
76
|
}
|
|
77
77
|
return urlString;
|
|
78
78
|
}
|
|
79
|
+
getAuthMetadataEndpointFromClusterUri(kustoUri) {
|
|
80
|
+
const url = new URL(kustoUri);
|
|
81
|
+
// Returns endpoint URL in the form of https://<cluster>:port/v1/rest/auth/metadata
|
|
82
|
+
return `${url.protocol}//${url.host}${this.METADATA_ENDPOINT}`;
|
|
83
|
+
}
|
|
79
84
|
static getAuthorityUri(cloudInfo, authorityId) {
|
|
80
85
|
return cloudInfo.LoginEndpoint + "/" + (authorityId || "organizations");
|
|
81
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudSettings.js","sourceRoot":"","sources":["../../src/cloudSettings.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,k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AAS,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,qCAAqC,CAAC,QAAgB;QAClD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9B,mFAAmF;QACnF,OAAO,GAAG,GAAG,CAAC,QAAQ,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;IACnE,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,SAAoB,EAAE,WAAoB;QAC7D,OAAO,SAAS,CAAC,aAAa,GAAG,GAAG,GAAG,CAAC,WAAW,IAAI,eAAe,CAAC,CAAC;IAC5E,CAAC;CACJ;AAED,MAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;AAC1C,OAAO,EAAE,aAAa,IAAI,aAAa,EAAE,CAAC;AAC1C,eAAe,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport axios from \"axios\";\nimport { isNode } from \"@azure/core-util\";\n\nexport type CloudInfo = {\n LoginEndpoint: string;\n LoginMfaRequired: boolean;\n KustoClientAppId: string;\n KustoClientRedirectUri: string;\n KustoServiceResourceId: string;\n FirstPartyAuthorityUrl: string;\n};\n\nconst AXIOS_ERR_NETWORK = axios?.AxiosError?.ERR_NETWORK ?? \"ERR_NETWORK\";\n\n/**\n * This class holds data for all cloud instances, and returns the specific data instance by parsing the dns suffix from a URL\n */\nclass CloudSettings {\n METADATA_ENDPOINT = \"/v1/rest/auth/metadata\";\n defaultCloudInfo: CloudInfo = {\n LoginEndpoint: process?.env?.AadAuthorityUri || \"https://login.microsoftonline.com\",\n LoginMfaRequired: false,\n KustoClientAppId: \"db662dc1-0cfe-4e1c-a843-19a68e65be58\",\n KustoClientRedirectUri: \"https://microsoft/kustoclient\",\n KustoServiceResourceId: \"https://kusto.kusto.windows.net\",\n FirstPartyAuthorityUrl: \"https://login.microsoftonline.com/f8cdef31-a31e-4b4a-93e4-5f571e91255a\",\n };\n cloudCache: { [kustoUri: string]: CloudInfo } = {};\n\n writeToCache(url: string, info?: CloudInfo) {\n this.cloudCache[this.normalizeUrl(url)] = info ?? this.defaultCloudInfo;\n }\n\n getFromCache = (kustoUri: string) => this.cloudCache[this.normalizeUrl(kustoUri)];\n\n deleteFromCache = (kustoUri: string) => delete this.cloudCache[this.normalizeUrl(kustoUri)];\n\n async getCloudInfoForCluster(kustoUri: string): Promise<CloudInfo> {\n kustoUri = this.normalizeUrl(kustoUri);\n if (kustoUri in this.cloudCache) {\n return this.cloudCache[kustoUri];\n }\n\n try {\n const response = await axios.get<{ AzureAD: CloudInfo | undefined }>(this.getAuthMetadataEndpointFromClusterUri(kustoUri), {\n headers: {\n \"Cache-Control\": \"no-cache\",\n // Disable caching - it's being cached in memory (Service returns max-age).\n // The original motivation for this is due to a CORS issue in Ibiza due to a dynamic subdomain.\n // The first dynamic subdomain is attached to the cache and for some reason isn't invalidated\n // when there is a new subdomain. It causes the request failure due to CORS.\n // Example:\n // Access to XMLHttpRequest at 'https://safrankecc.canadacentral.kusto.windows.net/v1/rest/auth/metadata' from origin\n // 'https://sandbox-46-11.reactblade.portal.azure.net' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value\n // 'https://sandbox-46-10.reactblade.portal.azure.net' that is not equal to the supplied origin.\n },\n maxRedirects: 0,\n });\n if (response.status === 200) {\n this.cloudCache[kustoUri] = response.data.AzureAD || this.defaultCloudInfo;\n } else {\n throw new Error(`Kusto returned an invalid cloud metadata response - ${response}`);\n }\n } catch (ex) {\n if (axios.isAxiosError(ex)) {\n // Axios library has a bug in browser, not propagating the status code, see: https://github.com/axios/axios/issues/5330\n if ((isNode && ex.response?.status === 404) || (!isNode && (!ex.code || ex.code === AXIOS_ERR_NETWORK))) {\n // For now as long not all proxies implement the metadata endpoint, if no endpoint exists return public cloud data\n this.cloudCache[kustoUri] = this.defaultCloudInfo;\n } else {\n throw new Error(`Failed to get cloud info for cluster ${kustoUri} - ${ex}`);\n }\n }\n }\n return this.cloudCache[kustoUri];\n }\n\n private normalizeUrl(kustoUri: string) {\n const url = new URL(kustoUri);\n const urlString = url.toString();\n if (urlString.endsWith(\"/\")) {\n return urlString.slice(0, urlString.length - 1);\n }\n return urlString;\n }\n\n getAuthMetadataEndpointFromClusterUri(kustoUri: string): string {\n const url = new URL(kustoUri);\n // Returns endpoint URL in the form of https://<cluster>:port/v1/rest/auth/metadata\n return `${url.protocol}//${url.host}${this.METADATA_ENDPOINT}`;\n }\n\n static getAuthorityUri(cloudInfo: CloudInfo, authorityId?: string): string {\n return cloudInfo.LoginEndpoint + \"/\" + (authorityId || \"organizations\");\n }\n}\n\nconst cloudSettings = new CloudSettings();\nexport { cloudSettings as CloudSettings };\nexport default cloudSettings;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
import { getStringTailLowerCase } from "./utils.js";
|
|
4
|
-
import { default as endpointsData } from "./wellKnownKustoEndpoints.
|
|
4
|
+
import { default as endpointsData } from "./wellKnownKustoEndpoints.js";
|
|
5
5
|
export class MatchRule {
|
|
6
6
|
constructor(
|
|
7
7
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kustoTrustedEndpoints.js","sourceRoot":"","sources":["../../src/kustoTrustedEndpoints.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE1E,MAAM,OAAO,SAAS;IAClB;IACI;;OAEG;IACI,MAAc;IACrB;;;OAGG;IACI,KAAc;QALd,WAAM,GAAN,MAAM,CAAQ;QAKd,UAAK,GAAL,KAAK,CAAS;IACtB,C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ACL,CAAC;YACD,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,yBAAyB,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getStringTailLowerCase } from \"./utils.js\";\nimport { default as endpointsData } from \"./wellKnownKustoEndpoints.json\";\n\nexport class MatchRule {\n constructor(\n /**\n * The suffix which the candidate must end with in order to match.\n */\n public suffix: string,\n /**\n * Indicates whether the match must be exact (the candidate must\n * not have any prefix) or not.\n */\n public exact: boolean,\n ) {}\n}\n\nexport class FastSuffixMatcher {\n _suffixLength: number;\n rules: { [host: string]: MatchRule[] } = {};\n\n constructor(rules: MatchRule[] | null) {\n this._suffixLength = rules ? Math.min(...rules.map((r: MatchRule) => r.suffix.length)) : 0;\n const processedRules: { [host: string]: MatchRule[] } = {};\n rules?.forEach((rule) => {\n const suffix = getStringTailLowerCase(rule.suffix, this._suffixLength);\n if (!processedRules[suffix]) {\n processedRules[suffix] = [];\n }\n processedRules[suffix].push(rule);\n });\n this.rules = processedRules;\n }\n\n isMatch(candidate: string): boolean {\n if (candidate.length < this._suffixLength) {\n return false;\n }\n const matchRules = this.rules[getStringTailLowerCase(candidate, this._suffixLength)];\n\n if (matchRules) {\n for (const rule of matchRules) {\n if (candidate.endsWith(rule.suffix)) {\n if (candidate.length === rule.suffix.length || !rule.exact) {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n static createFromExisting(existing: FastSuffixMatcher | null, rules: MatchRule[] | null): FastSuffixMatcher | null {\n if (!existing || !Object.keys(existing.rules).length) {\n return new FastSuffixMatcher(rules);\n }\n\n if (!rules) {\n return existing;\n }\n\n return new FastSuffixMatcher(rules.concat(...Object.values(existing.rules)));\n }\n}\n\nclass KustoTrustedEndpointsImpl {\n matchers: { [host: string]: FastSuffixMatcher } = {};\n additionalMatcher: FastSuffixMatcher | null = null;\n overrideMatcher: ((host: string) => boolean) | null = null; // We could unify this with matchers, but separating makes debugging easier\n\n constructor() {\n const etr = Object.entries(endpointsData.AllowedEndpointsByLogin);\n for (const [k, v] of etr) {\n const rules: MatchRule[] = [];\n v.AllowedKustoSuffixes.forEach((suffix: string) => rules.push(new MatchRule(suffix, false)));\n v.AllowedKustoHostnames.forEach((hostname: string) => rules.push(new MatchRule(hostname, true)));\n this.matchers[k] = new FastSuffixMatcher(rules);\n }\n }\n\n setOverridePolicy(matcher: ((host: string) => boolean) | null): void {\n this.overrideMatcher = matcher;\n }\n\n validateTrustedEndpoint(url: URL | string, loginEndpoint: string) {\n const uri = typeof url === \"string\" ? new URL(url) : url;\n const host: string = uri.hostname;\n // Check that target hostname is trusted and can accept security token\n this._validateHostnameIsTrusted(host != null ? host : url.toString(), loginEndpoint);\n }\n\n public addTrustedHosts(rules: MatchRule[] | null, replace: boolean): void {\n if (!rules?.length) {\n if (replace) {\n this.additionalMatcher = null;\n }\n return;\n }\n\n this.additionalMatcher = FastSuffixMatcher.createFromExisting(replace ? null : this.additionalMatcher, rules);\n }\n\n _validateHostnameIsTrusted(hostname: string, loginEndpoint: string): void {\n // The loopback is unconditionally allowed (since we trust ourselves)\n if (this._isLocalAddress(hostname)) {\n return;\n }\n\n // Either check the override matcher OR the matcher:\n const override = this.overrideMatcher;\n if (override != null) {\n if (override(hostname)) {\n return;\n }\n } else {\n const matcher = this.matchers[loginEndpoint?.toLowerCase()];\n if (matcher?.isMatch(hostname)) {\n return;\n }\n }\n\n const additionalMatcher = this.additionalMatcher;\n if (additionalMatcher?.isMatch(hostname)) {\n return;\n }\n\n throw new Error(`Can't communicate with '${hostname}' as this hostname is currently not trusted; please see https://aka.ms/kustotrustedendpoints`);\n }\n\n _isLocalAddress(host: string): boolean {\n if ([\"localhost\", \"127.0.0.1\", \"::1\", \"[::1]\"].find((c) => c === host)) {\n return true;\n }\n\n if (host.startsWith(\"127.\") && host.length <= 15 && host.length >= 9) {\n for (let i = 0; i < host.length; i++) {\n const ch = host.charAt(i);\n if (ch !== \".\" && (ch < \"0\" || ch > \"9\")) {\n return false;\n }\n }\n return true;\n }\n\n return false;\n }\n}\n\nexport const kustoTrustedEndpoints = new KustoTrustedEndpointsImpl();\n"]}
|
|
1
|
+
{"version":3,"file":"kustoTrustedEndpoints.js","sourceRoot":"","sources":["../../src/kustoTrustedEndpoints.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAExE,MAAM,OAAO,SAAS;IAClB;IACI;;OAEG;IACI,MAAc;IACrB;;;OAGG;IACI,KAAc;QALd,WAAM,GAAN,MAAM,CAAQ;QAKd,UAAK,GAAL,KAAK,CAAS;IACtB,CAAC;CACP;AAED,MAAM,OAAO,iBAAiB;IAI1B,YAAY,KAAyB;QAFrC,UAAK,GAAoC,EAAE,CAAC;QAGxC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAY,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3F,MAAM,cAAc,GAAoC,EAAE,CAAC;QAC3D,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YACpB,MAAM,MAAM,GAAG,sBAAsB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;YACvE,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC1B,cAAc,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;YAChC,CAAC;YACD,cAAc,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAA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CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;YACrE,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,EAAE,IAAI,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YACnE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACnC,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAC1B,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,EAAE,GAAG,GAAG,CAAC,EAAE,CAAC;oBACvC,OAAO,KAAK,CAAC;gBACjB,CAAC;YACL,CAAC;YACD,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,yBAAyB,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { getStringTailLowerCase } from \"./utils.js\";\nimport { default as endpointsData } from \"./wellKnownKustoEndpoints.js\";\n\nexport class MatchRule {\n constructor(\n /**\n * The suffix which the candidate must end with in order to match.\n */\n public suffix: string,\n /**\n * Indicates whether the match must be exact (the candidate must\n * not have any prefix) or not.\n */\n public exact: boolean,\n ) {}\n}\n\nexport class FastSuffixMatcher {\n _suffixLength: number;\n rules: { [host: string]: MatchRule[] } = {};\n\n constructor(rules: MatchRule[] | null) {\n this._suffixLength = rules ? Math.min(...rules.map((r: MatchRule) => r.suffix.length)) : 0;\n const processedRules: { [host: string]: MatchRule[] } = {};\n rules?.forEach((rule) => {\n const suffix = getStringTailLowerCase(rule.suffix, this._suffixLength);\n if (!processedRules[suffix]) {\n processedRules[suffix] = [];\n }\n processedRules[suffix].push(rule);\n });\n this.rules = processedRules;\n }\n\n isMatch(candidate: string): boolean {\n if (candidate.length < this._suffixLength) {\n return false;\n }\n const matchRules = this.rules[getStringTailLowerCase(candidate, this._suffixLength)];\n\n if (matchRules) {\n for (const rule of matchRules) {\n if (candidate.endsWith(rule.suffix)) {\n if (candidate.length === rule.suffix.length || !rule.exact) {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n static createFromExisting(existing: FastSuffixMatcher | null, rules: MatchRule[] | null): FastSuffixMatcher | null {\n if (!existing || !Object.keys(existing.rules).length) {\n return new FastSuffixMatcher(rules);\n }\n\n if (!rules) {\n return existing;\n }\n\n return new FastSuffixMatcher(rules.concat(...Object.values(existing.rules)));\n }\n}\n\nclass KustoTrustedEndpointsImpl {\n matchers: { [host: string]: FastSuffixMatcher } = {};\n additionalMatcher: FastSuffixMatcher | null = null;\n overrideMatcher: ((host: string) => boolean) | null = null; // We could unify this with matchers, but separating makes debugging easier\n\n constructor() {\n const etr = Object.entries(endpointsData.AllowedEndpointsByLogin);\n for (const [k, v] of etr) {\n const rules: MatchRule[] = [];\n v.AllowedKustoSuffixes.forEach((suffix: string) => rules.push(new MatchRule(suffix, false)));\n v.AllowedKustoHostnames.forEach((hostname: string) => rules.push(new MatchRule(hostname, true)));\n this.matchers[k] = new FastSuffixMatcher(rules);\n }\n }\n\n setOverridePolicy(matcher: ((host: string) => boolean) | null): void {\n this.overrideMatcher = matcher;\n }\n\n validateTrustedEndpoint(url: URL | string, loginEndpoint: string) {\n const uri = typeof url === \"string\" ? new URL(url) : url;\n const host: string = uri.hostname;\n // Check that target hostname is trusted and can accept security token\n this._validateHostnameIsTrusted(host != null ? host : url.toString(), loginEndpoint);\n }\n\n public addTrustedHosts(rules: MatchRule[] | null, replace: boolean): void {\n if (!rules?.length) {\n if (replace) {\n this.additionalMatcher = null;\n }\n return;\n }\n\n this.additionalMatcher = FastSuffixMatcher.createFromExisting(replace ? null : this.additionalMatcher, rules);\n }\n\n _validateHostnameIsTrusted(hostname: string, loginEndpoint: string): void {\n // The loopback is unconditionally allowed (since we trust ourselves)\n if (this._isLocalAddress(hostname)) {\n return;\n }\n\n // Either check the override matcher OR the matcher:\n const override = this.overrideMatcher;\n if (override != null) {\n if (override(hostname)) {\n return;\n }\n } else {\n const matcher = this.matchers[loginEndpoint?.toLowerCase()];\n if (matcher?.isMatch(hostname)) {\n return;\n }\n }\n\n const additionalMatcher = this.additionalMatcher;\n if (additionalMatcher?.isMatch(hostname)) {\n return;\n }\n\n throw new Error(`Can't communicate with '${hostname}' as this hostname is currently not trusted; please see https://aka.ms/kustotrustedendpoints`);\n }\n\n _isLocalAddress(host: string): boolean {\n if ([\"localhost\", \"127.0.0.1\", \"::1\", \"[::1]\"].find((c) => c === host)) {\n return true;\n }\n\n if (host.startsWith(\"127.\") && host.length <= 15 && host.length >= 9) {\n for (let i = 0; i < host.length; i++) {\n const ch = host.charAt(i);\n if (ch !== \".\" && (ch < \"0\" || ch > \"9\")) {\n return false;\n }\n }\n return true;\n }\n\n return false;\n }\n}\n\nexport const kustoTrustedEndpoints = new KustoTrustedEndpointsImpl();\n"]}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
export default {
|
|
2
4
|
"_Comments": [
|
|
3
5
|
"KWE .linkedin.com suffix is excluded from list pending a more specific suffix",
|
|
4
6
|
"LogAnalytics, AppInsigts & AzureMonitor are taken from https://msazure.visualstudio.com/One/_wiki/wikis/One.wiki/138095/Calling-the-ADX-Proxy following talk with Raz Ronen",
|
|
@@ -59,4 +61,5 @@
|
|
|
59
61
|
]
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
|
-
}
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=wellKnownKustoEndpoints.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wellKnownKustoEndpoints.js","sourceRoot":"","sources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C3F,uBAAuB,EAAE;gBACrB,gDAAgD;gBAChD,yCAAyC;gBACzC,oCAAoC;aACvC;SACJ;KACJ;CACJ,CAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nexport default {\n \"_Comments\": [\n \"KWE .linkedin.com suffix is excluded from list pending a more specific suffix\",\n \"LogAnalytics, AppInsigts & AzureMonitor are taken from https://msazure.visualstudio.com/One/_wiki/wikis/One.wiki/138095/Calling-the-ADX-Proxy following talk with Raz Ronen\",\n \"The two DXP suffixes come from KWE code\",\n \"The PlayFab suffixes are a superset of KWE and PowerBI Kusto Connector code\",\n \"Aria hostname is fixed\"\n ],\n \"AllowedEndpointsByLogin\": {\n \"https://login.microsoftonline.com\": {\n \"AllowedKustoSuffixes\": [\n \".dxp.aad.azure.com\",\n \".dxp-dev.aad.azure.com\",\n \".kusto.azuresynapse.net\",\n \".kusto.windows.net\",\n \".kustodev.azuresynapse-dogfood.net\",\n \".kustodev.windows.net\",\n \".kustomfa.windows.net\",\n \".playfabapi.com\",\n \".azureplayfab.com\",\n \".playfab.com\",\n \".kusto.data.microsoft.com\",\n \".kusto.fabric.microsoft.com\",\n \".api.securityplatform.microsoft.com\",\n \".securitycenter.windows.com\"\n ],\n \"AllowedKustoHostnames\": [\n \"ade.applicationinsights.io\",\n \"ade.loganalytics.io\",\n \"adx.aimon.applicationinsights.azure.com\",\n \"adx.applicationinsights.azure.com\",\n \"adx.int.applicationinsights.azure.com\",\n \"adx.int.loganalytics.azure.com\",\n \"adx.int.monitor.azure.com\",\n \"adx.loganalytics.azure.com\",\n \"adx.monitor.azure.com\",\n \"kusto.aria.microsoft.com\",\n \"eu.kusto.aria.microsoft.com\"\n ]\n },\n \"https://login.microsoftonline.us\": {\n \"AllowedKustoSuffixes\": [\".kusto.usgovcloudapi.net\", \".kustomfa.usgovcloudapi.net\"],\n \"AllowedKustoHostnames\": [\"adx.applicationinsights.azure.us\", \"adx.loganalytics.azure.us\", \"adx.monitor.azure.us\"]\n },\n \"https://login.partner.microsoftonline.cn\": {\n \"AllowedKustoSuffixes\": [\".kusto.azuresynapse.azure.cn\", \".kusto.chinacloudapi.cn\", \".kustomfa.chinacloudapi.cn\", \".playfab.cn\"],\n \"AllowedKustoHostnames\": [\"adx.applicationinsights.azure.cn\", \"adx.loganalytics.azure.cn\", \"adx.monitor.azure.cn\"]\n },\n \"https://login.microsoftonline.eaglex.ic.gov\": {\n \"AllowedKustoSuffixes\": [\".kusto.core.eaglex.ic.gov\", \".kustomfa.core.eaglex.ic.gov\"],\n \"AllowedKustoHostnames\": [\"adx.applicationinsights.azure.eaglex.ic.gov\", \"adx.loganalytics.azure.eaglex.ic.gov\", \"adx.monitor.azure.eaglex.ic.gov\"]\n },\n \"https://login.microsoftonline.microsoft.scloud\": {\n \"AllowedKustoSuffixes\": [\".kusto.core.microsoft.scloud\", \".kustomfa.core.microsoft.scloud\"],\n \"AllowedKustoHostnames\": [\n \"adx.applicationinsights.azure.microsoft.scloud\",\n \"adx.loganalytics.azure.microsoft.scloud\",\n \"adx.monitor.azure.microsoft.scloud\"\n ]\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azure-kusto-data",
|
|
3
|
-
"version": "7.0.0-alpha.
|
|
3
|
+
"version": "7.0.0-alpha.4",
|
|
4
4
|
"description": "Azure Data Explorer Query SDK",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist-esm/src/index.js",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"stream-http": "^3.2.0",
|
|
72
72
|
"uuid": "^8.3.2"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "daa0e1b73e76aedbdfae921526ec55087f1fb646"
|
|
75
75
|
}
|
|
@@ -20,6 +20,7 @@ declare class CloudSettings {
|
|
|
20
20
|
deleteFromCache: (kustoUri: string) => boolean;
|
|
21
21
|
getCloudInfoForCluster(kustoUri: string): Promise<CloudInfo>;
|
|
22
22
|
private normalizeUrl;
|
|
23
|
+
getAuthMetadataEndpointFromClusterUri(kustoUri: string): string;
|
|
23
24
|
static getAuthorityUri(cloudInfo: CloudInfo, authorityId?: string): string;
|
|
24
25
|
}
|
|
25
26
|
declare const cloudSettings: CloudSettings;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
_Comments: string[];
|
|
3
|
+
AllowedEndpointsByLogin: {
|
|
4
|
+
"https://login.microsoftonline.com": {
|
|
5
|
+
AllowedKustoSuffixes: string[];
|
|
6
|
+
AllowedKustoHostnames: string[];
|
|
7
|
+
};
|
|
8
|
+
"https://login.microsoftonline.us": {
|
|
9
|
+
AllowedKustoSuffixes: string[];
|
|
10
|
+
AllowedKustoHostnames: string[];
|
|
11
|
+
};
|
|
12
|
+
"https://login.partner.microsoftonline.cn": {
|
|
13
|
+
AllowedKustoSuffixes: string[];
|
|
14
|
+
AllowedKustoHostnames: string[];
|
|
15
|
+
};
|
|
16
|
+
"https://login.microsoftonline.eaglex.ic.gov": {
|
|
17
|
+
AllowedKustoSuffixes: string[];
|
|
18
|
+
AllowedKustoHostnames: string[];
|
|
19
|
+
};
|
|
20
|
+
"https://login.microsoftonline.microsoft.scloud": {
|
|
21
|
+
AllowedKustoSuffixes: string[];
|
|
22
|
+
AllowedKustoHostnames: string[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
27
|
+
//# sourceMappingURL=wellKnownKustoEndpoints.d.ts.map
|