@fabric-harness/databricks 5.0.1 → 6.0.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.
- package/README.md +15 -3
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +753 -353
- package/dist/agent.js.map +1 -1
- package/dist/ai.d.ts +10 -3
- package/dist/ai.d.ts.map +1 -1
- package/dist/app-user-authorization.d.ts +2 -0
- package/dist/app-user-authorization.d.ts.map +1 -1
- package/dist/app-user-authorization.js +8 -4
- package/dist/app-user-authorization.js.map +1 -1
- package/dist/app.d.ts +8 -0
- package/dist/app.d.ts.map +1 -1
- package/dist/asset-bundles.d.ts +56 -6
- package/dist/asset-bundles.d.ts.map +1 -1
- package/dist/capabilities.d.ts.map +1 -1
- package/dist/certify.js +163 -12
- package/dist/certify.js.map +1 -1
- package/dist/compatibility.d.ts +1 -1
- package/dist/compatibility.d.ts.map +1 -1
- package/dist/index.d.ts +45 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +939 -362
- package/dist/index.js.map +1 -1
- package/dist/jobs.d.ts +46 -2
- package/dist/jobs.d.ts.map +1 -1
- package/dist/lakeflow.d.ts +14 -7
- package/dist/lakeflow.d.ts.map +1 -1
- package/dist/persistence.d.ts +13 -2
- package/dist/persistence.d.ts.map +1 -1
- package/dist/resource-policy.d.ts +9 -0
- package/dist/resource-policy.d.ts.map +1 -0
- package/dist/tools.d.ts +40 -9
- package/dist/tools.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/app.d.ts
CHANGED
|
@@ -95,6 +95,14 @@ export interface DatabricksAppRuntime {
|
|
|
95
95
|
conversationStreamStore?: import("@fabric-harness/sdk").ConversationStreamStore;
|
|
96
96
|
attachmentStore?: import("@fabric-harness/sdk").AttachmentStore;
|
|
97
97
|
telemetry?: SubmissionTelemetrySink;
|
|
98
|
+
scheduler?: {
|
|
99
|
+
identity: () => {
|
|
100
|
+
tenantId: string;
|
|
101
|
+
actor: FabricActor;
|
|
102
|
+
};
|
|
103
|
+
leaseStore?: import("@fabric-harness/node").SchedulerLeaseStore;
|
|
104
|
+
catchUp: "skip" | "run-once";
|
|
105
|
+
};
|
|
98
106
|
}>;
|
|
99
107
|
/**
|
|
100
108
|
* Per-request on-behalf-of identity from Databricks Apps forwarded
|
package/dist/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,aAAa,EACb,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,eAAe,EACf,aAAa,EACb,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAU7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAA2B,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAE5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,gFAAgF;IAChF,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,iDAAiD;IACjD,IAAI,CAAC,EAAE,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|
export interface DatabricksAssetBundleOptions {
|
|
5
5
|
/** Directory containing the checked-in bundle's `databricks.yml`. */
|
|
6
6
|
bundleDir: string;
|
|
7
|
+
/**
|
|
8
|
+
* Logical bundle name from the named `assetBundles` map; scopes the managed-resource identity so
|
|
9
|
+
* lifecycles sharing one durable store never overwrite each other's records.
|
|
10
|
+
*/
|
|
11
|
+
instanceName?: string;
|
|
7
12
|
/** Bundle target (dev/prod) passed through to the Databricks CLI. */
|
|
8
13
|
target?: string;
|
|
9
14
|
/** Databricks CLI profile. */
|
|
@@ -18,6 +23,20 @@ export interface DatabricksAssetBundleOptions {
|
|
|
18
23
|
/** Label recorded as `createdBy`; never a token. */
|
|
19
24
|
principalLabel?: string;
|
|
20
25
|
}
|
|
26
|
+
/** Structured handoff from bounded bundle submission to Jobs/Lakeflow polling tools. */
|
|
27
|
+
export interface DatabricksAssetBundleRunResult {
|
|
28
|
+
submitted: true;
|
|
29
|
+
resourceKey: string;
|
|
30
|
+
runKind?: "job" | "pipeline";
|
|
31
|
+
/** Jobs run id, directly accepted by the Databricks jobs status/output tools. */
|
|
32
|
+
runId?: number;
|
|
33
|
+
/** Lakeflow pipeline id, paired with `updateId` for pipeline status polling. */
|
|
34
|
+
pipelineId?: string;
|
|
35
|
+
/** Lakeflow update id, paired with `pipelineId` for pipeline status polling. */
|
|
36
|
+
updateId?: string;
|
|
37
|
+
runUrl?: string;
|
|
38
|
+
output: string;
|
|
39
|
+
}
|
|
21
40
|
/**
|
|
22
41
|
* Governed lifecycle for a checked-in Databricks Asset Bundle (DAB).
|
|
23
42
|
*
|
|
@@ -40,6 +59,8 @@ export interface DatabricksAssetBundleOptions {
|
|
|
40
59
|
export declare class DatabricksAssetBundleLifecycle {
|
|
41
60
|
/** Resolved bundle directory; also the governed resource identity on the tools. */
|
|
42
61
|
readonly bundleDir: string;
|
|
62
|
+
/** Logical name of this bundle within a named `assetBundles` map; unset in the single-bundle form. */
|
|
63
|
+
readonly instanceName?: string;
|
|
43
64
|
private readonly target?;
|
|
44
65
|
private readonly profile?;
|
|
45
66
|
private readonly executable;
|
|
@@ -74,10 +95,7 @@ export declare class DatabricksAssetBundleLifecycle {
|
|
|
74
95
|
run(options: {
|
|
75
96
|
key: string;
|
|
76
97
|
restart?: boolean;
|
|
77
|
-
}): Promise<
|
|
78
|
-
submitted: true;
|
|
79
|
-
output: string;
|
|
80
|
-
}>;
|
|
98
|
+
}): Promise<DatabricksAssetBundleRunResult>;
|
|
81
99
|
/** Destroy a Harness-recorded bundle deployment and delete its managed record. */
|
|
82
100
|
destroy(options?: {
|
|
83
101
|
force?: boolean;
|
|
@@ -85,16 +103,48 @@ export declare class DatabricksAssetBundleLifecycle {
|
|
|
85
103
|
destroyed: true;
|
|
86
104
|
output: string;
|
|
87
105
|
}>;
|
|
88
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Bundle `name:` parsed from `databricks.yml`, falling back to the directory basename. Named
|
|
108
|
+
* bundles append `#instanceName` (and `#target` when set) so two lifecycles over the same manifest
|
|
109
|
+
* cannot collide in a shared managed-resource store; the single-bundle form keeps the bare name so
|
|
110
|
+
* existing records stay addressable.
|
|
111
|
+
*/
|
|
89
112
|
private resourceId;
|
|
90
113
|
private requireManifest;
|
|
91
114
|
private targetArgs;
|
|
92
115
|
private profileArgs;
|
|
93
116
|
}
|
|
94
117
|
export declare function databricksAssetBundleLifecycle(options: DatabricksAssetBundleOptions): DatabricksAssetBundleLifecycle;
|
|
118
|
+
/** Several checked-in bundles keyed by logical name; the key becomes the lifecycle's `instanceName`. */
|
|
119
|
+
export type DatabricksAssetBundleMapOptions = Record<string, Omit<DatabricksAssetBundleOptions, "instanceName">>;
|
|
120
|
+
/**
|
|
121
|
+
* Discriminates the single-bundle form from the named-bundle map. A map key literally called
|
|
122
|
+
* `bundleDir` still selects map mode because its value is an entry object, not a string.
|
|
123
|
+
*/
|
|
124
|
+
export declare function isDatabricksAssetBundleEntry(value: unknown): value is {
|
|
125
|
+
bundleDir: string;
|
|
126
|
+
} | DatabricksAssetBundleLifecycle;
|
|
127
|
+
/**
|
|
128
|
+
* Reject a named-bundle container that is not a plain object. Arrays are rejected too (isPlainObject
|
|
129
|
+
* excludes them): from untyped or parsed config they would otherwise enumerate as bundles named
|
|
130
|
+
* "0", "1", … Shared with `databricks()` so the config boundary and this helper report one message.
|
|
131
|
+
* Only the container is checked, so the assertion says nothing about the entries — each one is
|
|
132
|
+
* validated during enumeration in `databricksAssetBundleLifecycles`.
|
|
133
|
+
*/
|
|
134
|
+
export declare function requireDatabricksAssetBundleMap(value: unknown): asserts value is Record<string, unknown>;
|
|
135
|
+
/**
|
|
136
|
+
* Build one lifecycle per named bundle. Names are validated (they reach the model as tool input and
|
|
137
|
+
* the managed-resource store as ids) and sorted, so tool enums and dispatch stay deterministic.
|
|
138
|
+
* `defaults` are applied under each entry, letting a caller set one `principalLabel` for every bundle.
|
|
139
|
+
*/
|
|
140
|
+
export declare function databricksAssetBundleLifecycles(options: DatabricksAssetBundleMapOptions, defaults?: Omit<DatabricksAssetBundleOptions, "bundleDir" | "instanceName">): Map<string, DatabricksAssetBundleLifecycle>;
|
|
95
141
|
/**
|
|
96
142
|
* Model-facing tools for the governed bundle lifecycle. Write tools are approval-gated
|
|
97
143
|
* by the `databricks()` bundle like every other authoring surface.
|
|
144
|
+
*
|
|
145
|
+
* A single bundle keeps bundle-free tool schemas; a named map adds a required `bundle` selector to
|
|
146
|
+
* every schema (even with one entry, so the schema and its approval digests stay stable when a second
|
|
147
|
+
* bundle is added) and governs only the bundle the call actually names.
|
|
98
148
|
*/
|
|
99
|
-
export declare function databricksAssetBundleTools(options: DatabricksAssetBundleOptions | DatabricksAssetBundleLifecycle): ToolDef[];
|
|
149
|
+
export declare function databricksAssetBundleTools(options: DatabricksAssetBundleOptions | DatabricksAssetBundleLifecycle | DatabricksAssetBundleMapOptions | Map<string, DatabricksAssetBundleLifecycle>): ToolDef[];
|
|
100
150
|
//# sourceMappingURL=asset-bundles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-bundles.d.ts","sourceRoot":"","sources":["../src/asset-bundles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,KAAK,8BAA8B,EAIpC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"asset-bundles.d.ts","sourceRoot":"","sources":["../src/asset-bundles.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAc,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,KAAK,8BAA8B,EAIpC,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,WAAW,4BAA4B;IAC3C,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,iEAAiE;IACjE,GAAG,CAAC,EAAE,uBAAuB,CAAC;IAC9B,4DAA4D;IAC5D,KAAK,CAAC,EAAE,8BAA8B,CAAC;IACvC,oDAAoD;IACpD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wFAAwF;AACxF,MAAM,WAAW,8BAA8B;IAC7C,SAAS,EAAE,IAAI,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAC7B,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAC;I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= class extends Error {
|
|
|
58664
58664
|
this.runId = runId;
|
|
58665
58665
|
}
|
|
58666
58666
|
};
|
|
58667
|
+
var DatabricksRunNotAllowedError = class extends Error {
|
|
58668
|
+
constructor(message) {
|
|
58669
|
+
super(message);
|
|
58670
|
+
this.name = "DatabricksRunNotAllowedError";
|
|
58671
|
+
}
|
|
58672
|
+
};
|
|
58673
|
+
function validateDatabricksJobRunPolicy(policy) {
|
|
58674
|
+
if (policy.allowAnyJobId === true) return;
|
|
58675
|
+
const ids = policy.allowedJobIds;
|
|
58676
|
+
if (!Array.isArray(ids) || ids.length === 0)
|
|
58677
|
+
throw new Error("databricks jobs: runPolicy.allowedJobIds must be non-empty when configured.");
|
|
58678
|
+
for (const id of ids)
|
|
58679
|
+
if (!Number.isSafeInteger(id) || id < 0)
|
|
58680
|
+
throw new Error(
|
|
58681
|
+
"databricks jobs: runPolicy.allowedJobIds must contain non-negative integer job ids."
|
|
58682
|
+
);
|
|
58683
|
+
}
|
|
58684
|
+
function validateDatabricksNotebookRunPolicy(policy) {
|
|
58685
|
+
if (policy.allowAnyNotebookPath === true) return;
|
|
58686
|
+
const paths = policy.allowedNotebookPaths ?? [];
|
|
58687
|
+
const prefixes = policy.allowedNotebookPathPrefixes ?? [];
|
|
58688
|
+
if (paths.length === 0 && prefixes.length === 0)
|
|
58689
|
+
throw new Error(
|
|
58690
|
+
"databricks jobs: notebookPolicy must configure a non-empty allowedNotebookPaths or allowedNotebookPathPrefixes."
|
|
58691
|
+
);
|
|
58692
|
+
for (const [name, values] of [
|
|
58693
|
+
["allowedNotebookPaths", paths],
|
|
58694
|
+
["allowedNotebookPathPrefixes", prefixes]
|
|
58695
|
+
]) {
|
|
58696
|
+
for (const value of values) {
|
|
58697
|
+
if (typeof value !== "string" || !value.startsWith("/"))
|
|
58698
|
+
throw new Error(
|
|
58699
|
+
`databricks jobs: notebookPolicy.${name} entries must be absolute workspace paths.`
|
|
58700
|
+
);
|
|
58701
|
+
if (hasParentSegment(value))
|
|
58702
|
+
throw new Error(
|
|
58703
|
+
`databricks jobs: notebookPolicy.${name} entries cannot contain a ".." segment.`
|
|
58704
|
+
);
|
|
58705
|
+
}
|
|
58706
|
+
}
|
|
58707
|
+
}
|
|
58708
|
+
function hasParentSegment(path3) {
|
|
58709
|
+
return path3.split("/").includes("..");
|
|
58710
|
+
}
|
|
58711
|
+
function notebookPathAllowed(policy, path3) {
|
|
58712
|
+
if (policy.allowedNotebookPaths?.includes(path3)) return true;
|
|
58713
|
+
return (policy.allowedNotebookPathPrefixes ?? []).some((prefix) => {
|
|
58714
|
+
const normalized = prefix.length > 1 && prefix.endsWith("/") ? prefix.slice(0, -1) : prefix;
|
|
58715
|
+
return normalized === path3 || path3.startsWith(`${normalized}/`);
|
|
58716
|
+
});
|
|
58717
|
+
}
|
|
58667
58718
|
var DatabricksJobs = class {
|
|
58668
|
-
constructor(client2) {
|
|
58719
|
+
constructor(client2, options = {}) {
|
|
58669
58720
|
this.client = client2;
|
|
58721
|
+
if (options.runPolicy !== void 0) validateDatabricksJobRunPolicy(options.runPolicy);
|
|
58722
|
+
if (options.notebookPolicy !== void 0)
|
|
58723
|
+
validateDatabricksNotebookRunPolicy(options.notebookPolicy);
|
|
58724
|
+
this.runPolicy = options.runPolicy;
|
|
58725
|
+
this.notebookPolicy = options.notebookPolicy;
|
|
58670
58726
|
}
|
|
58671
58727
|
client;
|
|
58728
|
+
runPolicy;
|
|
58729
|
+
notebookPolicy;
|
|
58672
58730
|
async runJob(input) {
|
|
58731
|
+
this.assertJobAllowed(input.jobId);
|
|
58673
58732
|
const idempotencyToken = input.idempotencyToken ?? crypto.randomUUID();
|
|
58674
58733
|
const request = {
|
|
58675
58734
|
jobId: BigInt(input.jobId),
|
|
@@ -58682,6 +58741,7 @@ var DatabricksJobs = class {
|
|
|
58682
58741
|
return receipt(waiter.runId, void 0, idempotencyToken, "job");
|
|
58683
58742
|
}
|
|
58684
58743
|
async submitNotebook(input) {
|
|
58744
|
+
this.assertNotebookAllowed(input.notebookPath);
|
|
58685
58745
|
const idempotencyToken = input.idempotencyToken ?? crypto.randomUUID();
|
|
58686
58746
|
const request = {
|
|
58687
58747
|
idempotencyToken,
|
|
@@ -58754,9 +58814,27 @@ var DatabricksJobs = class {
|
|
|
58754
58814
|
await store.put({ scope, ref, bytes });
|
|
58755
58815
|
return ref;
|
|
58756
58816
|
}
|
|
58817
|
+
/** Bound checked before `runNow`, so an out-of-policy id never reaches the workspace. */
|
|
58818
|
+
assertJobAllowed(jobId2) {
|
|
58819
|
+
const policy = this.runPolicy;
|
|
58820
|
+
if (!policy || policy.allowAnyJobId === true) return;
|
|
58821
|
+
if (!(policy.allowedJobIds ?? []).includes(jobId2))
|
|
58822
|
+
throw new DatabricksRunNotAllowedError(
|
|
58823
|
+
`databricks jobs: job ${jobId2} is not in the configured run allowlist.`
|
|
58824
|
+
);
|
|
58825
|
+
}
|
|
58826
|
+
/** Bound checked before `submitRun`, so an out-of-policy notebook is never executed. */
|
|
58827
|
+
assertNotebookAllowed(notebookPath) {
|
|
58828
|
+
const policy = this.notebookPolicy;
|
|
58829
|
+
if (!policy || policy.allowAnyNotebookPath === true) return;
|
|
58830
|
+
if (hasParentSegment(notebookPath) || !notebookPathAllowed(policy, notebookPath))
|
|
58831
|
+
throw new DatabricksRunNotAllowedError(
|
|
58832
|
+
`databricks jobs: notebook path ${JSON.stringify(notebookPath)} is not in the configured run allowlist.`
|
|
58833
|
+
);
|
|
58834
|
+
}
|
|
58757
58835
|
};
|
|
58758
|
-
function databricksJobs(client2) {
|
|
58759
|
-
return new DatabricksJobs(client2);
|
|
58836
|
+
function databricksJobs(client2, options) {
|
|
58837
|
+
return new DatabricksJobs(client2, options);
|
|
58760
58838
|
}
|
|
58761
58839
|
function receipt(runIdValue, numberInJobValue, idempotencyToken, kind) {
|
|
58762
58840
|
if (runIdValue === void 0)
|
|
@@ -58916,6 +58994,39 @@ function defaultPoolFactory() {
|
|
|
58916
58994
|
return (config2) => new PoolCtor(config2);
|
|
58917
58995
|
}
|
|
58918
58996
|
|
|
58997
|
+
// src/resource-policy.ts
|
|
58998
|
+
var DatabricksResourceNotAllowedError = class extends Error {
|
|
58999
|
+
code = "DATABRICKS_RESOURCE_NOT_ALLOWED";
|
|
59000
|
+
resourceKind;
|
|
59001
|
+
constructor(resourceKind) {
|
|
59002
|
+
super(`Databricks ${resourceKind} is not allowed by the configured policy.`);
|
|
59003
|
+
this.name = "DatabricksResourceNotAllowedError";
|
|
59004
|
+
this.resourceKind = resourceKind;
|
|
59005
|
+
}
|
|
59006
|
+
};
|
|
59007
|
+
function resolveExactResourcePolicy(policy, allowedKey, allowAnyKey, resourceKind) {
|
|
59008
|
+
if (!policy || typeof policy !== "object" || Array.isArray(policy))
|
|
59009
|
+
throw new TypeError(`Databricks ${resourceKind} policy must be an object.`);
|
|
59010
|
+
const value = policy;
|
|
59011
|
+
const allowed = value[allowedKey];
|
|
59012
|
+
const allowAny = value[allowAnyKey];
|
|
59013
|
+
if (allowAny === true && allowed === void 0) return void 0;
|
|
59014
|
+
if (Array.isArray(allowed) && allowed.length > 0 && allowed.every((entry) => typeof entry === "string" && entry.trim().length > 0) && allowAny === void 0)
|
|
59015
|
+
return [...new Set(allowed.map((entry) => entry.trim()))];
|
|
59016
|
+
throw new TypeError(
|
|
59017
|
+
`Databricks ${resourceKind} policy must set either non-empty ${allowedKey} or ${allowAnyKey}: true.`
|
|
59018
|
+
);
|
|
59019
|
+
}
|
|
59020
|
+
function assertExactResourceAllowed(resourceKind, value, allowed) {
|
|
59021
|
+
if (allowed && !allowed.includes(value.trim()))
|
|
59022
|
+
throw new DatabricksResourceNotAllowedError(resourceKind);
|
|
59023
|
+
}
|
|
59024
|
+
function pinnedStringResourceSchema(allowed) {
|
|
59025
|
+
if (!allowed) return { type: "string" };
|
|
59026
|
+
if (allowed.length === 1) return { type: "string", const: allowed[0] };
|
|
59027
|
+
return { type: "string", enum: [...allowed] };
|
|
59028
|
+
}
|
|
59029
|
+
|
|
58919
59030
|
// src/lakeflow.ts
|
|
58920
59031
|
function databricksPipelineStatusTool(client2, options = {}) {
|
|
58921
59032
|
return {
|
|
@@ -58931,21 +59042,38 @@ function databricksPipelineStatusTool(client2, options = {}) {
|
|
|
58931
59042
|
execute: (input) => client2.get({ pipelineId: input.pipelineId })
|
|
58932
59043
|
};
|
|
58933
59044
|
}
|
|
58934
|
-
function databricksPipelineStartTool(client2, options = {}) {
|
|
59045
|
+
function databricksPipelineStartTool(client2, runPolicy, options = {}) {
|
|
59046
|
+
const allowedPipelineIds = resolveExactResourcePolicy(
|
|
59047
|
+
runPolicy,
|
|
59048
|
+
"allowedPipelineIds",
|
|
59049
|
+
"allowAnyPipelineId",
|
|
59050
|
+
"Lakeflow pipeline"
|
|
59051
|
+
);
|
|
58935
59052
|
return {
|
|
58936
59053
|
name: options.name ?? "databricks_pipeline_start",
|
|
58937
59054
|
description: options.description ?? "Trigger a Lakeflow pipeline update (run). Set fullRefresh to reprocess all data.",
|
|
58938
59055
|
inputSchema: {
|
|
58939
59056
|
type: "object",
|
|
58940
59057
|
additionalProperties: false,
|
|
58941
|
-
properties: {
|
|
59058
|
+
properties: {
|
|
59059
|
+
pipelineId: pinnedStringResourceSchema(allowedPipelineIds),
|
|
59060
|
+
fullRefresh: { type: "boolean" }
|
|
59061
|
+
},
|
|
58942
59062
|
required: ["pipelineId"]
|
|
58943
59063
|
},
|
|
58944
|
-
metadata: {
|
|
58945
|
-
|
|
58946
|
-
|
|
58947
|
-
|
|
58948
|
-
|
|
59064
|
+
metadata: {
|
|
59065
|
+
effect: "execute",
|
|
59066
|
+
provider: "databricks",
|
|
59067
|
+
service: "lakeflow",
|
|
59068
|
+
governance: { resources: [{ kind: "pipeline", path: "/pipelineId" }] }
|
|
59069
|
+
},
|
|
59070
|
+
async execute(input) {
|
|
59071
|
+
assertExactResourceAllowed("Lakeflow pipeline", input.pipelineId, allowedPipelineIds);
|
|
59072
|
+
return await client2.start({
|
|
59073
|
+
pipelineId: input.pipelineId,
|
|
59074
|
+
...input.fullRefresh !== void 0 ? { fullRefresh: input.fullRefresh } : {}
|
|
59075
|
+
});
|
|
59076
|
+
}
|
|
58949
59077
|
};
|
|
58950
59078
|
}
|
|
58951
59079
|
|
|
@@ -60350,7 +60478,9 @@ var checks = [
|
|
|
60350
60478
|
description: "A Lakeflow mutation is classified as approval-required for the data steward.",
|
|
60351
60479
|
configured: Boolean(env2.DATABRICKS_PIPELINE_ID),
|
|
60352
60480
|
run: () => {
|
|
60353
|
-
const tool7 = databricksPipelineStartTool(native.pipelines
|
|
60481
|
+
const tool7 = databricksPipelineStartTool(native.pipelines, {
|
|
60482
|
+
allowedPipelineIds: [requiredEnv("DATABRICKS_PIPELINE_ID")]
|
|
60483
|
+
});
|
|
60354
60484
|
const policy = databricksGovernancePolicy({
|
|
60355
60485
|
tools: [tool7],
|
|
60356
60486
|
host,
|
|
@@ -60850,7 +60980,15 @@ var checks = [
|
|
|
60850
60980
|
throw new Error("Expected the OBO user to read the differential table.");
|
|
60851
60981
|
if (expected === "app-allowed" && !appAllowed)
|
|
60852
60982
|
throw new Error("Expected the App principal to read the differential table.");
|
|
60853
|
-
return {
|
|
60983
|
+
return {
|
|
60984
|
+
appAllowed,
|
|
60985
|
+
userAllowed,
|
|
60986
|
+
expected,
|
|
60987
|
+
credential: {
|
|
60988
|
+
acquisitionMode: env2.FABRIC_DATABRICKS_OBO_ACQUISITION_MODE ?? "unspecified",
|
|
60989
|
+
remainingSecondsAtCheck: jwtRemainingSeconds(requiredEnv("DATABRICKS_OBO_TOKEN"))
|
|
60990
|
+
}
|
|
60991
|
+
};
|
|
60854
60992
|
}
|
|
60855
60993
|
},
|
|
60856
60994
|
{
|
|
@@ -61206,6 +61344,19 @@ function requiredEnv(name) {
|
|
|
61206
61344
|
if (!value) throw new Error(`${name} is required for Databricks certification.`);
|
|
61207
61345
|
return value;
|
|
61208
61346
|
}
|
|
61347
|
+
function jwtRemainingSeconds(token, nowMs = Date.now()) {
|
|
61348
|
+
const payload = token.split(".")[1];
|
|
61349
|
+
if (!payload) throw new Error("Databricks OBO token does not contain JWT claims.");
|
|
61350
|
+
let claims;
|
|
61351
|
+
try {
|
|
61352
|
+
claims = JSON.parse(Buffer.from(payload, "base64url").toString("utf8"));
|
|
61353
|
+
} catch {
|
|
61354
|
+
throw new Error("Databricks OBO token contains invalid JWT claims.");
|
|
61355
|
+
}
|
|
61356
|
+
if (typeof claims.exp !== "number" || !Number.isFinite(claims.exp))
|
|
61357
|
+
throw new Error("Databricks OBO token does not contain a numeric expiry.");
|
|
61358
|
+
return Math.floor(claims.exp - nowMs / 1e3);
|
|
61359
|
+
}
|
|
61209
61360
|
function assertTruthy(value, message) {
|
|
61210
61361
|
if (!value) throw new Error(message);
|
|
61211
61362
|
}
|