@gravity-rail/sdk 3.1.0 → 4.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 +16 -1
- package/dist/{chat-interaction-DwH4z1qk.d.ts → chat-interaction-DXgKjFqZ.d.cts} +497 -523
- package/dist/{chat-interaction-ClNfn1UV.d.cts → chat-interaction-a7U-tHfQ.d.ts} +497 -523
- package/dist/{chunk-ANVLMZLD.js → chunk-WHRIIBJ4.js} +182 -145
- package/dist/chunk-WHRIIBJ4.js.map +1 -0
- package/dist/{chunk-RLFS7O2L.js → chunk-ZLF3N3ZD.js} +183 -81
- package/dist/chunk-ZLF3N3ZD.js.map +1 -0
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +2 -2
- package/dist/helpers.d.ts +2 -2
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +340 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +368 -225
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +45 -9
- package/dist/internal.d.ts +45 -9
- package/dist/internal.js +14 -6
- package/dist/internal.js.map +1 -1
- package/dist/{member-import-IN06xJrR.d.cts → member-import-BHtOru8g.d.cts} +1 -1
- package/dist/{member-import-D-_eJBE7.d.ts → member-import-VOLKR5dY.d.ts} +1 -1
- package/dist/{path-D_KPlBIr.d.cts → path-B3b3_El9.d.cts} +36 -18
- package/dist/{path-D4S8xYyo.d.ts → path-CUY-Iw70.d.ts} +36 -18
- package/dist/schemas.cjs +2 -4
- package/dist/schemas.cjs.map +1 -1
- package/dist/schemas.d.cts +21 -22
- package/dist/schemas.d.ts +21 -22
- package/dist/schemas.js +2 -4
- package/dist/schemas.js.map +1 -1
- package/dist/{tasks-C8sHnwH5.d.cts → tasks-CgptqCsN.d.cts} +17 -48
- package/dist/{tasks-C8sHnwH5.d.ts → tasks-CgptqCsN.d.ts} +17 -48
- package/package.json +3 -3
- package/dist/chunk-ANVLMZLD.js.map +0 -1
- package/dist/chunk-RLFS7O2L.js.map +0 -1
package/README.md
CHANGED
|
@@ -118,7 +118,22 @@ const client = new GravityRailClient(undefined, window.location.origin);
|
|
|
118
118
|
|
|
119
119
|
A cross-origin `baseUrl` with no credential makes unauthenticated calls.
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
An organization authentication challenge (`WWW-Authenticate: Bearer realm="org"`) calls your `setOrgAuthHandler` handler. A bearer handler returns an opaque organization session candidate; it must not call `setOrgSession` during the handler:
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
client.setOrgAuthHandler(async ({ orgUuid, authUrl, acrValues }) => {
|
|
125
|
+
const session = await signInToOrganization({ orgUuid, authUrl, acrValues });
|
|
126
|
+
return { session, orgUuid, source: 'new' };
|
|
127
|
+
});
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`source: 'new'` means the server issued this session during the attempt; it does not establish MFA or reset its authentication time. A handler may return `source: 'cache'` only for a previously saved candidate, before `sessionRejected` is true. It may supply `onRejected` to remove that exact candidate from its cache. Compare the stored credential before removal so an old rejection cannot erase a newer login.
|
|
131
|
+
|
|
132
|
+
The SDK adopts a result only while the handler still owns its original credential context. It sends the candidate as `X-Org-Session` for server validation. A newly issued candidate gets one retry. A bearer request that starts without an org session may validate a cache candidate first, then make one new sign-in attempt if rejected. An empty cache does not permit two new sign-ins. Account MFA recovery has its own one-attempt budget. A concurrent login supersedes an older handler; its failure or delayed result cannot clear the newer credential. `setOrgSession` remains available for configuration outside a handler.
|
|
133
|
+
|
|
134
|
+
A same-origin cookie handler may resolve without a result after sign-in sets the httpOnly org cookie; the SDK retries once with that cookie.
|
|
135
|
+
|
|
136
|
+
`acrValues` reports the server's requested authentication context. The SDK and CLI do not forward Gravity Rail's `urn:gravity:mfa` value as a provider-specific OIDC hint. For SSO with required MFA, configure the identity provider to require MFA and return verified authentication methods. An insufficient newly issued session fails with guidance to complete Account MFA or check the identity provider configuration; the SDK does not repeat interactive sign-in.
|
|
122
137
|
|
|
123
138
|
## Core Concepts
|
|
124
139
|
|