@dbx-tools/auth 0.6.161 → 0.6.167
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 +33 -45
- package/index.ts +3 -4
- package/lib/index.js +1631 -7
- package/package.json +16 -40
- package/src/_bindings-ffi.ts +715 -0
- package/src/_bindings.ts +1794 -0
- package/src/bindings.ts +12 -0
- package/lib/index.d.ts +0 -5
- package/lib/src/auth.d.ts +0 -47
- package/lib/src/auth.js +0 -217
- package/lib/src/storage.d.ts +0 -31
- package/lib/src/storage.js +0 -120
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/src/auth.ts +0 -265
- package/src/storage.ts +0 -161
package/README.md
CHANGED
|
@@ -1,50 +1,38 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @dbx-tools/auth
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Key features:
|
|
7
|
-
|
|
8
|
-
- Better Auth ownership of users, sessions, OTP lifecycle, rate limits, and
|
|
9
|
-
passkey credentials;
|
|
10
|
-
- session-required passkey enrollment and discoverable passkey login;
|
|
11
|
-
- POST and browser-redirect logout routes with a same-origin destination;
|
|
12
|
-
- caller-provided `authorizeIdentity`, email sender, secret, origin, and
|
|
13
|
-
database;
|
|
14
|
-
- native AppKit Lakebase pool or local SQLite storage;
|
|
15
|
-
- programmatic Better Auth migrations under advisory or file locks.
|
|
16
|
-
|
|
17
|
-
## Relationship To Native AppKit
|
|
18
|
-
|
|
19
|
-
Use the Databricks Apps front door and AppKit execution context when traffic
|
|
20
|
-
arrives through the platform. Use this package for a public tunnel or another
|
|
21
|
-
route that bypasses that identity-aware proxy and therefore needs its own
|
|
22
|
-
passwordless session. A passkey session proves the configured identity only; it
|
|
23
|
-
does not mint a Databricks OBO access token.
|
|
3
|
+
Generated Node bindings for [provider-neutral Rust authentication](../../../rs/auth).
|
|
4
|
+
This is outbound OAuth, not the incoming [`@dbx-tools/auth-gate`](../auth-gate).
|
|
24
5
|
|
|
25
6
|
```ts
|
|
26
|
-
import {
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
sendCode: async (email, code) => sendEmail(email, code),
|
|
40
|
-
});
|
|
7
|
+
import { createProviderAuth, ProviderOptions, OAuthGrant } from "@dbx-tools/auth";
|
|
8
|
+
|
|
9
|
+
const auth = await createProviderAuth(
|
|
10
|
+
ProviderOptions.create({
|
|
11
|
+
provider: "example",
|
|
12
|
+
tokenEndpoint: "https://identity.example.com/oauth/token",
|
|
13
|
+
clientId: process.env.OAUTH_CLIENT_ID!,
|
|
14
|
+
clientSecret: process.env.OAUTH_CLIENT_SECRET!,
|
|
15
|
+
grant: OAuthGrant.ClientCredentials,
|
|
16
|
+
scopes: ["read"],
|
|
17
|
+
}),
|
|
18
|
+
);
|
|
19
|
+
const token = await auth.token(false);
|
|
41
20
|
```
|
|
42
21
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
22
|
+
Omit `profile` for providers without profiles. `fileLayout` selects one shared
|
|
23
|
+
file or a separate file per provider/profile/sorted-scope identity. `cacheDir`
|
|
24
|
+
overrides the file location. Rust owns storage, locking, refresh, and browser
|
|
25
|
+
authorization; the TypeScript API is generated, not copied.
|
|
26
|
+
|
|
27
|
+
Both `ProviderOptions.auth` and `DatabricksAuthOptions.auth` accept the same
|
|
28
|
+
`AuthOptions` exported here. For example,
|
|
29
|
+
`auth: AuthOptions.create({ lockTimeoutSeconds: 10n })` overrides only the lock
|
|
30
|
+
timeout. Omit `auth` to use Rust defaults. Move former top-level timeout and
|
|
31
|
+
`callbackImageSrc` fields into this record; see the
|
|
32
|
+
[shared options guide](../../../rs/auth/README.md#shared-options-and-provider-implementations).
|
|
33
|
+
|
|
34
|
+
Use `StorageAdapter` for custom persistence. Wrap it with `createStorageHandle`
|
|
35
|
+
before passing it to either `createProviderAuthWithStorage` or
|
|
36
|
+
`@dbx-tools/databricks-auth`'s `createPersistentAuthWithStorage`. No Postgres client is bundled.
|
|
37
|
+
The standard package root exports generated contracts and `uniffiModule`, the
|
|
38
|
+
generator-owned converter table used by dependent bindings.
|
package/index.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
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/auth";
|
|
6
|
-
export * as
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export type { AuthStorageMode, AuthStorageConfig, ResolvedAuthStorageConfig, AuthDatabase, AuthStorage } from "./src/storage.ts";
|
|
6
|
+
export * as bindings from "./src/bindings.ts";
|
|
7
|
+
export { uniffiModule } from "./src/bindings.ts";
|
|
8
|
+
export * from "./exports.ts";
|