@fabric-harness/databricks 4.0.2 → 4.1.1
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/README.md +13 -7
- package/dist/agent.js +47 -4
- package/dist/agent.js.map +1 -1
- package/dist/app-user-authorization.d.ts +17 -1
- package/dist/app-user-authorization.d.ts.map +1 -1
- package/dist/certification-environment.d.ts +16 -0
- package/dist/certification-environment.d.ts.map +1 -0
- package/dist/certification.d.ts +17 -0
- package/dist/certification.d.ts.map +1 -1
- package/dist/certify.js +123 -33
- package/dist/certify.js.map +1 -1
- package/dist/governance.d.ts +26 -0
- package/dist/governance.d.ts.map +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1776 -1244
- package/dist/index.js.map +1 -1
- package/dist/raw-protocol-client.d.ts.map +1 -1
- package/dist/sdk-error.d.ts +4 -0
- package/dist/sdk-error.d.ts.map +1 -0
- package/dist/sql-sandbox.js +5 -0
- package/dist/sql-sandbox.js.map +1 -1
- package/dist/tools.d.ts +11 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/vector-search.d.ts +10 -4
- package/dist/vector-search.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -14,7 +14,7 @@ export interface DatabricksAppUserAuthorizationInspection {
|
|
|
14
14
|
}
|
|
15
15
|
export interface DatabricksAppAuthenticatedPrincipal {
|
|
16
16
|
id: string;
|
|
17
|
-
kind: "user";
|
|
17
|
+
kind: "user" | "service-principal" | "app-principal";
|
|
18
18
|
displayName?: string;
|
|
19
19
|
provider: "databricks-apps";
|
|
20
20
|
tenantId: string;
|
|
@@ -30,6 +30,22 @@ export interface DatabricksAppUserAuthenticatorOptions {
|
|
|
30
30
|
tenantId?: (inspection: DatabricksAppUserAuthorizationInspection) => string;
|
|
31
31
|
/** Override the least-privilege permissions granted to an authenticated App user. */
|
|
32
32
|
permissions?: string[];
|
|
33
|
+
/**
|
|
34
|
+
* Trust Databricks Apps reverse-proxy identity headers for M2M API calls that do not carry an
|
|
35
|
+
* OBO user token. Enable only when this server is exclusively behind Databricks Apps ingress.
|
|
36
|
+
*/
|
|
37
|
+
trustForwardedServicePrincipal?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Treat requests without an OBO user token as App authorization and bind them to this App's
|
|
40
|
+
* injected service principal. Enable only behind Databricks Apps ingress.
|
|
41
|
+
*/
|
|
42
|
+
appPrincipalId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Service-principal IDs allowed to use App authorization when Databricks forwards their M2M
|
|
45
|
+
* token through the OBO header. Values are matched against proxy identity headers and safe JWT
|
|
46
|
+
* identity claims. Other forwarded tokens remain on the fail-closed OBO path.
|
|
47
|
+
*/
|
|
48
|
+
appAuthorizedCallerIds?: string[];
|
|
33
49
|
now?: () => number;
|
|
34
50
|
}
|
|
35
51
|
export declare const DATABRICKS_APP_USER_PERMISSIONS: readonly ["agent:invoke", "approval:read", "approval:write", "artifact:read", "mcp:invoke", "session:abort", "session:delete", "session:read"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-user-authorization.d.ts","sourceRoot":"","sources":["../src/app-user-authorization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAS3D,MAAM,WAAW,wCAAwC;IACvD,SAAS,EAAE,eAAe,CAAC;IAC3B,iBAAiB,EAAE;QACjB,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,KAAK,EAAE;QACL,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH;AAED,MAAM,WAAW,mCAAmC;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"app-user-authorization.d.ts","sourceRoot":"","sources":["../src/app-user-authorization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAS3D,MAAM,WAAW,wCAAwC;IACvD,SAAS,EAAE,eAAe,CAAC;IAC3B,iBAAiB,EAAE;QACjB,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,KAAK,EAAE;QACL,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH;AAED,MAAM,WAAW,mCAAmC;IAClD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,eAAe,CAAC;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,qCAAqC;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,kGAAkG;IAClG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,wCAAwC,KAAK,MAAM,CAAC;IAC5E,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB;;;OAGG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,+BAA+B,gJASlC,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,qCAAqC,GAC7C,CAAC,OAAO,EAAE;IACX,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;CAClE,KAAK,OAAO,CAAC,mCAAmC,GAAG,KAAK,GAAG,SAAS,CAAC,CAmFrE;AAyDD;;;;GAIG;AACH,wBAAsB,qCAAqC,CAAC,OAAO,EAAE;IACnE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAmDpD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type DatabricksCertificationBlockingTier } from "./certification.js";
|
|
2
|
+
export interface DatabricksCertificationEnvironmentIssue {
|
|
3
|
+
checkId: string;
|
|
4
|
+
variables: string[];
|
|
5
|
+
message: string;
|
|
6
|
+
}
|
|
7
|
+
type Environment = Readonly<Record<string, string | undefined>>;
|
|
8
|
+
/** Resolve blocking-tier checks plus explicit additions. Explicit ids never remove tier defaults. */
|
|
9
|
+
export declare function resolveDatabricksRequiredChecks(requiredTiers: readonly DatabricksCertificationBlockingTier[], explicitlyRequired?: readonly string[]): string[];
|
|
10
|
+
/**
|
|
11
|
+
* Return actionable, secret-free preflight failures for a protected certification environment.
|
|
12
|
+
* The certification runner remains authoritative for runtime configuration and service behavior.
|
|
13
|
+
*/
|
|
14
|
+
export declare function validateDatabricksCertificationEnvironment(environment: Environment, requiredChecks: readonly string[]): DatabricksCertificationEnvironmentIssue[];
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=certification-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"certification-environment.d.ts","sourceRoot":"","sources":["../src/certification-environment.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mCAAmC,EAEzC,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,uCAAuC;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,KAAK,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAiGhE,qGAAqG;AACrG,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,SAAS,mCAAmC,EAAE,EAC7D,kBAAkB,GAAE,SAAS,MAAM,EAAO,GACzC,MAAM,EAAE,CAaV;AAED;;;GAGG;AACH,wBAAgB,0CAA0C,CACxD,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,SAAS,MAAM,EAAE,GAChC,uCAAuC,EAAE,CAqF3C"}
|
package/dist/certification.d.ts
CHANGED
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
export declare const DATABRICKS_AUTHORING_CERTIFICATION_CHECKS: readonly ["approval-provenance", "jobs-authoring", "lakeflow-authoring", "ai-search-admin", "serving-admin", "uc-admin-obo-execution", "workspace-write", "secrets-write", "genie-authoring"];
|
|
2
|
+
/**
|
|
3
|
+
* Tier R checks prove the supported Databricks consumption path. A release certification cannot
|
|
4
|
+
* pass when one of these checks fails or is not configured.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DATABRICKS_RELEASE_CERTIFICATION_CHECKS: readonly ["identity", "ai-gateway", "sql", "unity-catalog", "uc-denial", "uc-allowed-select", "catalog-preflight-denial", "mutation-approval", "model-serving", "rag", "genie", "volumes", "lakebase", "lineage", "obo", "system-tables", "actual-cost-reconciliation", "databricks-app"];
|
|
7
|
+
/** Tier O checks are preview, SKU-specific, or not part of the default product spine. */
|
|
8
|
+
export declare const DATABRICKS_OPTIONAL_CERTIFICATION_CHECKS: readonly ["agent-services", "rag-evaluation", "responses-agent", "ai-search", "genie-agent-mode", "feature-serving", "lakeflow", "jobs", "notebook", "jobs-classic-authoring", "ai-search-delta-sync-admin", "serving-provisioned-throughput-admin"];
|
|
9
|
+
export type DatabricksCertificationTier = "R" | "A" | "O";
|
|
10
|
+
export type DatabricksCertificationBlockingTier = Exclude<DatabricksCertificationTier, "O">;
|
|
11
|
+
/** Return the default certification tier for a built-in check. Custom checks default to Tier O. */
|
|
12
|
+
export declare function databricksCertificationTier(checkId: string): DatabricksCertificationTier;
|
|
2
13
|
/** Required checks used by the protected Databricks certification workflow. */
|
|
3
14
|
export declare function defaultDatabricksCertificationChecks(options?: {
|
|
4
15
|
agentServices?: boolean;
|
|
@@ -9,12 +20,16 @@ export type DatabricksCertificationStatus = "passed" | "failed" | "not-configure
|
|
|
9
20
|
export interface DatabricksCertificationCheck {
|
|
10
21
|
id: string;
|
|
11
22
|
description: string;
|
|
23
|
+
/** Defaults to the built-in taxonomy for known check ids and Tier O for custom checks. */
|
|
24
|
+
tier?: DatabricksCertificationTier;
|
|
12
25
|
configured: boolean;
|
|
13
26
|
run: () => unknown | Promise<unknown>;
|
|
14
27
|
}
|
|
15
28
|
export interface DatabricksCertificationResult {
|
|
16
29
|
id: string;
|
|
17
30
|
description: string;
|
|
31
|
+
/** Emitted by current runners; optional so retained schema-v2 evidence remains readable. */
|
|
32
|
+
tier?: DatabricksCertificationTier;
|
|
18
33
|
required: boolean;
|
|
19
34
|
status: DatabricksCertificationStatus;
|
|
20
35
|
durationMs: number;
|
|
@@ -52,6 +67,8 @@ export interface RunDatabricksCertificationOptions {
|
|
|
52
67
|
workspaceHost: string;
|
|
53
68
|
checks: DatabricksCertificationCheck[];
|
|
54
69
|
required?: string[];
|
|
70
|
+
/** Require every check in these tiers. Explicit required ids can only add to this set. */
|
|
71
|
+
requiredTiers?: DatabricksCertificationBlockingTier[];
|
|
55
72
|
commitSha?: string;
|
|
56
73
|
secrets?: string[];
|
|
57
74
|
workspaceCloud?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"certification.d.ts","sourceRoot":"","sources":["../src/certification.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"certification.d.ts","sourceRoot":"","sources":["../src/certification.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yCAAyC,+LAU5C,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,uCAAuC,2RAmB1C,CAAC;AAEX,yFAAyF;AACzF,eAAO,MAAM,wCAAwC,sPAa3C,CAAC;AAEX,MAAM,MAAM,2BAA2B,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAC1D,MAAM,MAAM,mCAAmC,GAAG,OAAO,CAAC,2BAA2B,EAAE,GAAG,CAAC,CAAC;AAE5F,mGAAmG;AACnG,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,2BAA2B,CAKxF;AAED,+EAA+E;AAC/E,wBAAgB,oCAAoC,CAClD,OAAO,GAAE;IACP,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,mGAAmG;IACnG,SAAS,CAAC,EAAE,OAAO,CAAC;CAChB,GACL,MAAM,EAAE,CAKV;AAED,MAAM,MAAM,6BAA6B,GAAG,QAAQ,GAAG,QAAQ,GAAG,gBAAgB,CAAC;AAEnF,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,0FAA0F;IAC1F,IAAI,CAAC,EAAE,2BAA2B,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,GAAG,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,6BAA6B;IAC5C,EAAE,EAAE,MAAM,CAAC;IAC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edEntry(entry, info) {
|
|
|
2049
2049
|
|
|
2050
2050
|
// src/certification.ts
|
|
2051
2051
|
import { redactText } from "@fabric-harness/sdk";
|
|
2052
|
+
|
|
2053
|
+
// src/sdk-error.ts
|
|
2054
|
+
function readProperty(value, key) {
|
|
2055
|
+
if (typeof value !== "object" && typeof value !== "function" || value === null)
|
|
2056
|
+
return void 0;
|
|
2057
|
+
try {
|
|
2058
|
+
return Reflect.get(value, key);
|
|
2059
|
+
} catch {
|
|
2060
|
+
return void 0;
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
function databricksErrorStatusCode(error51) {
|
|
2064
|
+
for (const key of ["httpStatusCode", "statusCode", "status"]) {
|
|
2065
|
+
const value = readProperty(error51, key);
|
|
2066
|
+
if (typeof value === "number" && Number.isInteger(value) && value >= 100 && value <= 599)
|
|
2067
|
+
return value;
|
|
2068
|
+
if (typeof value === "string" && /^\d{3}$/u.test(value)) return Number(value);
|
|
2069
|
+
}
|
|
2070
|
+
return void 0;
|
|
2071
|
+
}
|
|
2072
|
+
function databricksErrorMessage(error51) {
|
|
2073
|
+
const message = error51 instanceof Error ? error51.message.trim() : "";
|
|
2074
|
+
const status = databricksErrorStatusCode(error51);
|
|
2075
|
+
const codeValue = readProperty(error51, "code") ?? readProperty(error51, "errorCode");
|
|
2076
|
+
const code = typeof codeValue === "string" && codeValue.trim() ? codeValue.trim() : void 0;
|
|
2077
|
+
const body = decodeHttpBody(readProperty(error51, "httpBody"));
|
|
2078
|
+
const metadata = [status !== void 0 ? `HTTP ${status}` : void 0, code].filter((value) => Boolean(value)).join("; ");
|
|
2079
|
+
if (message) return metadata ? `${message} (${metadata})` : message;
|
|
2080
|
+
if (body) return metadata ? `Databricks API error (${metadata}): ${body}` : body;
|
|
2081
|
+
if (metadata) return `Databricks API error (${metadata})`;
|
|
2082
|
+
const fallback = String(error51);
|
|
2083
|
+
return fallback && fallback !== "[object Object]" ? fallback : "Unknown Databricks SDK error.";
|
|
2084
|
+
}
|
|
2085
|
+
function decodeHttpBody(value) {
|
|
2086
|
+
if (!(value instanceof Uint8Array) || value.byteLength === 0) return void 0;
|
|
2087
|
+
const decoded = new TextDecoder().decode(value).trim();
|
|
2088
|
+
if (!decoded) return void 0;
|
|
2089
|
+
return decoded.length > 4096 ? `${decoded.slice(0, 4096)}\u2026` : decoded;
|
|
2090
|
+
}
|
|
2091
|
+
|
|
2092
|
+
// src/certification.ts
|
|
2052
2093
|
var DATABRICKS_AUTHORING_CERTIFICATION_CHECKS = [
|
|
2053
2094
|
"approval-provenance",
|
|
2054
2095
|
"jobs-authoring",
|
|
@@ -2060,7 +2101,7 @@ var DATABRICKS_AUTHORING_CERTIFICATION_CHECKS = [
|
|
|
2060
2101
|
"secrets-write",
|
|
2061
2102
|
"genie-authoring"
|
|
2062
2103
|
];
|
|
2063
|
-
var
|
|
2104
|
+
var DATABRICKS_RELEASE_CERTIFICATION_CHECKS = [
|
|
2064
2105
|
"identity",
|
|
2065
2106
|
"ai-gateway",
|
|
2066
2107
|
"sql",
|
|
@@ -2071,29 +2112,20 @@ var DEFAULT_DATABRICKS_CERTIFICATION_CHECKS = [
|
|
|
2071
2112
|
"mutation-approval",
|
|
2072
2113
|
"model-serving",
|
|
2073
2114
|
"rag",
|
|
2074
|
-
"rag-evaluation",
|
|
2075
|
-
"responses-agent",
|
|
2076
|
-
"ai-search",
|
|
2077
2115
|
"genie",
|
|
2078
|
-
"feature-serving",
|
|
2079
|
-
"lakeflow",
|
|
2080
|
-
"jobs",
|
|
2081
|
-
"notebook",
|
|
2082
2116
|
"volumes",
|
|
2083
2117
|
"lakebase",
|
|
2084
2118
|
"lineage",
|
|
2085
2119
|
"obo",
|
|
2086
2120
|
"system-tables",
|
|
2087
2121
|
"actual-cost-reconciliation",
|
|
2088
|
-
"databricks-app"
|
|
2089
|
-
...DATABRICKS_AUTHORING_CERTIFICATION_CHECKS
|
|
2122
|
+
"databricks-app"
|
|
2090
2123
|
];
|
|
2091
|
-
function
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
return checks2;
|
|
2124
|
+
function databricksCertificationTier(checkId) {
|
|
2125
|
+
if (DATABRICKS_RELEASE_CERTIFICATION_CHECKS.includes(checkId)) return "R";
|
|
2126
|
+
if (DATABRICKS_AUTHORING_CERTIFICATION_CHECKS.includes(checkId))
|
|
2127
|
+
return "A";
|
|
2128
|
+
return "O";
|
|
2097
2129
|
}
|
|
2098
2130
|
var DatabricksCertificationCleanupLedger = class {
|
|
2099
2131
|
resources = [];
|
|
@@ -2166,25 +2198,32 @@ async function runDatabricksAuthoringLifecycle(lifecycle, ledger = new Databrick
|
|
|
2166
2198
|
}
|
|
2167
2199
|
}
|
|
2168
2200
|
function errorMessage(error51) {
|
|
2169
|
-
return
|
|
2201
|
+
return databricksErrorMessage(error51);
|
|
2170
2202
|
}
|
|
2171
2203
|
async function runDatabricksCertification(options) {
|
|
2172
2204
|
const certificationStarted = Date.now();
|
|
2173
2205
|
const startedAt = new Date(certificationStarted).toISOString();
|
|
2174
|
-
const required3 = new Set(options.required ?? []);
|
|
2175
2206
|
const known = new Set(options.checks.map((check3) => check3.id));
|
|
2176
|
-
const
|
|
2207
|
+
const explicitlyRequired = new Set(options.required ?? []);
|
|
2208
|
+
const unknown2 = [...explicitlyRequired].filter((id) => !known.has(id));
|
|
2177
2209
|
if (unknown2.length > 0) {
|
|
2178
2210
|
throw new Error(`Unknown required Databricks certification checks: ${unknown2.join(", ")}`);
|
|
2179
2211
|
}
|
|
2212
|
+
const requiredTiers2 = new Set(options.requiredTiers ?? []);
|
|
2213
|
+
const required3 = /* @__PURE__ */ new Set([
|
|
2214
|
+
...explicitlyRequired,
|
|
2215
|
+
...options.checks.filter((check3) => requiredTiers2.has(check3.tier ?? databricksCertificationTier(check3.id))).map((check3) => check3.id)
|
|
2216
|
+
]);
|
|
2180
2217
|
const results = [];
|
|
2181
2218
|
for (const check3 of options.checks) {
|
|
2182
2219
|
const startedAt2 = Date.now();
|
|
2183
2220
|
const requiredCheck = required3.has(check3.id);
|
|
2221
|
+
const tier = check3.tier ?? databricksCertificationTier(check3.id);
|
|
2184
2222
|
if (!check3.configured) {
|
|
2185
2223
|
results.push({
|
|
2186
2224
|
id: check3.id,
|
|
2187
2225
|
description: check3.description,
|
|
2226
|
+
tier,
|
|
2188
2227
|
required: requiredCheck,
|
|
2189
2228
|
status: "not-configured",
|
|
2190
2229
|
durationMs: 0,
|
|
@@ -2197,6 +2236,7 @@ async function runDatabricksCertification(options) {
|
|
|
2197
2236
|
results.push({
|
|
2198
2237
|
id: check3.id,
|
|
2199
2238
|
description: check3.description,
|
|
2239
|
+
tier,
|
|
2200
2240
|
required: requiredCheck,
|
|
2201
2241
|
status: "passed",
|
|
2202
2242
|
durationMs: Date.now() - startedAt2,
|
|
@@ -2206,10 +2246,11 @@ async function runDatabricksCertification(options) {
|
|
|
2206
2246
|
results.push({
|
|
2207
2247
|
id: check3.id,
|
|
2208
2248
|
description: check3.description,
|
|
2249
|
+
tier,
|
|
2209
2250
|
required: requiredCheck,
|
|
2210
2251
|
status: "failed",
|
|
2211
2252
|
durationMs: Date.now() - startedAt2,
|
|
2212
|
-
error: redactText(
|
|
2253
|
+
error: redactText(databricksErrorMessage(error51), {
|
|
2213
2254
|
additionalSecrets: options.secrets ?? []
|
|
2214
2255
|
})
|
|
2215
2256
|
});
|
|
@@ -2220,9 +2261,7 @@ async function runDatabricksCertification(options) {
|
|
|
2220
2261
|
failed: results.filter((result) => result.status === "failed").length,
|
|
2221
2262
|
notConfigured: results.filter((result) => result.status === "not-configured").length
|
|
2222
2263
|
};
|
|
2223
|
-
const passed = results.every(
|
|
2224
|
-
(result) => result.required ? result.status === "passed" : result.status !== "failed"
|
|
2225
|
-
);
|
|
2264
|
+
const passed = results.every((result) => !result.required || result.status === "passed");
|
|
2226
2265
|
const certifiedPrincipalKind = options.principalKind ?? results.find((result) => result.id === "identity")?.details?.principalKind;
|
|
2227
2266
|
const generatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
2228
2267
|
const environmentIdentity = [
|
|
@@ -5973,7 +6012,7 @@ function databricksGenieTool(client2, options) {
|
|
|
5973
6012
|
properties: { question: { type: "string" }, conversationId: { type: "string" } },
|
|
5974
6013
|
required: ["question"]
|
|
5975
6014
|
},
|
|
5976
|
-
metadata: { effect: "
|
|
6015
|
+
metadata: { effect: "read", provider: "databricks", service: "genie" },
|
|
5977
6016
|
execute(input, context) {
|
|
5978
6017
|
return genie.ask({
|
|
5979
6018
|
question: input.question,
|
|
@@ -57497,6 +57536,11 @@ var DATABRICKS_RAW_PROTOCOL_RULES = [
|
|
|
57497
57536
|
methods: ["GET"],
|
|
57498
57537
|
path: /^\/api\/2\.0\/genie\/spaces\/[^/?#]+\/conversations\/[^/?#]+\/messages\/[^/?#]+\/attachments\/[^/?#]+\/query-result$/u
|
|
57499
57538
|
},
|
|
57539
|
+
{
|
|
57540
|
+
id: "vector-search-query-sdk-compatibility",
|
|
57541
|
+
methods: ["POST"],
|
|
57542
|
+
path: /^\/api\/2\.0\/vector-search\/indexes\/[^/?#]+\/query$/u
|
|
57543
|
+
},
|
|
57500
57544
|
{
|
|
57501
57545
|
id: "responses-agent-custom-schema",
|
|
57502
57546
|
methods: ["POST"],
|
|
@@ -59419,18 +59463,55 @@ function databricksAiSearch(options) {
|
|
|
59419
59463
|
};
|
|
59420
59464
|
if (opts.filter) body.filtersJson = JSON.stringify(opts.filter);
|
|
59421
59465
|
if (queryType === "vector") {
|
|
59422
|
-
if (!options.embeddings)
|
|
59466
|
+
if (!options.embeddings)
|
|
59467
|
+
throw new Error(
|
|
59468
|
+
'databricks AI Search: queryType "vector" requires an embeddings provider.'
|
|
59469
|
+
);
|
|
59423
59470
|
const [vector] = await options.embeddings.embed([query]);
|
|
59424
|
-
if (!vector)
|
|
59471
|
+
if (!vector)
|
|
59472
|
+
throw new Error("databricks AI Search: embeddings returned no vector for the query.");
|
|
59425
59473
|
body.queryVector = vector;
|
|
59426
59474
|
} else {
|
|
59427
59475
|
body.queryText = query;
|
|
59428
59476
|
}
|
|
59429
|
-
const response = await
|
|
59477
|
+
const response = await queryVectorIndex(options, body);
|
|
59430
59478
|
return mapResults(response, options, columns);
|
|
59431
59479
|
}
|
|
59432
59480
|
};
|
|
59433
59481
|
}
|
|
59482
|
+
async function queryVectorIndex(options, body) {
|
|
59483
|
+
try {
|
|
59484
|
+
return await options.client.queryVectorIndex(body);
|
|
59485
|
+
} catch (error51) {
|
|
59486
|
+
if (!options.rawProtocolClient || !isGeneratedFloatingPointDecodeError(error51)) throw error51;
|
|
59487
|
+
const raw = await options.rawProtocolClient.post(
|
|
59488
|
+
`/api/2.0/vector-search/indexes/${encodeURIComponent(options.index)}/query`,
|
|
59489
|
+
{
|
|
59490
|
+
columns: body.columns,
|
|
59491
|
+
num_results: body.numResults,
|
|
59492
|
+
...body.filtersJson !== void 0 ? { filters_json: body.filtersJson } : {},
|
|
59493
|
+
...body.queryText !== void 0 ? { query_text: body.queryText } : {},
|
|
59494
|
+
...body.queryVector !== void 0 ? { query_vector: body.queryVector } : {}
|
|
59495
|
+
},
|
|
59496
|
+
void 0,
|
|
59497
|
+
{ retry: "safe" }
|
|
59498
|
+
);
|
|
59499
|
+
return {
|
|
59500
|
+
...raw.manifest ? { manifest: raw.manifest } : {},
|
|
59501
|
+
...raw.result ? {
|
|
59502
|
+
result: {
|
|
59503
|
+
...raw.result.data_array ? { dataArray: raw.result.data_array } : {},
|
|
59504
|
+
...raw.result.row_count !== void 0 ? { rowCount: raw.result.row_count } : {}
|
|
59505
|
+
}
|
|
59506
|
+
} : {},
|
|
59507
|
+
...raw.next_page_token ? { nextPageToken: raw.next_page_token } : {}
|
|
59508
|
+
};
|
|
59509
|
+
}
|
|
59510
|
+
}
|
|
59511
|
+
function isGeneratedFloatingPointDecodeError(error51) {
|
|
59512
|
+
const message = error51 instanceof Error ? `${error51.name}: ${error51.message}` : String(error51);
|
|
59513
|
+
return /Cannot convert [-+]?\d+\.\d+(?:e[-+]?\d+)? to a BigInt/iu.test(message);
|
|
59514
|
+
}
|
|
59434
59515
|
function mapResults(response, options, requestedColumns) {
|
|
59435
59516
|
const names = (response.manifest?.columns ?? []).map((c2) => c2.name ?? "");
|
|
59436
59517
|
const requested = new Set(requestedColumns);
|
|
@@ -59846,6 +59927,7 @@ var checks = [
|
|
|
59846
59927
|
);
|
|
59847
59928
|
const retriever = databricksAiSearch({
|
|
59848
59929
|
client: native.vectorSearch,
|
|
59930
|
+
rawProtocolClient: client,
|
|
59849
59931
|
index: aiSearchIndex,
|
|
59850
59932
|
textColumn: aiSearchTextColumn,
|
|
59851
59933
|
...aiSearchIdColumn ? { idColumn: aiSearchIdColumn } : {}
|
|
@@ -59986,6 +60068,7 @@ var checks = [
|
|
|
59986
60068
|
);
|
|
59987
60069
|
const results = await databricksAiSearch({
|
|
59988
60070
|
client: native.vectorSearch,
|
|
60071
|
+
rawProtocolClient: client,
|
|
59989
60072
|
index: aiSearchIndex,
|
|
59990
60073
|
textColumn: aiSearchTextColumn
|
|
59991
60074
|
}).retrieve(aiSearchQuery ?? "fabric harness certification", { k: 1 });
|
|
@@ -59999,6 +60082,7 @@ var checks = [
|
|
|
59999
60082
|
run: async () => {
|
|
60000
60083
|
const result = await databricksGenieTool(native.genie, {
|
|
60001
60084
|
agentId: requiredEnv("DATABRICKS_GENIE_SPACE_ID"),
|
|
60085
|
+
rawProtocolClient: client,
|
|
60002
60086
|
timeoutMs: 18e4
|
|
60003
60087
|
}).execute?.({
|
|
60004
60088
|
question: env2.DATABRICKS_GENIE_QUESTION ?? "How many rows are available?"
|
|
@@ -60321,12 +60405,16 @@ var checks = [
|
|
|
60321
60405
|
},
|
|
60322
60406
|
...createDatabricksAuthoringCertificationChecks(authoringFixtures())
|
|
60323
60407
|
];
|
|
60324
|
-
var required2 = splitCsv(
|
|
60325
|
-
|
|
60326
|
-
|
|
60327
|
-
authoring: env2.FABRIC_DATABRICKS_AUTHORING_TEST === "1"
|
|
60328
|
-
}).join(",")
|
|
60408
|
+
var required2 = splitCsv(env2.FABRIC_DATABRICKS_REQUIRED_CHECKS ?? "");
|
|
60409
|
+
var requiredTiers = splitCsv(
|
|
60410
|
+
env2.FABRIC_DATABRICKS_REQUIRED_TIERS ?? (env2.FABRIC_DATABRICKS_AUTHORING_TEST === "1" ? "A" : "R")
|
|
60329
60411
|
);
|
|
60412
|
+
var invalidRequiredTiers = requiredTiers.filter((tier) => tier !== "R" && tier !== "A");
|
|
60413
|
+
if (invalidRequiredTiers.length > 0) {
|
|
60414
|
+
throw new Error(
|
|
60415
|
+
`FABRIC_DATABRICKS_REQUIRED_TIERS accepts only R and A; received ${invalidRequiredTiers.join(", ")}.`
|
|
60416
|
+
);
|
|
60417
|
+
}
|
|
60330
60418
|
var packageManifest = JSON.parse(
|
|
60331
60419
|
await readFile3(new URL("../package.json", import.meta.url), "utf8")
|
|
60332
60420
|
);
|
|
@@ -60335,6 +60423,7 @@ var evidence = await runDatabricksCertification({
|
|
|
60335
60423
|
workspaceHost: host,
|
|
60336
60424
|
checks,
|
|
60337
60425
|
required: required2,
|
|
60426
|
+
requiredTiers,
|
|
60338
60427
|
...env2.GITHUB_SHA ? { commitSha: env2.GITHUB_SHA } : {},
|
|
60339
60428
|
secrets: [
|
|
60340
60429
|
principal.kind === "pat" ? principal.token : principal.kind === "service-principal" ? principal.clientSecret : "",
|
|
@@ -60580,7 +60669,8 @@ async function canReadTable(tables, fullName) {
|
|
|
60580
60669
|
await tables.getTable({ fullNameArg: fullName });
|
|
60581
60670
|
return true;
|
|
60582
60671
|
} catch (error51) {
|
|
60583
|
-
if (/403|PERMISSION_DENIED|does not have
|
|
60672
|
+
if (databricksErrorStatusCode(error51) === 403 || /403|PERMISSION_DENIED|does not have/i.test(databricksErrorMessage(error51)))
|
|
60673
|
+
return false;
|
|
60584
60674
|
throw error51;
|
|
60585
60675
|
}
|
|
60586
60676
|
}
|