@dbx-tools/databricks 0.6.183 → 0.6.186

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 CHANGED
@@ -1,6 +1,7 @@
1
1
  # @dbx-tools/databricks
2
2
 
3
- Databricks runtime, workspace, filesystem, cloud, and network utilities.
3
+ Databricks authentication, runtime, workspace, filesystem, cloud, and network
4
+ utilities.
4
5
 
5
6
  Import this package when backend code needs workspace URL/id discovery, cloud
6
7
  provider/region lookup, App runtime detection, DNS resolution, or public-IP
@@ -10,6 +11,10 @@ Key features:
10
11
 
11
12
  - Workspace URL and numeric workspace id resolution from AppKit context,
12
13
  Databricks SDK config, env, and config files.
14
+ - U2M browser OAuth, M2M client credentials, PAT, `app_obo`, and `app_sp`
15
+ authentication.
16
+ - Rust-backed App detection, CLI token access, file locks, and file-backed
17
+ caches.
13
18
  - `DatabricksFileSystem` (`FileSystem` over workspace files, UC volumes, and DBFS)
14
19
  with intelligent roots: `/Workspace/...`, `/Volumes/...` (also `/Volume/...` and
15
20
  `catalog.schema.volume`), `~` → `/Workspace/Users/<userName>`, and `/dbfs/...`.
@@ -21,13 +26,39 @@ Key features:
21
26
  - DNS A/AAAA lookup helpers for Databricks and adjacent service hosts.
22
27
  - Memoized outbound public-IP discovery for setup and diagnostics.
23
28
 
29
+ ## Authenticate
30
+
31
+ ```ts
32
+ import {
33
+ createPersistentAuth,
34
+ createPersistentAuthForRequest,
35
+ DatabricksAuthOptions,
36
+ } from "@dbx-tools/databricks";
37
+
38
+ const auth = await createPersistentAuth(DatabricksAuthOptions.create({}));
39
+ const token = await auth.token();
40
+ ```
41
+
42
+ Inside a Databricks App, request-scoped auth prefers OBO, then falls back to the
43
+ ambient service principal:
44
+
45
+ ```ts
46
+ const requestHeaders = new Map<string, string>();
47
+ const forwardedToken = req.header("x-forwarded-access-token");
48
+ if (forwardedToken) requestHeaders.set("x-forwarded-access-token", forwardedToken);
49
+ const auth = await createPersistentAuthForRequest(DatabricksAuthOptions.create({}), requestHeaders);
50
+ ```
51
+
52
+ OBO tokens are forwarded directly without caching. `app_sp` shares the complete
53
+ M2M client-credentials implementation. Set `authType` or `profile` explicitly
54
+ to override automatic App resolution.
55
+
24
56
  ## Relationship To Native AppKit
25
57
 
26
58
  Use native AppKit for its standard workspace client and plugin integrations.
27
59
  Use this package when code needs Databricks filesystem root normalization,
28
60
  cloud region discovery, network helpers, or workspace identity fallbacks
29
- outside an AppKit request. Use [`@dbx-tools/client`](../client) for Rust-backed
30
- App detection and authentication.
61
+ outside an AppKit request, or when direct Rust-backed authentication is needed.
31
62
 
32
63
  ## Databricks filesystem
33
64
 
package/index.ts CHANGED
@@ -3,7 +3,8 @@
3
3
  // Hand edits are overwritten on the next watch; this file is read-only.
4
4
 
5
5
  export const PACKAGE_IDENTIFIER = "@dbx-tools/databricks";
6
- export const PACKAGE_VERSION = "0.6.183";
6
+ export const PACKAGE_VERSION = "0.6.186";
7
+ export * from "./src/bindings.ts";
7
8
  export * as cloud from "./src/cloud.ts";
8
9
  export * as databricksFS from "./src/databricks-fs.ts";
9
10
  export * as databricksPath from "./src/databricks-path.ts";