@terminal3/t3n-sdk 0.6.0 → 0.7.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/dist/index.d.ts +26 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/src/client/actions.d.ts +5 -0
- package/dist/src/client/t3n-client.d.ts +19 -1
- package/dist/src/types/auth.d.ts +7 -2
- package/dist/wasm/generated/interfaces/component-session-server-auth.d.ts +2 -1
- package/dist/wasm/generated/session.core.wasm +0 -0
- package/dist/wasm/generated/session.js +4119 -794
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -278,11 +278,16 @@ declare enum AuthMethod {
|
|
|
278
278
|
OIDC = "oidc"
|
|
279
279
|
}
|
|
280
280
|
/**
|
|
281
|
-
* OIDC credentials interface
|
|
281
|
+
* OIDC credentials interface.
|
|
282
|
+
*
|
|
283
|
+
* The TEE generates a session-binding nonce that must be included in
|
|
284
|
+
* the Google authorization URL (`&nonce=…`). The `getIdToken` callback
|
|
285
|
+
* receives this nonce and must return the `id_token` JWT obtained
|
|
286
|
+
* from the OIDC provider with the nonce baked into its claims.
|
|
282
287
|
*/
|
|
283
288
|
interface OidcCredentials {
|
|
284
289
|
provider: string;
|
|
285
|
-
|
|
290
|
+
getIdToken: (nonce: string) => Promise<string>;
|
|
286
291
|
}
|
|
287
292
|
/**
|
|
288
293
|
* Base authentication input with method discriminator
|
|
@@ -522,9 +527,27 @@ declare class T3nClient {
|
|
|
522
527
|
*/
|
|
523
528
|
handshake(): Promise<HandshakeResult>;
|
|
524
529
|
/**
|
|
525
|
-
* Authenticate with the T3n node
|
|
530
|
+
* Authenticate with the T3n node.
|
|
531
|
+
*
|
|
532
|
+
* For OIDC, this runs a two-step nonce-bound flow:
|
|
533
|
+
* 1. Sends `InitOidcAuth` to server → receives session-binding nonce.
|
|
534
|
+
* 2. Calls `getIdToken(nonce)` callback so the app can include the
|
|
535
|
+
* nonce in the Google authorization URL.
|
|
536
|
+
* 3. Sends `SubmitIdToken` with the nonce-bearing token → receives DID.
|
|
526
537
|
*/
|
|
527
538
|
authenticate(authInput: AuthInput): Promise<Did>;
|
|
539
|
+
/**
|
|
540
|
+
* OIDC two-step authentication with session-binding nonce.
|
|
541
|
+
*
|
|
542
|
+
* Bypasses the WASM client state machine and makes two encrypted
|
|
543
|
+
* RPC calls directly:
|
|
544
|
+
* 1. `InitOidcAuth { provider }` → server generates nonce → returns
|
|
545
|
+
* `ProvideNonce { nonce }`.
|
|
546
|
+
* 2. App calls `getIdToken(nonce)` to obtain a nonce-bound `id_token`.
|
|
547
|
+
* 3. `SubmitIdToken { id_token }` → server verifies token + nonce →
|
|
548
|
+
* returns `Finish { did }`.
|
|
549
|
+
*/
|
|
550
|
+
private authenticateOidc;
|
|
528
551
|
/**
|
|
529
552
|
* Execute an action on the T3n node
|
|
530
553
|
*/
|