axiam-sdk 1.1.2 → 1.2.2
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 +73 -3
- package/dist/amqp/index.js.map +1 -1
- package/dist/amqp/index.mjs.map +1 -1
- package/dist/browser/index.d.cts +1 -1
- package/dist/browser/index.d.ts +1 -1
- package/dist/{client-BGFn1VQh.d.cts → client-Bp7riC4k.d.cts} +147 -3
- package/dist/{client-DrQZZ1js.d.ts → client-CaurIxje.d.ts} +147 -3
- package/dist/{cookieJar-BTmpjXZe.d.ts → cookieJar-DC4GLKrJ.d.ts} +2 -2
- package/dist/{cookieJar-BqYOnNN-.d.cts → cookieJar-oKazfbN1.d.cts} +2 -2
- package/dist/{errors-DZ3k8a8i.d.cts → errors-CWlh-wcm.d.cts} +7 -1
- package/dist/{errors-DZ3k8a8i.d.ts → errors-CWlh-wcm.d.ts} +7 -1
- package/dist/{errors-dlGXAsbh.d.ts → errors-DDo3oxcH.d.ts} +1 -1
- package/dist/{errors-RvGlTyUj.d.cts → errors-DHauOsqx.d.cts} +1 -1
- package/dist/grpc/index.d.cts +4 -4
- package/dist/grpc/index.d.ts +4 -4
- package/dist/grpc/index.js +26 -5
- package/dist/grpc/index.js.map +1 -1
- package/dist/grpc/index.mjs +26 -5
- package/dist/grpc/index.mjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -5
- package/dist/index.mjs.map +1 -1
- package/dist/middleware/index.d.cts +5 -5
- package/dist/middleware/index.d.ts +5 -5
- package/dist/middleware/index.js +164 -12
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware/index.mjs +164 -12
- package/dist/middleware/index.mjs.map +1 -1
- package/dist/nestjs/index.js.map +1 -1
- package/dist/nestjs/index.mjs.map +1 -1
- package/dist/node/index.d.cts +15 -4
- package/dist/node/index.d.ts +15 -4
- package/dist/node/index.js +186 -14
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +185 -15
- package/dist/node/index.mjs.map +1 -1
- package/dist/{oidcState-C3VLn3eD.d.ts → oidcState-CZhj0MBP.d.ts} +123 -5
- package/dist/{oidcState-BaJ-SM_R.d.cts → oidcState-EnEJmoF5.d.cts} +123 -5
- package/dist/rest/index.d.cts +6 -6
- package/dist/rest/index.d.ts +6 -6
- package/dist/rest/index.js +26 -5
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/index.mjs +26 -5
- package/dist/rest/index.mjs.map +1 -1
- package/dist/{session-B03NsqVs.d.ts → session-Beo11VT_.d.ts} +9 -0
- package/dist/{session-plDr4lFu.d.cts → session-CeIUXgpE.d.cts} +9 -0
- package/package.json +18 -18
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KeyObject } from 'node:crypto';
|
|
2
|
-
import { O as OAuthProtocolError } from './errors-
|
|
2
|
+
import { O as OAuthProtocolError } from './errors-CWlh-wcm.js';
|
|
3
3
|
import { S as Sensitive } from './sensitive-BC_s7Rrd.js';
|
|
4
|
-
import { S as SharedSession } from './session-
|
|
4
|
+
import { S as SharedSession } from './session-Beo11VT_.js';
|
|
5
5
|
import { I as IdTokenClaims } from './jwks-CTVpOWzI.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -276,6 +276,19 @@ interface OidcParParams {
|
|
|
276
276
|
* request over the back channel in the first place.
|
|
277
277
|
*/
|
|
278
278
|
dpopJkt?: string;
|
|
279
|
+
/**
|
|
280
|
+
* The provider hint to push (contract 1.65, §26.2 rule 8): the same optional
|
|
281
|
+
* `idpHint` {@link OidcBeginParams.idpHint} takes, validated the same way.
|
|
282
|
+
* When set, the pushed form carries `axiam_idp_hint` exactly once; it is
|
|
283
|
+
* absent otherwise. It rides the pushed body only — the authorization URL
|
|
284
|
+
* built from the `request_uri` stays exactly `client_id` and `request_uri`.
|
|
285
|
+
*
|
|
286
|
+
* @remarks
|
|
287
|
+
* When this is unset, the `axiam_idp_hint` that the `oidcBegin` URL
|
|
288
|
+
* ({@link OidcParParams.request}) carries is pushed instead (D-N36); when
|
|
289
|
+
* both are set, this argument wins and the URL's hint is not pushed.
|
|
290
|
+
*/
|
|
291
|
+
idpHint?: string;
|
|
279
292
|
}
|
|
280
293
|
/**
|
|
281
294
|
* The result of a pushed authorization request (CONTRACT.md §26.1).
|
|
@@ -320,6 +333,21 @@ interface OidcBeginParams {
|
|
|
320
333
|
* attempting to override one of those eight throws.
|
|
321
334
|
*/
|
|
322
335
|
extraParams?: Record<string, string>;
|
|
336
|
+
/**
|
|
337
|
+
* Which sign-in provider to send the browser to (contract 1.65, §12.1
|
|
338
|
+
* "`idp_hint`"): a provider's UUID, its `provider_slug` or a branded kind
|
|
339
|
+
* name (`google`, `apple`, …). Emitted as the single query parameter
|
|
340
|
+
* `axiam_idp_hint` — the ninth parameter of §12.1 rule 5 — and only when set.
|
|
341
|
+
*
|
|
342
|
+
* @remarks
|
|
343
|
+
* Validated for emptiness and length only: an empty string or one longer
|
|
344
|
+
* than 256 UTF-8 bytes throws a `ValidationError` and no URL is built. It is
|
|
345
|
+
* never trimmed, case-folded, parsed as a UUID or looked up. An unresolvable
|
|
346
|
+
* hint is ignored by the server, so there is nothing to handle on that
|
|
347
|
+
* outcome. When set it replaces any `axiam_idp_hint` in `extraParams`
|
|
348
|
+
* (emitted exactly once). There is no `kc_idp_hint` alias.
|
|
349
|
+
*/
|
|
350
|
+
idpHint?: string;
|
|
323
351
|
}
|
|
324
352
|
/**
|
|
325
353
|
* A token set returned by the OAuth2 token endpoint (wire schema
|
|
@@ -1098,6 +1126,37 @@ interface CibaAwaitParams {
|
|
|
1098
1126
|
* - a header record (`req.headers`), a value possibly an array.
|
|
1099
1127
|
*/
|
|
1100
1128
|
type CibaPingHeaders = readonly string[] | Iterable<readonly [string, string]> | Record<string, string | readonly string[] | undefined>;
|
|
1129
|
+
/** Options of `OidcClient.loginWithProviderIdToken` beyond its three positional inputs (§37.1). */
|
|
1130
|
+
interface LoginWithProviderIdTokenOptions {
|
|
1131
|
+
/**
|
|
1132
|
+
* Scopes to request, sent space-joined as `scope`. Sent **only when named**:
|
|
1133
|
+
* an omitted or empty list sends no `scope` field, which the server reads as
|
|
1134
|
+
* the empty set — no `openid`, hence no `id_token` in the response. The SDK
|
|
1135
|
+
* adds no scope of its own (§37.2 rule 7); pass `openid` to receive
|
|
1136
|
+
* `idClaims`.
|
|
1137
|
+
*/
|
|
1138
|
+
scopes?: readonly string[];
|
|
1139
|
+
/** An RFC 8707 `resource` indicator. Sent only when set. */
|
|
1140
|
+
resource?: string;
|
|
1141
|
+
/** Tenant UUID for the `tenant_id` query parameter (§12.3 rule 4). A slug-only client must pass it. */
|
|
1142
|
+
tenantId?: string;
|
|
1143
|
+
/** A pre-fetched discovery document. Fetched via `oidcDiscover` when omitted. */
|
|
1144
|
+
configuration?: OidcConfiguration;
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* The pair {@link nativeNonce} returns (CONTRACT.md §37.4): give `hashed` to
|
|
1148
|
+
* the provider's SDK and `raw` to `loginWithProviderIdToken`.
|
|
1149
|
+
*/
|
|
1150
|
+
interface ProviderNonce {
|
|
1151
|
+
/**
|
|
1152
|
+
* The raw nonce: at least 32 CSPRNG bytes, base64url without padding. A
|
|
1153
|
+
* credential (§37.6) — held behind {@link Sensitive}, and to be kept only for
|
|
1154
|
+
* the length of the sign-in attempt.
|
|
1155
|
+
*/
|
|
1156
|
+
raw: Sensitive<string>;
|
|
1157
|
+
/** `SHA-256(raw)` as 64 lower-case hexadecimal characters; not a secret. */
|
|
1158
|
+
hashed: string;
|
|
1159
|
+
}
|
|
1101
1160
|
|
|
1102
1161
|
/** Path of the OIDC discovery document, relative to the client base URL. */
|
|
1103
1162
|
declare const DISCOVERY_PATH = "/.well-known/openid-configuration";
|
|
@@ -1223,6 +1282,8 @@ declare class PollSchedule {
|
|
|
1223
1282
|
*/
|
|
1224
1283
|
tick(): boolean;
|
|
1225
1284
|
}
|
|
1285
|
+
/** The grant type of native sign-in with a provider ID token (CONTRACT.md §37). */
|
|
1286
|
+
declare const PROVIDER_ID_TOKEN_GRANT_TYPE = "urn:axiam:params:oauth:grant-type:provider-id-token";
|
|
1226
1287
|
/** Configuration for {@link OidcClient}. */
|
|
1227
1288
|
interface OidcClientOptions {
|
|
1228
1289
|
/**
|
|
@@ -1385,13 +1446,16 @@ declare class OidcClient {
|
|
|
1385
1446
|
* fresh PKCE verifier/challenge pair using **S256 only** — `plain` is not
|
|
1386
1447
|
* implemented anywhere in this SDK. The URL is built from the discovery
|
|
1387
1448
|
* document's `authorization_endpoint` with exactly the eight parameters
|
|
1388
|
-
* §12.1 rule 5 mandates, plus any `extraParams` the caller adds
|
|
1449
|
+
* §12.1 rule 5 mandates, plus any `extraParams` the caller adds and, when
|
|
1450
|
+
* `idpHint` is set, the one `axiam_idp_hint` (contract 1.65).
|
|
1389
1451
|
*
|
|
1390
1452
|
* Nothing is stored: persist the returned `state`, `nonce` and
|
|
1391
1453
|
* `codeVerifier` yourself (§12.3 rule 1).
|
|
1392
1454
|
*
|
|
1393
1455
|
* @throws Error when `extraParams` tries to override one of the eight
|
|
1394
1456
|
* SDK-owned parameters — a programming error, caught at call time.
|
|
1457
|
+
* @throws ValidationError when `idpHint` is empty or over 256 UTF-8 bytes;
|
|
1458
|
+
* no URL is built.
|
|
1395
1459
|
*/
|
|
1396
1460
|
oidcBegin(params: OidcBeginParams): AuthorizationRequest;
|
|
1397
1461
|
/**
|
|
@@ -1437,6 +1501,60 @@ declare class OidcClient {
|
|
|
1437
1501
|
* be performed by a public client.
|
|
1438
1502
|
*/
|
|
1439
1503
|
loginClientCredentials(params?: LoginClientCredentialsParams): Promise<OidcTokenSet>;
|
|
1504
|
+
/**
|
|
1505
|
+
* `POST /oauth2/token` with
|
|
1506
|
+
* `grant_type=urn:axiam:params:oauth:grant-type:provider-id-token`
|
|
1507
|
+
* (CONTRACT.md §37, contract 1.65) — sign a native-app user in with the ID
|
|
1508
|
+
* token a Google, Apple or Facebook Limited Login SDK produced.
|
|
1509
|
+
*
|
|
1510
|
+
* @param provider - The provider's UUID or its `provider_slug`, sent verbatim:
|
|
1511
|
+
* never trimmed, case-folded, resolved or looked up. A provider *kind* name
|
|
1512
|
+
* (`google`) is not accepted here unless the operator also chose it as the
|
|
1513
|
+
* slug (§37.2 rule 2).
|
|
1514
|
+
* @param idToken - The provider's ID token (a credential; wrapped or bare).
|
|
1515
|
+
* @param nonce - The **raw** nonce, byte for byte: the provider's SDK was
|
|
1516
|
+
* given `SHA-256(raw)` as hexadecimal (`nativeNonce()` produces the
|
|
1517
|
+
* pair). Never hashed, replaced or generated here (§37.2 rule 3).
|
|
1518
|
+
* @param options - `scopes`, `resource`, `tenantId`, `configuration`.
|
|
1519
|
+
*
|
|
1520
|
+
* @remarks
|
|
1521
|
+
* **Never retried** — not on a status, a `429` or a transport failure: the
|
|
1522
|
+
* provider's token is single-use across the deployment (§37.2 rule 10). An
|
|
1523
|
+
* `invalid_grant` is the server's one generic answer to every refusal of the
|
|
1524
|
+
* token and is neither retried nor refined; the recovery is a **fresh**
|
|
1525
|
+
* provider token with a **fresh** nonce. A transport failure after the
|
|
1526
|
+
* request left is indeterminate and surfaces as `NetworkError`.
|
|
1527
|
+
*
|
|
1528
|
+
* No `openid` or other scope is added: omit `scopes` and the response carries
|
|
1529
|
+
* no `id_token`. This is not token exchange (§15) and never falls back to it
|
|
1530
|
+
* or to a browser flow. A public client sends `client_id` alone; a client
|
|
1531
|
+
* configured with a `clientSecret` sends it in the body.
|
|
1532
|
+
*
|
|
1533
|
+
* The result is the ordinary {@link OidcTokenSet}; an `id_token`, when
|
|
1534
|
+
* present, is validated under §12.4 with the raw `nonce` as the expected
|
|
1535
|
+
* nonce. As with `deviceLogin`, the token set is **returned and not
|
|
1536
|
+
* adopted** as this client's credential (§37.2 rule 9).
|
|
1537
|
+
*
|
|
1538
|
+
* Neither the ID token nor the raw nonce is logged, put in an error, or kept
|
|
1539
|
+
* after the call returns; hold the raw nonce only for the length of the
|
|
1540
|
+
* attempt.
|
|
1541
|
+
*
|
|
1542
|
+
* @throws ValidationError (local, no request) for an empty `provider`,
|
|
1543
|
+
* `idToken` or `nonce`.
|
|
1544
|
+
* @throws AuthError (local, no request) for a slug-only client (§12.3 rule 4).
|
|
1545
|
+
* @throws OAuthProtocolError for a body carrying `error`, at any status.
|
|
1546
|
+
* @throws NetworkError for a transport failure or a body-less `5xx`.
|
|
1547
|
+
*
|
|
1548
|
+
* @example
|
|
1549
|
+
* ```ts
|
|
1550
|
+
* const { raw, hashed } = nativeNonce();
|
|
1551
|
+
* const idToken = await providerSdk.signIn({ nonce: hashed });
|
|
1552
|
+
* const tokens = await oidc.loginWithProviderIdToken('corp-google', idToken, raw, {
|
|
1553
|
+
* scopes: ['openid', 'profile'],
|
|
1554
|
+
* });
|
|
1555
|
+
* ```
|
|
1556
|
+
*/
|
|
1557
|
+
loginWithProviderIdToken(provider: string, idToken: Sensitive<string> | string, nonce: Sensitive<string> | string, options?: LoginWithProviderIdTokenOptions): Promise<OidcTokenSet>;
|
|
1440
1558
|
/**
|
|
1441
1559
|
* `POST /oauth2/introspect` (RFC 7662, §12.1) — ask the server whether a
|
|
1442
1560
|
* token is active and, if so, for its metadata.
|
|
@@ -2069,5 +2187,5 @@ declare class MemoryOidcStateStore implements OidcStateStore {
|
|
|
2069
2187
|
consume(state: string): Promise<OidcStateEntry | undefined>;
|
|
2070
2188
|
}
|
|
2071
2189
|
|
|
2072
|
-
export {
|
|
2073
|
-
export type { ExchangedToken as E, FederationProvider as F, IntrospectParams as I, MtlsEndpointAliases as
|
|
2190
|
+
export { PROTOCOL_OIDC_CONNECT as $, ACCESS_TOKEN_TYPE as A, BACKCHANNEL_LOGOUT_EVENT as B, CIBA_GRANT_TYPE as C, DEFAULT_CIBA_INTERVAL_SECS as D, MIN_DISCOVERY_TTL_MS as G, HANDOFF_CODE_TTL_SECS as H, JWT_TOKEN_TYPE as J, MemoryOidcStateStore as K, MAX_LOGOUT_TOKEN_AGE_SECS as M, OIDC_STATE_TTL_MS as O, OidcClient as R, PROTOCOL_OAUTH2 as _, PROTOCOL_SAML as a0, PROVIDER_ID_TOKEN_GRANT_TYPE as a1, PollSchedule as a2, SIGNED_REQUEST_LIFETIME_SECS as a9, normalizeOrigin as aA, umaChallengeHeader as aB, umaParseChallenge as aC, SLOW_DOWN_INCREMENT_SECS as aa, SSO_CALLBACK_PATH as ab, SSO_HANDOFF_PATH as ac, SSO_OAUTH2_CALLBACK_PATH as ad, SSO_OAUTH2_START_PATH as ae, SSO_PROVIDERS_PATH as af, SSO_START_PATH as ag, TOKEN_EXCHANGE_GRANT_TYPE as ap, UMA_CLAIM_TOKEN_FORMAT as ar, UMA_PROTECTION_SCOPE as as, UMA_TICKET_GRANT_TYPE as at, createOidcClient as ax, isAccessDenied as ay, isExpiredToken as az, CIBA_SLOW_DOWN_INCREMENT_SECS as b, CibaRequestSigner as j, DEFAULT_POLL_INTERVAL_SECS as o, DEVICE_CODE_GRANT_TYPE as p, DISCOVERY_PATH as q, HANDOFF_QUERY_PARAM as w };
|
|
2191
|
+
export type { ExchangedToken as E, FederationProvider as F, IntrospectParams as I, LoginClientCredentialsParams as L, MtlsEndpointAliases as N, ProviderNonce as P, OidcBeginParams as Q, OidcClientOptions as S, OidcConfiguration as T, OidcExchangeParams as U, OidcParParams as V, OidcRefreshParams as W, OidcStateEntry as X, OidcStateStore as Y, OidcTokenSet as Z, AuthorizationRequest as a, PushedAuthorizationRequest as a3, RequestedPermission as a4, RequestingPartyToken as a5, ResourceSet as a6, RevokeParams as a7, RptPermission as a8, SsoCompleteHandoffParams as ah, SsoCompleteOauth2Params as ai, SsoCompleteParams as aj, SsoCompleteResult as ak, SsoProvidersParams as al, SsoStartOauth2Params as am, SsoStartParams as an, SsoStartResult as ao, TokenExchangeParams as aq, UmaChallenge as au, UmaExchangeTicketParams as av, VerifiedLogoutToken as aw, CibaAwaitParams as c, CibaClock as d, CibaDelivery as e, CibaInitiateParams as f, CibaInitiateResponse as g, CibaPingHeaders as h, CibaPollParams as i, CibaSignerDescription as k, CibaSigningAlg as l, CibaSigningKey as m, CibaUserHint as n, DeviceAuthorization as r, DeviceAuthorizeParams as s, DeviceLoginParams as t, DevicePollParams as u, FederationProviderList as v, IntrospectionResult as x, LoginWithProviderIdTokenOptions as y, LogoutUrlParams as z };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KeyObject } from 'node:crypto';
|
|
2
|
-
import { O as OAuthProtocolError } from './errors-
|
|
2
|
+
import { O as OAuthProtocolError } from './errors-CWlh-wcm.cjs';
|
|
3
3
|
import { S as Sensitive } from './sensitive-BC_s7Rrd.cjs';
|
|
4
|
-
import { S as SharedSession } from './session-
|
|
4
|
+
import { S as SharedSession } from './session-CeIUXgpE.cjs';
|
|
5
5
|
import { I as IdTokenClaims } from './jwks-CTVpOWzI.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -276,6 +276,19 @@ interface OidcParParams {
|
|
|
276
276
|
* request over the back channel in the first place.
|
|
277
277
|
*/
|
|
278
278
|
dpopJkt?: string;
|
|
279
|
+
/**
|
|
280
|
+
* The provider hint to push (contract 1.65, §26.2 rule 8): the same optional
|
|
281
|
+
* `idpHint` {@link OidcBeginParams.idpHint} takes, validated the same way.
|
|
282
|
+
* When set, the pushed form carries `axiam_idp_hint` exactly once; it is
|
|
283
|
+
* absent otherwise. It rides the pushed body only — the authorization URL
|
|
284
|
+
* built from the `request_uri` stays exactly `client_id` and `request_uri`.
|
|
285
|
+
*
|
|
286
|
+
* @remarks
|
|
287
|
+
* When this is unset, the `axiam_idp_hint` that the `oidcBegin` URL
|
|
288
|
+
* ({@link OidcParParams.request}) carries is pushed instead (D-N36); when
|
|
289
|
+
* both are set, this argument wins and the URL's hint is not pushed.
|
|
290
|
+
*/
|
|
291
|
+
idpHint?: string;
|
|
279
292
|
}
|
|
280
293
|
/**
|
|
281
294
|
* The result of a pushed authorization request (CONTRACT.md §26.1).
|
|
@@ -320,6 +333,21 @@ interface OidcBeginParams {
|
|
|
320
333
|
* attempting to override one of those eight throws.
|
|
321
334
|
*/
|
|
322
335
|
extraParams?: Record<string, string>;
|
|
336
|
+
/**
|
|
337
|
+
* Which sign-in provider to send the browser to (contract 1.65, §12.1
|
|
338
|
+
* "`idp_hint`"): a provider's UUID, its `provider_slug` or a branded kind
|
|
339
|
+
* name (`google`, `apple`, …). Emitted as the single query parameter
|
|
340
|
+
* `axiam_idp_hint` — the ninth parameter of §12.1 rule 5 — and only when set.
|
|
341
|
+
*
|
|
342
|
+
* @remarks
|
|
343
|
+
* Validated for emptiness and length only: an empty string or one longer
|
|
344
|
+
* than 256 UTF-8 bytes throws a `ValidationError` and no URL is built. It is
|
|
345
|
+
* never trimmed, case-folded, parsed as a UUID or looked up. An unresolvable
|
|
346
|
+
* hint is ignored by the server, so there is nothing to handle on that
|
|
347
|
+
* outcome. When set it replaces any `axiam_idp_hint` in `extraParams`
|
|
348
|
+
* (emitted exactly once). There is no `kc_idp_hint` alias.
|
|
349
|
+
*/
|
|
350
|
+
idpHint?: string;
|
|
323
351
|
}
|
|
324
352
|
/**
|
|
325
353
|
* A token set returned by the OAuth2 token endpoint (wire schema
|
|
@@ -1098,6 +1126,37 @@ interface CibaAwaitParams {
|
|
|
1098
1126
|
* - a header record (`req.headers`), a value possibly an array.
|
|
1099
1127
|
*/
|
|
1100
1128
|
type CibaPingHeaders = readonly string[] | Iterable<readonly [string, string]> | Record<string, string | readonly string[] | undefined>;
|
|
1129
|
+
/** Options of `OidcClient.loginWithProviderIdToken` beyond its three positional inputs (§37.1). */
|
|
1130
|
+
interface LoginWithProviderIdTokenOptions {
|
|
1131
|
+
/**
|
|
1132
|
+
* Scopes to request, sent space-joined as `scope`. Sent **only when named**:
|
|
1133
|
+
* an omitted or empty list sends no `scope` field, which the server reads as
|
|
1134
|
+
* the empty set — no `openid`, hence no `id_token` in the response. The SDK
|
|
1135
|
+
* adds no scope of its own (§37.2 rule 7); pass `openid` to receive
|
|
1136
|
+
* `idClaims`.
|
|
1137
|
+
*/
|
|
1138
|
+
scopes?: readonly string[];
|
|
1139
|
+
/** An RFC 8707 `resource` indicator. Sent only when set. */
|
|
1140
|
+
resource?: string;
|
|
1141
|
+
/** Tenant UUID for the `tenant_id` query parameter (§12.3 rule 4). A slug-only client must pass it. */
|
|
1142
|
+
tenantId?: string;
|
|
1143
|
+
/** A pre-fetched discovery document. Fetched via `oidcDiscover` when omitted. */
|
|
1144
|
+
configuration?: OidcConfiguration;
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* The pair {@link nativeNonce} returns (CONTRACT.md §37.4): give `hashed` to
|
|
1148
|
+
* the provider's SDK and `raw` to `loginWithProviderIdToken`.
|
|
1149
|
+
*/
|
|
1150
|
+
interface ProviderNonce {
|
|
1151
|
+
/**
|
|
1152
|
+
* The raw nonce: at least 32 CSPRNG bytes, base64url without padding. A
|
|
1153
|
+
* credential (§37.6) — held behind {@link Sensitive}, and to be kept only for
|
|
1154
|
+
* the length of the sign-in attempt.
|
|
1155
|
+
*/
|
|
1156
|
+
raw: Sensitive<string>;
|
|
1157
|
+
/** `SHA-256(raw)` as 64 lower-case hexadecimal characters; not a secret. */
|
|
1158
|
+
hashed: string;
|
|
1159
|
+
}
|
|
1101
1160
|
|
|
1102
1161
|
/** Path of the OIDC discovery document, relative to the client base URL. */
|
|
1103
1162
|
declare const DISCOVERY_PATH = "/.well-known/openid-configuration";
|
|
@@ -1223,6 +1282,8 @@ declare class PollSchedule {
|
|
|
1223
1282
|
*/
|
|
1224
1283
|
tick(): boolean;
|
|
1225
1284
|
}
|
|
1285
|
+
/** The grant type of native sign-in with a provider ID token (CONTRACT.md §37). */
|
|
1286
|
+
declare const PROVIDER_ID_TOKEN_GRANT_TYPE = "urn:axiam:params:oauth:grant-type:provider-id-token";
|
|
1226
1287
|
/** Configuration for {@link OidcClient}. */
|
|
1227
1288
|
interface OidcClientOptions {
|
|
1228
1289
|
/**
|
|
@@ -1385,13 +1446,16 @@ declare class OidcClient {
|
|
|
1385
1446
|
* fresh PKCE verifier/challenge pair using **S256 only** — `plain` is not
|
|
1386
1447
|
* implemented anywhere in this SDK. The URL is built from the discovery
|
|
1387
1448
|
* document's `authorization_endpoint` with exactly the eight parameters
|
|
1388
|
-
* §12.1 rule 5 mandates, plus any `extraParams` the caller adds
|
|
1449
|
+
* §12.1 rule 5 mandates, plus any `extraParams` the caller adds and, when
|
|
1450
|
+
* `idpHint` is set, the one `axiam_idp_hint` (contract 1.65).
|
|
1389
1451
|
*
|
|
1390
1452
|
* Nothing is stored: persist the returned `state`, `nonce` and
|
|
1391
1453
|
* `codeVerifier` yourself (§12.3 rule 1).
|
|
1392
1454
|
*
|
|
1393
1455
|
* @throws Error when `extraParams` tries to override one of the eight
|
|
1394
1456
|
* SDK-owned parameters — a programming error, caught at call time.
|
|
1457
|
+
* @throws ValidationError when `idpHint` is empty or over 256 UTF-8 bytes;
|
|
1458
|
+
* no URL is built.
|
|
1395
1459
|
*/
|
|
1396
1460
|
oidcBegin(params: OidcBeginParams): AuthorizationRequest;
|
|
1397
1461
|
/**
|
|
@@ -1437,6 +1501,60 @@ declare class OidcClient {
|
|
|
1437
1501
|
* be performed by a public client.
|
|
1438
1502
|
*/
|
|
1439
1503
|
loginClientCredentials(params?: LoginClientCredentialsParams): Promise<OidcTokenSet>;
|
|
1504
|
+
/**
|
|
1505
|
+
* `POST /oauth2/token` with
|
|
1506
|
+
* `grant_type=urn:axiam:params:oauth:grant-type:provider-id-token`
|
|
1507
|
+
* (CONTRACT.md §37, contract 1.65) — sign a native-app user in with the ID
|
|
1508
|
+
* token a Google, Apple or Facebook Limited Login SDK produced.
|
|
1509
|
+
*
|
|
1510
|
+
* @param provider - The provider's UUID or its `provider_slug`, sent verbatim:
|
|
1511
|
+
* never trimmed, case-folded, resolved or looked up. A provider *kind* name
|
|
1512
|
+
* (`google`) is not accepted here unless the operator also chose it as the
|
|
1513
|
+
* slug (§37.2 rule 2).
|
|
1514
|
+
* @param idToken - The provider's ID token (a credential; wrapped or bare).
|
|
1515
|
+
* @param nonce - The **raw** nonce, byte for byte: the provider's SDK was
|
|
1516
|
+
* given `SHA-256(raw)` as hexadecimal (`nativeNonce()` produces the
|
|
1517
|
+
* pair). Never hashed, replaced or generated here (§37.2 rule 3).
|
|
1518
|
+
* @param options - `scopes`, `resource`, `tenantId`, `configuration`.
|
|
1519
|
+
*
|
|
1520
|
+
* @remarks
|
|
1521
|
+
* **Never retried** — not on a status, a `429` or a transport failure: the
|
|
1522
|
+
* provider's token is single-use across the deployment (§37.2 rule 10). An
|
|
1523
|
+
* `invalid_grant` is the server's one generic answer to every refusal of the
|
|
1524
|
+
* token and is neither retried nor refined; the recovery is a **fresh**
|
|
1525
|
+
* provider token with a **fresh** nonce. A transport failure after the
|
|
1526
|
+
* request left is indeterminate and surfaces as `NetworkError`.
|
|
1527
|
+
*
|
|
1528
|
+
* No `openid` or other scope is added: omit `scopes` and the response carries
|
|
1529
|
+
* no `id_token`. This is not token exchange (§15) and never falls back to it
|
|
1530
|
+
* or to a browser flow. A public client sends `client_id` alone; a client
|
|
1531
|
+
* configured with a `clientSecret` sends it in the body.
|
|
1532
|
+
*
|
|
1533
|
+
* The result is the ordinary {@link OidcTokenSet}; an `id_token`, when
|
|
1534
|
+
* present, is validated under §12.4 with the raw `nonce` as the expected
|
|
1535
|
+
* nonce. As with `deviceLogin`, the token set is **returned and not
|
|
1536
|
+
* adopted** as this client's credential (§37.2 rule 9).
|
|
1537
|
+
*
|
|
1538
|
+
* Neither the ID token nor the raw nonce is logged, put in an error, or kept
|
|
1539
|
+
* after the call returns; hold the raw nonce only for the length of the
|
|
1540
|
+
* attempt.
|
|
1541
|
+
*
|
|
1542
|
+
* @throws ValidationError (local, no request) for an empty `provider`,
|
|
1543
|
+
* `idToken` or `nonce`.
|
|
1544
|
+
* @throws AuthError (local, no request) for a slug-only client (§12.3 rule 4).
|
|
1545
|
+
* @throws OAuthProtocolError for a body carrying `error`, at any status.
|
|
1546
|
+
* @throws NetworkError for a transport failure or a body-less `5xx`.
|
|
1547
|
+
*
|
|
1548
|
+
* @example
|
|
1549
|
+
* ```ts
|
|
1550
|
+
* const { raw, hashed } = nativeNonce();
|
|
1551
|
+
* const idToken = await providerSdk.signIn({ nonce: hashed });
|
|
1552
|
+
* const tokens = await oidc.loginWithProviderIdToken('corp-google', idToken, raw, {
|
|
1553
|
+
* scopes: ['openid', 'profile'],
|
|
1554
|
+
* });
|
|
1555
|
+
* ```
|
|
1556
|
+
*/
|
|
1557
|
+
loginWithProviderIdToken(provider: string, idToken: Sensitive<string> | string, nonce: Sensitive<string> | string, options?: LoginWithProviderIdTokenOptions): Promise<OidcTokenSet>;
|
|
1440
1558
|
/**
|
|
1441
1559
|
* `POST /oauth2/introspect` (RFC 7662, §12.1) — ask the server whether a
|
|
1442
1560
|
* token is active and, if so, for its metadata.
|
|
@@ -2069,5 +2187,5 @@ declare class MemoryOidcStateStore implements OidcStateStore {
|
|
|
2069
2187
|
consume(state: string): Promise<OidcStateEntry | undefined>;
|
|
2070
2188
|
}
|
|
2071
2189
|
|
|
2072
|
-
export {
|
|
2073
|
-
export type { ExchangedToken as E, FederationProvider as F, IntrospectParams as I, MtlsEndpointAliases as
|
|
2190
|
+
export { PROTOCOL_OIDC_CONNECT as $, ACCESS_TOKEN_TYPE as A, BACKCHANNEL_LOGOUT_EVENT as B, CIBA_GRANT_TYPE as C, DEFAULT_CIBA_INTERVAL_SECS as D, MIN_DISCOVERY_TTL_MS as G, HANDOFF_CODE_TTL_SECS as H, JWT_TOKEN_TYPE as J, MemoryOidcStateStore as K, MAX_LOGOUT_TOKEN_AGE_SECS as M, OIDC_STATE_TTL_MS as O, OidcClient as R, PROTOCOL_OAUTH2 as _, PROTOCOL_SAML as a0, PROVIDER_ID_TOKEN_GRANT_TYPE as a1, PollSchedule as a2, SIGNED_REQUEST_LIFETIME_SECS as a9, normalizeOrigin as aA, umaChallengeHeader as aB, umaParseChallenge as aC, SLOW_DOWN_INCREMENT_SECS as aa, SSO_CALLBACK_PATH as ab, SSO_HANDOFF_PATH as ac, SSO_OAUTH2_CALLBACK_PATH as ad, SSO_OAUTH2_START_PATH as ae, SSO_PROVIDERS_PATH as af, SSO_START_PATH as ag, TOKEN_EXCHANGE_GRANT_TYPE as ap, UMA_CLAIM_TOKEN_FORMAT as ar, UMA_PROTECTION_SCOPE as as, UMA_TICKET_GRANT_TYPE as at, createOidcClient as ax, isAccessDenied as ay, isExpiredToken as az, CIBA_SLOW_DOWN_INCREMENT_SECS as b, CibaRequestSigner as j, DEFAULT_POLL_INTERVAL_SECS as o, DEVICE_CODE_GRANT_TYPE as p, DISCOVERY_PATH as q, HANDOFF_QUERY_PARAM as w };
|
|
2191
|
+
export type { ExchangedToken as E, FederationProvider as F, IntrospectParams as I, LoginClientCredentialsParams as L, MtlsEndpointAliases as N, ProviderNonce as P, OidcBeginParams as Q, OidcClientOptions as S, OidcConfiguration as T, OidcExchangeParams as U, OidcParParams as V, OidcRefreshParams as W, OidcStateEntry as X, OidcStateStore as Y, OidcTokenSet as Z, AuthorizationRequest as a, PushedAuthorizationRequest as a3, RequestedPermission as a4, RequestingPartyToken as a5, ResourceSet as a6, RevokeParams as a7, RptPermission as a8, SsoCompleteHandoffParams as ah, SsoCompleteOauth2Params as ai, SsoCompleteParams as aj, SsoCompleteResult as ak, SsoProvidersParams as al, SsoStartOauth2Params as am, SsoStartParams as an, SsoStartResult as ao, TokenExchangeParams as aq, UmaChallenge as au, UmaExchangeTicketParams as av, VerifiedLogoutToken as aw, CibaAwaitParams as c, CibaClock as d, CibaDelivery as e, CibaInitiateParams as f, CibaInitiateResponse as g, CibaPingHeaders as h, CibaPollParams as i, CibaSignerDescription as k, CibaSigningAlg as l, CibaSigningKey as m, CibaUserHint as n, DeviceAuthorization as r, DeviceAuthorizeParams as s, DeviceLoginParams as t, DevicePollParams as u, FederationProviderList as v, IntrospectionResult as x, LoginWithProviderIdTokenOptions as y, LogoutUrlParams as z };
|
package/dist/rest/index.d.cts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { P as ParseSamlSpMetadata, S as SamlServiceProvider, c as SamlServiceProviderInput, d as ScimTargetResponse, e as ScimTargetInput, D as DirectoryConfig, f as SetDirectoryConfig, g as SsfStream, h as SsfStreamInput, G as GrantSpec, i as GroupSpec, j as PermissionSpec, R as ResourceSpec, k as RoleSpec, l as ScopeSpec, m as ServiceAccountSpec, U as UserSpec, M as ManagementManifest } from '../client-
|
|
2
|
-
export { n as AcsEndpoint, o as ActorType, p as AddMemberRequest, q as AddServiceAccountMemberRequest, r as ApiProviderConfig, s as AppliedStep, t as ApplyReport, u as AssignRoleToGroupRequest, v as AssignRoleToServiceAccountRequest, w as AssignRoleToUserRequest, x as AttestationMode, y as AttributeMapping, z as AttributeSource, B as AuditApi, C as AuditListFilter, E as AuditListSystemFilter, F as AuditLogEntry, H as AuditOutcome, I as AuthnRequestParamsMode, A as AxiamClient, J as BASE_DELAY_MS, K as BindCertificate, L as CaCertificate, N as CaCertificatesApi, O as Certificate, Q as CertificatePolicy, T as CertificateStatus, V as CertificateType, X as CertificatesApi, Y as CertificationLevel, Z as Change, _ as CibaDeliveryMode, $ as CibaRequestSigningAlg, a0 as CimdPolicy, a1 as ClientAuthMethod, a2 as ClientProfile, a3 as ClientRegistration, a4 as ComplianceReportEntry, a5 as ConsentView, a6 as CreateCaCertificateRequest, a7 as CreateCertificateRequest, a8 as CreateFederationConfigRequest, a9 as CreateFederationConfigRequestWire, aa as CreateGroupRequest, ab as CreateIntermediateCaRequest, ac as CreateNetworkReplyProfileRequest, ad as CreateNetworkSegmentRequest, ae as CreateNotificationRuleRequest, af as CreateOAuth2ClientRequest, ag as CreatePermissionRequest, ah as CreatePgpKeyRequest, ai as CreateReactorRequest, aj as CreateRegistrationTokenRequest, ak as CreateRegistrationTokenResponse, al as CreateRegistrationTokenResponseWire, am as CreateResourceRequest, an as CreateRoleRequest, ao as CreateScimTokenRequest, ap as CreateScimTokenResponse, aq as CreateScimTokenResponseWire, ar as CreateScopeRequest, as as CreateServiceAccountRequest, at as CreateTenantRequest, au as CreateUserRequest, av as CreateUserRequestWire, aw as CreateWebhookRequest, ax as CreateWebhookRequestWire, ay as DeprovisionPolicy, az as DeviceToken, aA as DirectoryApi, aB as DirectoryKind, aC as DirectoryLinkResult, aD as DirectorySyncStatus, aE as EmailConfig, aF as EmailConfigApi, aG as EmailConfigOverride, aH as EmailTestResult, aI as EmailVerificationPolicy, aJ as EncryptRequest, aK as EncryptedExport, aL as FailurePolicy, aM as FederationApi, aN as FederationConfigResponse, aO as FederationLinkResponse, aP as GeneratedCaCertificate, aQ as GeneratedCaCertificateWire, aR as GeneratedCertificate, aS as GeneratedCertificateWire, aT as GeneratedPgpKey, aU as GeneratedPgpKeyWire, aV as GrantPermissionRequest, aW as GrantScopeConsent, aX as GrantedScope, aY as Group, aZ as GroupMapping, a_ as GroupsApi, a$ as HealthResponse, b0 as ImportCaCertificateRequest, b1 as ImportCaCertificateRequestWire, b2 as IssueSamlIdpCredential, b3 as KNOWN_SCIM_TARGET_AUTH_TYPES, b4 as KNOWN_SCIM_TARGET_SCOPE_TYPES, b5 as KeyAlgorithm, b6 as LinkDirectoryAccount, b7 as LockoutPolicy, b8 as MAX_ATTEMPTS, b9 as MAX_DELAY_MS, ba as ManagedBy, bb as ManagementNamespaces, bc as ManagementPlan, bd as ManifestApi, be as ManifestFailure, bf as MdsRefreshOutcome, bg as MdsStatusResponse, bh as MfaEnrollment, bi as MfaMethodResponse, bj as MfaMethodType, bk as MfaPolicy, bl as MigrateCustodyResponse, bm as MtlsTrustAnchorResponse, bn as NameIdFormat, bo as NamespaceScope, bp as
|
|
3
|
-
export { A as AxiamClientOptions, D as DecisionMemo, F as FinishRequest, M as MAX_TTL_MS, S as SharedSession, T as TelemetryReporter, m as memoKey } from '../session-
|
|
1
|
+
import { P as ParseSamlSpMetadata, S as SamlServiceProvider, c as SamlServiceProviderInput, d as ScimTargetResponse, e as ScimTargetInput, D as DirectoryConfig, f as SetDirectoryConfig, g as SsfStream, h as SsfStreamInput, G as GrantSpec, i as GroupSpec, j as PermissionSpec, R as ResourceSpec, k as RoleSpec, l as ScopeSpec, m as ServiceAccountSpec, U as UserSpec, M as ManagementManifest } from '../client-Bp7riC4k.cjs';
|
|
2
|
+
export { n as AcsEndpoint, o as ActorType, p as AddMemberRequest, q as AddServiceAccountMemberRequest, r as ApiProviderConfig, s as AppliedStep, t as ApplyReport, u as AssignRoleToGroupRequest, v as AssignRoleToServiceAccountRequest, w as AssignRoleToUserRequest, x as AttestationMode, y as AttributeMapping, z as AttributeSource, B as AuditApi, C as AuditListFilter, E as AuditListSystemFilter, F as AuditLogEntry, H as AuditOutcome, I as AuthnRequestParamsMode, A as AxiamClient, J as BASE_DELAY_MS, K as BindCertificate, L as CaCertificate, N as CaCertificatesApi, O as Certificate, Q as CertificatePolicy, T as CertificateStatus, V as CertificateType, X as CertificatesApi, Y as CertificationLevel, Z as Change, _ as CibaDeliveryMode, $ as CibaRequestSigningAlg, a0 as CimdPolicy, a1 as ClientAuthMethod, a2 as ClientProfile, a3 as ClientRegistration, a4 as ComplianceReportEntry, a5 as ConsentView, a6 as CreateCaCertificateRequest, a7 as CreateCertificateRequest, a8 as CreateFederationConfigRequest, a9 as CreateFederationConfigRequestWire, aa as CreateGroupRequest, ab as CreateIntermediateCaRequest, ac as CreateNetworkReplyProfileRequest, ad as CreateNetworkSegmentRequest, ae as CreateNotificationRuleRequest, af as CreateOAuth2ClientRequest, ag as CreatePermissionRequest, ah as CreatePgpKeyRequest, ai as CreateReactorRequest, aj as CreateRegistrationTokenRequest, ak as CreateRegistrationTokenResponse, al as CreateRegistrationTokenResponseWire, am as CreateResourceRequest, an as CreateRoleRequest, ao as CreateScimTokenRequest, ap as CreateScimTokenResponse, aq as CreateScimTokenResponseWire, ar as CreateScopeRequest, as as CreateServiceAccountRequest, at as CreateTenantRequest, au as CreateUserRequest, av as CreateUserRequestWire, aw as CreateWebhookRequest, ax as CreateWebhookRequestWire, ay as DeprovisionPolicy, az as DeviceToken, aA as DirectoryApi, aB as DirectoryKind, aC as DirectoryLinkResult, aD as DirectorySyncStatus, aE as EmailConfig, aF as EmailConfigApi, aG as EmailConfigOverride, aH as EmailTestResult, aI as EmailVerificationPolicy, aJ as EncryptRequest, aK as EncryptedExport, aL as FailurePolicy, aM as FederationApi, aN as FederationConfigResponse, aO as FederationLinkResponse, aP as GeneratedCaCertificate, aQ as GeneratedCaCertificateWire, aR as GeneratedCertificate, aS as GeneratedCertificateWire, aT as GeneratedPgpKey, aU as GeneratedPgpKeyWire, aV as GrantPermissionRequest, aW as GrantScopeConsent, aX as GrantedScope, aY as Group, aZ as GroupMapping, a_ as GroupsApi, a$ as HealthResponse, b0 as ImportCaCertificateRequest, b1 as ImportCaCertificateRequestWire, b2 as IssueSamlIdpCredential, b3 as KNOWN_SCIM_TARGET_AUTH_TYPES, b4 as KNOWN_SCIM_TARGET_SCOPE_TYPES, b5 as KeyAlgorithm, b6 as LinkDirectoryAccount, b7 as LockoutPolicy, b8 as MAX_ATTEMPTS, b9 as MAX_DELAY_MS, ba as ManagedBy, bb as ManagementNamespaces, bc as ManagementPlan, bd as ManifestApi, be as ManifestFailure, bf as MdsRefreshOutcome, bg as MdsStatusResponse, bh as MfaEnrollment, bi as MfaMethodResponse, bj as MfaMethodType, bk as MfaPolicy, bl as MigrateCustodyResponse, bm as MtlsTrustAnchorResponse, bn as NameIdFormat, bo as NamespaceScope, bp as NativeLoginTrustRequest, bq as NativeLoginTrustResponse, br as NetworkApi, bs as NetworkPolicyResponse, bt as NetworkPolicySpec, bu as NetworkProfileSpec, bv as NetworkReplyProfile, bw as NetworkReplyProfileInput, bx as NetworkSegmentKind, by as NetworkSegmentResponse, bz as NetworkSegmentSpec, bA as NetworkSpec, bB as NotificationEventType, bC as NotificationPolicy, bD as NotificationRuleResponse, bE as NotificationRulesApi, bF as OAuth2ClientCreatedResponse, bG as OAuth2ClientCreatedResponseWire, bH as OAuth2ClientResponse, bI as OAuth2Policy, bJ as Oauth2ClientsApi, bK as OidcAuthorizeRequest, bL as OidcAuthorizeResponse, bM as OidcCallbackRequest, bN as OidcCallbackResponse, bO as OidcPolicy, bP as OpaqueEnrollment, bQ as OpaqueEnrollmentPayload, bR as OpaquePolicy, bS as Organization, bT as OrganizationsApi, bU as Page, bV as PageRequest, bW as PasswordPolicy, bX as PasswordResetConfirmation, bY as PasswordResetContext, bZ as PasswordResetRequest, b_ as Permission, b$ as PermissionEffect, c0 as PermissionsApi, c1 as PgpKey, c2 as PgpKeyAlgorithm, c3 as PgpKeyPurpose, c4 as PgpKeyStatus, c5 as PgpKeysApi, c6 as PlannedAction, c7 as PlatformApi, c8 as PolicyResponse, c9 as PrivacyApi, ca as PrivacyPolicy, cb as ProviderConfig, cc as RadiusServiceType, cd as RadiusTerminationAction, ce as ReactorEventDescriptor, cf as ReactorMode, cg as ReactorResponse, ch as ReactorsApi, ci as ReadyResponse, cj as RefreshReuseResponse, ck as RegistrationTokenResponse, cl as ReplaceNetworkPolicyRequest, cm as ReplaceNetworkReplyProfileRequest, cn as ReplaceNetworkSegmentRequest, co as ResolvedPermissionGrant, cp as Resource, cq as ResourcesApi, cr as RetryOptions, cs as RetryPolicy, ct as Role, cu as RoleAssignment, cv as RoleBinding, cw as RoleGroupAssignment, cx as RoleServiceAccountAssignment, cy as RoleUserAssignment, cz as RolesApi, cA as RotateSecretResponse, cB as RotateSecretResponseWire, cC as SamlApi, cD as SamlBinding, cE as SamlIdpCredential, cF as SamlIdpCredentialPromotion, cG as SamlIdpCredentialStatus, cH as SamlIdpInfo, cI as SamlIdpSlot, cJ as SamlSpMetadataDraft, cK as ScimReconcileAccepted, cL as ScimTargetAuth, cM as ScimTargetDeliveryState, cN as ScimTargetInputWire, cO as ScimTargetScope, cP as ScimTargetsApi, cQ as ScimTokenResponse, cR as ScimTokenStatus, cS as ScimTokensApi, cT as Scope, cU as ScopesApi, cV as SecuritySettings, cW as ServiceAccountCreatedResponse, cX as ServiceAccountCreatedResponseWire, cY as ServiceAccountResponse, cZ as ServiceAccountsApi, c_ as SessionResponse, c$ as SetDirectoryConfigWire, d0 as SetMtlsTrustAnchor, d1 as SetOrgEmailConfig, d2 as SetOrgSettings, d3 as SettingsApi, d4 as SettingsScope, d5 as SignAuditBatchRequest, d6 as SignCertificateCsrRequest, d7 as SignIntermediateCsrRequest, d8 as SignedAuditBatch, d9 as SmtpConfig, da as SsfApi, db as SsfDeliveryMethod, dc as SsfEventType, dd as SsfStatusActor, de as SsfStreamInputWire, df as SsfStreamStatus, dg as SsfSubjectFormat, dh as StepOutcome, di as SubjectAltName, dj as Target, dk as Tenant, dl as TenantKind, dm as TenantSettingsOverride, dn as TenantStatus, dp as TenantsApi, dq as TokenExchangeTrustRequest, dr as TokenExchangeTrustResponse, ds as TokenPolicy, dt as UnknownAaguidAction, du as UpdateDirectoryConfig, dv as UpdateDirectoryConfigWire, dw as UpdateFederationConfigRequest, dx as UpdateFederationConfigRequestWire, dy as UpdateGroup, dz as UpdateNotificationRuleRequest, dA as UpdateOAuth2ClientRequest, dB as UpdateOrganizationRequest, dC as UpdatePermissionRequest, dD as UpdateReactorRequest, dE as UpdateResourceRequest, dF as UpdateRole, dG as UpdateScopeRequest, dH as UpdateServiceAccount, dI as UpdateTenant, dJ as UpdateUserRequest, dK as UpdateWebhookRequest, dL as UpdateWebhookRequestWire, dM as UserAttributeMap, dN as UserNameSource, dO as UserResponse, dP as UserStatus, dQ as UsersApi, dR as WebauthnAttestationPolicy, dS as WebauthnAuthenticationChallenge, dT as WebauthnAuthenticationResponse, dU as WebauthnCreationChallenge, dV as WebauthnCreationOptionsJson, b as WebauthnCredential, dW as WebauthnCredentialDescriptorJson, a as WebauthnLoginResult, dX as WebauthnPolicy, dY as WebauthnPolicyApi, dZ as WebauthnRegistrationChallenge, d_ as WebauthnRegistrationResponse, d$ as WebauthnRequestChallenge, e0 as WebauthnRequestOptionsJson, W as WebauthnWorkspace, e1 as WebhookResponse, e2 as WebhooksApi, e3 as assertKnownScimTargetAuth, e4 as assertKnownScimTargetScope, e5 as assertValidSubjectAltName, e6 as assertValidSubjectAltNameList, e7 as backoffMs, e8 as changedCount, e9 as changes, ea as clientRegistrationFromJson, eb as collectPages, ec as createFederationConfigRequestToWire, ed as createRegistrationTokenResponseFromWire, ee as createScimTokenResponseFromWire, ef as createUserRequestToWire, eg as createWebhookRequestToWire, eh as delayMs, ei as failure, ej as generatedCaCertificateFromWire, ek as generatedCertificateFromWire, el as generatedPgpKeyFromWire, em as hasMore, en as importCaCertificateRequestToWire, eo as inheritOf, ep as isComplete, eq as isConverged, er as managementNamespaces, es as normalizeSearch, et as oAuth2ClientCreatedResponseFromWire, eu as omitEmptyTenantScope, ev as omitNullMembers, ew as opaqueEnrollment, ex as opaqueEnrollmentForSelf, ey as pageQuery, ez as resourceKeyOf, eA as roleAssignmentInherits, eB as roleKeyOf, eC as rotateSecretResponseFromWire, eD as scimTargetInputToWire, eE as scrubDirectoryConfig, eF as scrubDirectoryLinkResult, eG as scrubDirectorySyncStatus, eH as scrubSamlIdpCredential, eI as scrubSamlIdpCredentialPromotion, eJ as scrubSamlIdpInfo, eK as scrubSamlServiceProvider, eL as scrubSamlSpMetadataDraft, eM as scrubScimReconcileAccepted, eN as scrubScimTargetResponse, eO as scrubSsfStream, eP as serviceAccountCreatedResponseFromWire, eQ as setDirectoryConfigToWire, eR as ssfStreamInputToWire, eS as topologicalOrder, eT as updateDirectoryConfigToWire, eU as updateFederationConfigRequestToWire, eV as updateWebhookRequestToWire, eW as validate, eX as webauthnRequestJson, eY as withFederationConfigResponseDefaults, eZ as withRetry } from '../client-Bp7riC4k.cjs';
|
|
3
|
+
export { A as AxiamClientOptions, D as DecisionMemo, F as FinishRequest, M as MAX_TTL_MS, S as SharedSession, T as TelemetryReporter, m as memoKey } from '../session-CeIUXgpE.cjs';
|
|
4
4
|
export { C as ConfigClampedEvent, O as Outcome, R as RefreshEvent, b as RefreshRole, c as RequestEndEvent, d as RequestStartEvent, e as RetryEvent, S as SsfUnjudgedCategory, f as SsfUnjudgedEvent, a as TelemetryDispatcher, g as TelemetryEvent, T as TelemetryHook } from '../telemetry-Du0-zS5f.cjs';
|
|
5
5
|
export { A as AccessCheck, a as AccessDecision, b as AxiamUserInfo, L as LoginResult } from '../types-zXSpiQM-.cjs';
|
|
6
6
|
export { W as WebauthnFailure, c as classifyWebauthnError, w as webauthnErrorMessage } from '../webauthnErrors-m1LZiaRy.cjs';
|
|
7
|
-
import { N as NetworkError } from '../errors-
|
|
8
|
-
export { a as AuthError, A as AuthzError, b as AxiamError, I as IdTokenFailureReason, O as OAuthProtocolError } from '../errors-
|
|
7
|
+
import { N as NetworkError } from '../errors-CWlh-wcm.cjs';
|
|
8
|
+
export { a as AuthError, A as AuthzError, b as AxiamError, I as IdTokenFailureReason, O as OAuthProtocolError } from '../errors-CWlh-wcm.cjs';
|
|
9
9
|
export { S as Sensitive } from '../sensitive-BC_s7Rrd.cjs';
|
|
10
|
-
export { C as ConflictError, F as FieldError, N as NotFoundError, V as ValidationError, p as parseFieldErrors } from '../errors-
|
|
10
|
+
export { C as ConflictError, F as FieldError, N as NotFoundError, V as ValidationError, p as parseFieldErrors } from '../errors-DHauOsqx.cjs';
|
|
11
11
|
import 'axios';
|
|
12
12
|
|
|
13
13
|
/**
|
package/dist/rest/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { P as ParseSamlSpMetadata, S as SamlServiceProvider, c as SamlServiceProviderInput, d as ScimTargetResponse, e as ScimTargetInput, D as DirectoryConfig, f as SetDirectoryConfig, g as SsfStream, h as SsfStreamInput, G as GrantSpec, i as GroupSpec, j as PermissionSpec, R as ResourceSpec, k as RoleSpec, l as ScopeSpec, m as ServiceAccountSpec, U as UserSpec, M as ManagementManifest } from '../client-
|
|
2
|
-
export { n as AcsEndpoint, o as ActorType, p as AddMemberRequest, q as AddServiceAccountMemberRequest, r as ApiProviderConfig, s as AppliedStep, t as ApplyReport, u as AssignRoleToGroupRequest, v as AssignRoleToServiceAccountRequest, w as AssignRoleToUserRequest, x as AttestationMode, y as AttributeMapping, z as AttributeSource, B as AuditApi, C as AuditListFilter, E as AuditListSystemFilter, F as AuditLogEntry, H as AuditOutcome, I as AuthnRequestParamsMode, A as AxiamClient, J as BASE_DELAY_MS, K as BindCertificate, L as CaCertificate, N as CaCertificatesApi, O as Certificate, Q as CertificatePolicy, T as CertificateStatus, V as CertificateType, X as CertificatesApi, Y as CertificationLevel, Z as Change, _ as CibaDeliveryMode, $ as CibaRequestSigningAlg, a0 as CimdPolicy, a1 as ClientAuthMethod, a2 as ClientProfile, a3 as ClientRegistration, a4 as ComplianceReportEntry, a5 as ConsentView, a6 as CreateCaCertificateRequest, a7 as CreateCertificateRequest, a8 as CreateFederationConfigRequest, a9 as CreateFederationConfigRequestWire, aa as CreateGroupRequest, ab as CreateIntermediateCaRequest, ac as CreateNetworkReplyProfileRequest, ad as CreateNetworkSegmentRequest, ae as CreateNotificationRuleRequest, af as CreateOAuth2ClientRequest, ag as CreatePermissionRequest, ah as CreatePgpKeyRequest, ai as CreateReactorRequest, aj as CreateRegistrationTokenRequest, ak as CreateRegistrationTokenResponse, al as CreateRegistrationTokenResponseWire, am as CreateResourceRequest, an as CreateRoleRequest, ao as CreateScimTokenRequest, ap as CreateScimTokenResponse, aq as CreateScimTokenResponseWire, ar as CreateScopeRequest, as as CreateServiceAccountRequest, at as CreateTenantRequest, au as CreateUserRequest, av as CreateUserRequestWire, aw as CreateWebhookRequest, ax as CreateWebhookRequestWire, ay as DeprovisionPolicy, az as DeviceToken, aA as DirectoryApi, aB as DirectoryKind, aC as DirectoryLinkResult, aD as DirectorySyncStatus, aE as EmailConfig, aF as EmailConfigApi, aG as EmailConfigOverride, aH as EmailTestResult, aI as EmailVerificationPolicy, aJ as EncryptRequest, aK as EncryptedExport, aL as FailurePolicy, aM as FederationApi, aN as FederationConfigResponse, aO as FederationLinkResponse, aP as GeneratedCaCertificate, aQ as GeneratedCaCertificateWire, aR as GeneratedCertificate, aS as GeneratedCertificateWire, aT as GeneratedPgpKey, aU as GeneratedPgpKeyWire, aV as GrantPermissionRequest, aW as GrantScopeConsent, aX as GrantedScope, aY as Group, aZ as GroupMapping, a_ as GroupsApi, a$ as HealthResponse, b0 as ImportCaCertificateRequest, b1 as ImportCaCertificateRequestWire, b2 as IssueSamlIdpCredential, b3 as KNOWN_SCIM_TARGET_AUTH_TYPES, b4 as KNOWN_SCIM_TARGET_SCOPE_TYPES, b5 as KeyAlgorithm, b6 as LinkDirectoryAccount, b7 as LockoutPolicy, b8 as MAX_ATTEMPTS, b9 as MAX_DELAY_MS, ba as ManagedBy, bb as ManagementNamespaces, bc as ManagementPlan, bd as ManifestApi, be as ManifestFailure, bf as MdsRefreshOutcome, bg as MdsStatusResponse, bh as MfaEnrollment, bi as MfaMethodResponse, bj as MfaMethodType, bk as MfaPolicy, bl as MigrateCustodyResponse, bm as MtlsTrustAnchorResponse, bn as NameIdFormat, bo as NamespaceScope, bp as
|
|
3
|
-
export { A as AxiamClientOptions, D as DecisionMemo, F as FinishRequest, M as MAX_TTL_MS, S as SharedSession, T as TelemetryReporter, m as memoKey } from '../session-
|
|
1
|
+
import { P as ParseSamlSpMetadata, S as SamlServiceProvider, c as SamlServiceProviderInput, d as ScimTargetResponse, e as ScimTargetInput, D as DirectoryConfig, f as SetDirectoryConfig, g as SsfStream, h as SsfStreamInput, G as GrantSpec, i as GroupSpec, j as PermissionSpec, R as ResourceSpec, k as RoleSpec, l as ScopeSpec, m as ServiceAccountSpec, U as UserSpec, M as ManagementManifest } from '../client-CaurIxje.js';
|
|
2
|
+
export { n as AcsEndpoint, o as ActorType, p as AddMemberRequest, q as AddServiceAccountMemberRequest, r as ApiProviderConfig, s as AppliedStep, t as ApplyReport, u as AssignRoleToGroupRequest, v as AssignRoleToServiceAccountRequest, w as AssignRoleToUserRequest, x as AttestationMode, y as AttributeMapping, z as AttributeSource, B as AuditApi, C as AuditListFilter, E as AuditListSystemFilter, F as AuditLogEntry, H as AuditOutcome, I as AuthnRequestParamsMode, A as AxiamClient, J as BASE_DELAY_MS, K as BindCertificate, L as CaCertificate, N as CaCertificatesApi, O as Certificate, Q as CertificatePolicy, T as CertificateStatus, V as CertificateType, X as CertificatesApi, Y as CertificationLevel, Z as Change, _ as CibaDeliveryMode, $ as CibaRequestSigningAlg, a0 as CimdPolicy, a1 as ClientAuthMethod, a2 as ClientProfile, a3 as ClientRegistration, a4 as ComplianceReportEntry, a5 as ConsentView, a6 as CreateCaCertificateRequest, a7 as CreateCertificateRequest, a8 as CreateFederationConfigRequest, a9 as CreateFederationConfigRequestWire, aa as CreateGroupRequest, ab as CreateIntermediateCaRequest, ac as CreateNetworkReplyProfileRequest, ad as CreateNetworkSegmentRequest, ae as CreateNotificationRuleRequest, af as CreateOAuth2ClientRequest, ag as CreatePermissionRequest, ah as CreatePgpKeyRequest, ai as CreateReactorRequest, aj as CreateRegistrationTokenRequest, ak as CreateRegistrationTokenResponse, al as CreateRegistrationTokenResponseWire, am as CreateResourceRequest, an as CreateRoleRequest, ao as CreateScimTokenRequest, ap as CreateScimTokenResponse, aq as CreateScimTokenResponseWire, ar as CreateScopeRequest, as as CreateServiceAccountRequest, at as CreateTenantRequest, au as CreateUserRequest, av as CreateUserRequestWire, aw as CreateWebhookRequest, ax as CreateWebhookRequestWire, ay as DeprovisionPolicy, az as DeviceToken, aA as DirectoryApi, aB as DirectoryKind, aC as DirectoryLinkResult, aD as DirectorySyncStatus, aE as EmailConfig, aF as EmailConfigApi, aG as EmailConfigOverride, aH as EmailTestResult, aI as EmailVerificationPolicy, aJ as EncryptRequest, aK as EncryptedExport, aL as FailurePolicy, aM as FederationApi, aN as FederationConfigResponse, aO as FederationLinkResponse, aP as GeneratedCaCertificate, aQ as GeneratedCaCertificateWire, aR as GeneratedCertificate, aS as GeneratedCertificateWire, aT as GeneratedPgpKey, aU as GeneratedPgpKeyWire, aV as GrantPermissionRequest, aW as GrantScopeConsent, aX as GrantedScope, aY as Group, aZ as GroupMapping, a_ as GroupsApi, a$ as HealthResponse, b0 as ImportCaCertificateRequest, b1 as ImportCaCertificateRequestWire, b2 as IssueSamlIdpCredential, b3 as KNOWN_SCIM_TARGET_AUTH_TYPES, b4 as KNOWN_SCIM_TARGET_SCOPE_TYPES, b5 as KeyAlgorithm, b6 as LinkDirectoryAccount, b7 as LockoutPolicy, b8 as MAX_ATTEMPTS, b9 as MAX_DELAY_MS, ba as ManagedBy, bb as ManagementNamespaces, bc as ManagementPlan, bd as ManifestApi, be as ManifestFailure, bf as MdsRefreshOutcome, bg as MdsStatusResponse, bh as MfaEnrollment, bi as MfaMethodResponse, bj as MfaMethodType, bk as MfaPolicy, bl as MigrateCustodyResponse, bm as MtlsTrustAnchorResponse, bn as NameIdFormat, bo as NamespaceScope, bp as NativeLoginTrustRequest, bq as NativeLoginTrustResponse, br as NetworkApi, bs as NetworkPolicyResponse, bt as NetworkPolicySpec, bu as NetworkProfileSpec, bv as NetworkReplyProfile, bw as NetworkReplyProfileInput, bx as NetworkSegmentKind, by as NetworkSegmentResponse, bz as NetworkSegmentSpec, bA as NetworkSpec, bB as NotificationEventType, bC as NotificationPolicy, bD as NotificationRuleResponse, bE as NotificationRulesApi, bF as OAuth2ClientCreatedResponse, bG as OAuth2ClientCreatedResponseWire, bH as OAuth2ClientResponse, bI as OAuth2Policy, bJ as Oauth2ClientsApi, bK as OidcAuthorizeRequest, bL as OidcAuthorizeResponse, bM as OidcCallbackRequest, bN as OidcCallbackResponse, bO as OidcPolicy, bP as OpaqueEnrollment, bQ as OpaqueEnrollmentPayload, bR as OpaquePolicy, bS as Organization, bT as OrganizationsApi, bU as Page, bV as PageRequest, bW as PasswordPolicy, bX as PasswordResetConfirmation, bY as PasswordResetContext, bZ as PasswordResetRequest, b_ as Permission, b$ as PermissionEffect, c0 as PermissionsApi, c1 as PgpKey, c2 as PgpKeyAlgorithm, c3 as PgpKeyPurpose, c4 as PgpKeyStatus, c5 as PgpKeysApi, c6 as PlannedAction, c7 as PlatformApi, c8 as PolicyResponse, c9 as PrivacyApi, ca as PrivacyPolicy, cb as ProviderConfig, cc as RadiusServiceType, cd as RadiusTerminationAction, ce as ReactorEventDescriptor, cf as ReactorMode, cg as ReactorResponse, ch as ReactorsApi, ci as ReadyResponse, cj as RefreshReuseResponse, ck as RegistrationTokenResponse, cl as ReplaceNetworkPolicyRequest, cm as ReplaceNetworkReplyProfileRequest, cn as ReplaceNetworkSegmentRequest, co as ResolvedPermissionGrant, cp as Resource, cq as ResourcesApi, cr as RetryOptions, cs as RetryPolicy, ct as Role, cu as RoleAssignment, cv as RoleBinding, cw as RoleGroupAssignment, cx as RoleServiceAccountAssignment, cy as RoleUserAssignment, cz as RolesApi, cA as RotateSecretResponse, cB as RotateSecretResponseWire, cC as SamlApi, cD as SamlBinding, cE as SamlIdpCredential, cF as SamlIdpCredentialPromotion, cG as SamlIdpCredentialStatus, cH as SamlIdpInfo, cI as SamlIdpSlot, cJ as SamlSpMetadataDraft, cK as ScimReconcileAccepted, cL as ScimTargetAuth, cM as ScimTargetDeliveryState, cN as ScimTargetInputWire, cO as ScimTargetScope, cP as ScimTargetsApi, cQ as ScimTokenResponse, cR as ScimTokenStatus, cS as ScimTokensApi, cT as Scope, cU as ScopesApi, cV as SecuritySettings, cW as ServiceAccountCreatedResponse, cX as ServiceAccountCreatedResponseWire, cY as ServiceAccountResponse, cZ as ServiceAccountsApi, c_ as SessionResponse, c$ as SetDirectoryConfigWire, d0 as SetMtlsTrustAnchor, d1 as SetOrgEmailConfig, d2 as SetOrgSettings, d3 as SettingsApi, d4 as SettingsScope, d5 as SignAuditBatchRequest, d6 as SignCertificateCsrRequest, d7 as SignIntermediateCsrRequest, d8 as SignedAuditBatch, d9 as SmtpConfig, da as SsfApi, db as SsfDeliveryMethod, dc as SsfEventType, dd as SsfStatusActor, de as SsfStreamInputWire, df as SsfStreamStatus, dg as SsfSubjectFormat, dh as StepOutcome, di as SubjectAltName, dj as Target, dk as Tenant, dl as TenantKind, dm as TenantSettingsOverride, dn as TenantStatus, dp as TenantsApi, dq as TokenExchangeTrustRequest, dr as TokenExchangeTrustResponse, ds as TokenPolicy, dt as UnknownAaguidAction, du as UpdateDirectoryConfig, dv as UpdateDirectoryConfigWire, dw as UpdateFederationConfigRequest, dx as UpdateFederationConfigRequestWire, dy as UpdateGroup, dz as UpdateNotificationRuleRequest, dA as UpdateOAuth2ClientRequest, dB as UpdateOrganizationRequest, dC as UpdatePermissionRequest, dD as UpdateReactorRequest, dE as UpdateResourceRequest, dF as UpdateRole, dG as UpdateScopeRequest, dH as UpdateServiceAccount, dI as UpdateTenant, dJ as UpdateUserRequest, dK as UpdateWebhookRequest, dL as UpdateWebhookRequestWire, dM as UserAttributeMap, dN as UserNameSource, dO as UserResponse, dP as UserStatus, dQ as UsersApi, dR as WebauthnAttestationPolicy, dS as WebauthnAuthenticationChallenge, dT as WebauthnAuthenticationResponse, dU as WebauthnCreationChallenge, dV as WebauthnCreationOptionsJson, b as WebauthnCredential, dW as WebauthnCredentialDescriptorJson, a as WebauthnLoginResult, dX as WebauthnPolicy, dY as WebauthnPolicyApi, dZ as WebauthnRegistrationChallenge, d_ as WebauthnRegistrationResponse, d$ as WebauthnRequestChallenge, e0 as WebauthnRequestOptionsJson, W as WebauthnWorkspace, e1 as WebhookResponse, e2 as WebhooksApi, e3 as assertKnownScimTargetAuth, e4 as assertKnownScimTargetScope, e5 as assertValidSubjectAltName, e6 as assertValidSubjectAltNameList, e7 as backoffMs, e8 as changedCount, e9 as changes, ea as clientRegistrationFromJson, eb as collectPages, ec as createFederationConfigRequestToWire, ed as createRegistrationTokenResponseFromWire, ee as createScimTokenResponseFromWire, ef as createUserRequestToWire, eg as createWebhookRequestToWire, eh as delayMs, ei as failure, ej as generatedCaCertificateFromWire, ek as generatedCertificateFromWire, el as generatedPgpKeyFromWire, em as hasMore, en as importCaCertificateRequestToWire, eo as inheritOf, ep as isComplete, eq as isConverged, er as managementNamespaces, es as normalizeSearch, et as oAuth2ClientCreatedResponseFromWire, eu as omitEmptyTenantScope, ev as omitNullMembers, ew as opaqueEnrollment, ex as opaqueEnrollmentForSelf, ey as pageQuery, ez as resourceKeyOf, eA as roleAssignmentInherits, eB as roleKeyOf, eC as rotateSecretResponseFromWire, eD as scimTargetInputToWire, eE as scrubDirectoryConfig, eF as scrubDirectoryLinkResult, eG as scrubDirectorySyncStatus, eH as scrubSamlIdpCredential, eI as scrubSamlIdpCredentialPromotion, eJ as scrubSamlIdpInfo, eK as scrubSamlServiceProvider, eL as scrubSamlSpMetadataDraft, eM as scrubScimReconcileAccepted, eN as scrubScimTargetResponse, eO as scrubSsfStream, eP as serviceAccountCreatedResponseFromWire, eQ as setDirectoryConfigToWire, eR as ssfStreamInputToWire, eS as topologicalOrder, eT as updateDirectoryConfigToWire, eU as updateFederationConfigRequestToWire, eV as updateWebhookRequestToWire, eW as validate, eX as webauthnRequestJson, eY as withFederationConfigResponseDefaults, eZ as withRetry } from '../client-CaurIxje.js';
|
|
3
|
+
export { A as AxiamClientOptions, D as DecisionMemo, F as FinishRequest, M as MAX_TTL_MS, S as SharedSession, T as TelemetryReporter, m as memoKey } from '../session-Beo11VT_.js';
|
|
4
4
|
export { C as ConfigClampedEvent, O as Outcome, R as RefreshEvent, b as RefreshRole, c as RequestEndEvent, d as RequestStartEvent, e as RetryEvent, S as SsfUnjudgedCategory, f as SsfUnjudgedEvent, a as TelemetryDispatcher, g as TelemetryEvent, T as TelemetryHook } from '../telemetry-Du0-zS5f.js';
|
|
5
5
|
export { A as AccessCheck, a as AccessDecision, b as AxiamUserInfo, L as LoginResult } from '../types-BOX-6Srv.js';
|
|
6
6
|
export { W as WebauthnFailure, c as classifyWebauthnError, w as webauthnErrorMessage } from '../webauthnErrors-m1LZiaRy.js';
|
|
7
|
-
import { N as NetworkError } from '../errors-
|
|
8
|
-
export { a as AuthError, A as AuthzError, b as AxiamError, I as IdTokenFailureReason, O as OAuthProtocolError } from '../errors-
|
|
7
|
+
import { N as NetworkError } from '../errors-CWlh-wcm.js';
|
|
8
|
+
export { a as AuthError, A as AuthzError, b as AxiamError, I as IdTokenFailureReason, O as OAuthProtocolError } from '../errors-CWlh-wcm.js';
|
|
9
9
|
export { S as Sensitive } from '../sensitive-BC_s7Rrd.js';
|
|
10
|
-
export { C as ConflictError, F as FieldError, N as NotFoundError, V as ValidationError, p as parseFieldErrors } from '../errors-
|
|
10
|
+
export { C as ConflictError, F as FieldError, N as NotFoundError, V as ValidationError, p as parseFieldErrors } from '../errors-DDo3oxcH.js';
|
|
11
11
|
import 'axios';
|
|
12
12
|
|
|
13
13
|
/**
|
package/dist/rest/index.js
CHANGED
|
@@ -47,11 +47,18 @@ var OAuthProtocolError = class _OAuthProtocolError extends AuthError {
|
|
|
47
47
|
* OPTIONAL, and §2 (contract 1.53, §28.12.3) dispatches on `error` alone.
|
|
48
48
|
*/
|
|
49
49
|
errorDescription;
|
|
50
|
-
|
|
50
|
+
/**
|
|
51
|
+
* The server's `Retry-After` in milliseconds, when this error is a `429` that carried one in
|
|
52
|
+
* delta-seconds form (contract 1.65 §37.3, C165-17). Absent otherwise; an HTTP-date is not read.
|
|
53
|
+
* Additive: honour it before retrying a rate-limited native sign-in or CIBA call.
|
|
54
|
+
*/
|
|
55
|
+
retryAfterMs;
|
|
56
|
+
constructor(error, errorDescription = "", retryAfterMs2) {
|
|
51
57
|
super(errorDescription ? `${error}: ${errorDescription}` : error);
|
|
52
58
|
this.name = "OAuthProtocolError";
|
|
53
59
|
this.error = error;
|
|
54
60
|
this.errorDescription = errorDescription;
|
|
61
|
+
if (retryAfterMs2 !== void 0) this.retryAfterMs = retryAfterMs2;
|
|
55
62
|
Object.setPrototypeOf(this, _OAuthProtocolError.prototype);
|
|
56
63
|
}
|
|
57
64
|
};
|
|
@@ -112,7 +119,7 @@ function isOAuth2ErrorBody(body) {
|
|
|
112
119
|
const record = body;
|
|
113
120
|
return typeof record.error === "string" && typeof record.error_description === "string";
|
|
114
121
|
}
|
|
115
|
-
function oauth2ErrorFromBody(body) {
|
|
122
|
+
function oauth2ErrorFromBody(body, retryAfterMs2) {
|
|
116
123
|
if (body === null || typeof body !== "object" || Array.isArray(body)) {
|
|
117
124
|
return void 0;
|
|
118
125
|
}
|
|
@@ -121,7 +128,7 @@ function oauth2ErrorFromBody(body) {
|
|
|
121
128
|
return void 0;
|
|
122
129
|
}
|
|
123
130
|
const description = typeof record.error_description === "string" ? record.error_description : "";
|
|
124
|
-
return new OAuthProtocolError(record.error, description);
|
|
131
|
+
return new OAuthProtocolError(record.error, description, retryAfterMs2);
|
|
125
132
|
}
|
|
126
133
|
var SAFE_RESPONSE_HEADERS = /* @__PURE__ */ new Set([
|
|
127
134
|
"content-type",
|
|
@@ -686,12 +693,21 @@ var SharedSession = class {
|
|
|
686
693
|
* The fetch adapter derives its `credentials` from `withCredentials: false`
|
|
687
694
|
* (`'omit'`); `fetchOptions.credentials` is set as well for adapters that
|
|
688
695
|
* read it.
|
|
696
|
+
*
|
|
697
|
+
* `fetchOptions.redirect: 'error'` is the browser persona's half of CONTRACT.md §12.1
|
|
698
|
+
* rule 3 ("No redirect is followed", C165-26). On the main client's `/oauth2/*` requests
|
|
699
|
+
* it makes `fetch` reject, which every caller maps to a `NetworkError` that carries
|
|
700
|
+
* neither the `Location` nor the request. Where `maxRedirects: 0` is set (the bare
|
|
701
|
+
* transport, `bareRequest`), axios's fetch adapter substitutes `redirect: 'manual'`
|
|
702
|
+
* (`lib/adapters/fetch.js`), so `'error'` is overridden there: the browser hands back an
|
|
703
|
+
* opaque-redirect (status 0), and `bareRequest` maps status 0 or any `3xx` to a
|
|
704
|
+
* `NetworkError` without the `Location` (`bareTransport.ts`).
|
|
689
705
|
* `NodeSession` overrides this to {@link noCredentialsConfig}: its jar-free
|
|
690
706
|
* agent pair is what keeps the cookies off there, and the fetch adapter
|
|
691
707
|
* would bypass that pair.
|
|
692
708
|
*/
|
|
693
709
|
oauth2RequestConfig() {
|
|
694
|
-
return { ...this.noCredentialsConfig(), adapter: "fetch", fetchOptions: { credentials: "omit" } };
|
|
710
|
+
return { ...this.noCredentialsConfig(), adapter: "fetch", fetchOptions: { credentials: "omit", redirect: "error" } };
|
|
695
711
|
}
|
|
696
712
|
};
|
|
697
713
|
function resolveTenantHeaderValue(options) {
|
|
@@ -1917,12 +1933,17 @@ async function bareRequest(session, operation, config) {
|
|
|
1917
1933
|
maxRedirects: 0,
|
|
1918
1934
|
validateStatus: () => true
|
|
1919
1935
|
});
|
|
1936
|
+
let response;
|
|
1920
1937
|
try {
|
|
1921
|
-
|
|
1938
|
+
response = await instance.request(config);
|
|
1922
1939
|
} catch (err) {
|
|
1923
1940
|
const code = err && typeof err === "object" && "code" in err && typeof err.code === "string" ? ` (${err.code})` : "";
|
|
1924
1941
|
throw new NetworkError(`${operation}: the request failed before any response arrived${code}`);
|
|
1925
1942
|
}
|
|
1943
|
+
if (response.status === 0 || response.status >= 300 && response.status < 400) {
|
|
1944
|
+
throw new NetworkError(`${operation}: the server answered with a redirect, which is not followed`);
|
|
1945
|
+
}
|
|
1946
|
+
return response;
|
|
1926
1947
|
}
|
|
1927
1948
|
function retryAfterMs(response) {
|
|
1928
1949
|
const raw = response.headers?.["retry-after"];
|