axiam-sdk 1.0.0-beta13 → 1.0.0-beta15
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 +101 -6
- package/dist/{authzCore-CrrzL1vM.d.cts → authzCore-BZahGkBf.d.cts} +13 -0
- package/dist/{authzCore-IhJd8o4F.d.ts → authzCore-Biyca_Rm.d.ts} +13 -0
- package/dist/browser/index.d.cts +24 -5
- package/dist/browser/index.d.ts +24 -5
- package/dist/browser/index.js +7 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/index.mjs +7 -1
- package/dist/browser/index.mjs.map +1 -1
- package/dist/{client-CPZ5WCob.d.cts → client-CzVEJTC5.d.cts} +90 -2
- package/dist/{client-Bf4p7wD5.d.ts → client-DLapMy-5.d.ts} +90 -2
- package/dist/{cookieJar--3J1ZLYS.d.ts → cookieJar-DIpQK-11.d.ts} +14 -4
- package/dist/{cookieJar-rwTCSTkI.d.cts → cookieJar-DoJeU4IN.d.cts} +14 -4
- package/dist/grpc/index.d.cts +5 -5
- package/dist/grpc/index.d.ts +5 -5
- package/dist/grpc/index.js +145 -9
- package/dist/grpc/index.js.map +1 -1
- package/dist/grpc/index.mjs +145 -9
- package/dist/grpc/index.mjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +113 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +113 -6
- package/dist/index.mjs.map +1 -1
- package/dist/middleware/index.d.cts +6 -5
- package/dist/middleware/index.d.ts +6 -5
- package/dist/middleware/index.js +150 -6
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware/index.mjs +148 -8
- package/dist/middleware/index.mjs.map +1 -1
- package/dist/nestjs/index.d.cts +2 -1
- package/dist/nestjs/index.d.ts +2 -1
- package/dist/node/index.d.cts +6 -5
- package/dist/node/index.d.ts +6 -5
- package/dist/node/index.js +287 -15
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +284 -16
- package/dist/node/index.mjs.map +1 -1
- package/dist/{oidcState-C_9FRWTp.d.cts → oidcState-CSi4DY8h.d.cts} +1 -1
- package/dist/{oidcState-YzbbVX-C.d.ts → oidcState-CffZ6PkC.d.ts} +1 -1
- package/dist/rest/index.d.cts +3 -3
- package/dist/rest/index.d.ts +3 -3
- package/dist/rest/index.js +113 -6
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/index.mjs +113 -6
- package/dist/rest/index.mjs.map +1 -1
- package/dist/revocationFeed-CDoD7Twr.d.cts +59 -0
- package/dist/revocationFeed-CDoD7Twr.d.ts +59 -0
- package/dist/{session-B0Lkz0X9.d.cts → session-oiuBA1ZA.d.cts} +17 -1
- package/dist/{session-fJCGq5jw.d.ts → session-ymrHvMuJ.d.ts} +17 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/browser/base64url.ts","../../src/rest/webauthnErrors.ts","../../src/browser/webauthn.ts"],"names":[],"mappings":";AAsBO,SAAS,iBAAiB,KAAA,EAAwC;AACvE,EAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,IAAA,EAAM,GAAG,CAAA,CAAE,OAAA,CAAQ,MAAM,GAAG,CAAA;AACzD,EAAA,MAAM,MAAA,GAAS,IAAA,CAAK,MAAA,CAAO,MAAA,CAAO,IAAA,CAAK,IAAA,CAAK,MAAA,CAAO,MAAA,GAAS,CAAC,CAAA,GAAI,CAAA,EAAG,GAAG,CAAC,CAAA;AACxE,EAAA,MAAM,QAAQ,IAAI,UAAA,CAAW,IAAI,WAAA,CAAY,MAAA,CAAO,MAAM,CAAC,CAAA;AAC3D,EAAA,KAAA,IAAS,IAAI,CAAA,EAAG,CAAA,GAAI,MAAA,CAAO,MAAA,EAAQ,KAAK,CAAA,EAAG;AACzC,IAAA,KAAA,CAAM,CAAC,CAAA,GAAI,MAAA,CAAO,UAAA,CAAW,CAAC,CAAA;AAAA,EAChC;AACA,EAAA,OAAO,KAAA;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Y,CAAA,EAAE,GAC5D,EAAC;AAAA,IACL,GAAI,KAAK,gBAAA,GACL,EAAE,kBAAkB,IAAA,CAAK,gBAAA,KACzB,EAAC;AAAA,IACL,GAAI,KAAK,UAAA,GACL,EAAE,YAAY,IAAA,CAAK,UAAA,KACnB;AAAC,GACP;AACF;AAEA,SAAS,aAAa,CAAA,EAAoE;AACxF,EAAA,OAAO;AAAA,IACL,EAAA,EAAI,gBAAA,CAAiB,CAAA,CAAE,EAAE,CAAA;AAAA,IACzB,MAAM,CAAA,CAAE,IAAA;AAAA,IACR,GAAI,EAAE,UAAA,GAAa,EAAE,YAAY,CAAA,CAAE,UAAA,KAA2C;AAAC,GACjF;AACF","file":"index.mjs","sourcesContent":["// base64url ⇄ ArrayBuffer, for the WebAuthn JSON form (CONTRACT.md §24.6).\n//\n// Hand-rolled rather than pulled from `@simplewebauthn/browser`, which is what\n// the AXIAM admin UI uses. The conversion is thirty lines and fully specified\n// by RFC 4648 §5; a runtime dependency on every consumer's bundle to avoid\n// writing them, in a package whose whole job is to add as little as possible\n// to a browser bundle, is the wrong trade. The test file pins both directions\n// against fixed vectors, including the padding cases that are the only part\n// anyone gets wrong.\n//\n// Every buffer in a WebAuthn JSON message is base64url, **unpadded**. We\n// accept padding on the way in, because a server or a library that emits it is\n// not wrong, and never emit it on the way out.\n\n/**\n * Decode an unpadded (or padded) base64url string to bytes.\n *\n * Typed `Uint8Array<ArrayBuffer>` rather than the bare `Uint8Array`, whose\n * default parameter is `ArrayBufferLike` and therefore admits\n * `SharedArrayBuffer` — which `BufferSource`, and so every WebAuthn DOM\n * option, does not. The buffer is freshly allocated here and is never shared.\n */\nexport function base64UrlToBytes(value: string): Uint8Array<ArrayBuffer> {\n const padded = value.replace(/-/g, '+').replace(/_/g, '/');\n const binary = atob(padded.padEnd(Math.ceil(padded.length / 4) * 4, '='));\n const bytes = new Uint8Array(new ArrayBuffer(binary.length));\n for (let i = 0; i < binary.length; i += 1) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\n/** Encode bytes as unpadded base64url. */\nexport function bytesToBase64Url(buffer: ArrayBuffer | Uint8Array): string {\n const bytes = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);\n let binary = '';\n // Chunked: `String.fromCharCode(...bytes)` blows the argument limit on an\n // attestation object, which is routinely a few kilobytes.\n const CHUNK = 0x8000;\n for (let i = 0; i < bytes.length; i += CHUNK) {\n binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK));\n }\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\n","// Ceremony failure classification (CONTRACT.md §24.6b rule 5).\n//\n// Isomorphic on purpose. §24.6b rule 5's closing paragraph puts this in the\n// core rather than beside the linked-API helper: an Android app catching a\n// `CreateCredentialException`, or a Node service handed an error string by the\n// handset that ran the ceremony, has the same five outcomes and the same reason\n// to want one vocabulary for them. Nothing here touches the DOM — it reads the\n// error's `name`, which is the only machine-readable part any platform gives.\n\n/**\n * A ceremony failure a caller can say something useful about.\n *\n * Five outcomes, and the interesting ones are the first two.\n */\nexport type WebauthnFailure =\n | 'cancelled'\n | 'already_registered'\n | 'timeout'\n | 'unsupported'\n | 'unknown';\n\n/**\n * Map a platform ceremony error to its canonical classification (§24.6b rule 5).\n *\n * Accepts anything: a browser `DOMException`, an Android\n * `CreateCredentialException` name relayed as a string, an\n * `ASAuthorizationError` code relayed by name. Everything unrecognized is\n * `unknown` rather than a throw — a classifier that can fail is one more thing\n * for an error handler to handle.\n */\nexport function classifyWebauthnError(err: unknown): WebauthnFailure {\n const name = errorName(err);\n switch (name) {\n // NotAllowedError covers BOTH an explicit refusal and a silent timeout.\n // The spec deliberately refuses to distinguish them, because telling a\n // website which one happened leaks whether an authenticator was present.\n // \"cancelled\" is therefore the honest label for both — and it must not be\n // recovered by timing the call.\n case 'NotAllowedError':\n case 'canceled':\n case 'cancelled':\n return 'cancelled';\n // The authenticator already holds a credential for this account: the\n // server sent it in `excludeCredentials` and the authenticator refused to\n // silently mint a second. That is the exclusion list working, not a\n // failure — and it is the only classification whose remedy is \"use a\n // different device\" rather than \"try again\".\n case 'InvalidStateError':\n return 'already_registered';\n case 'AbortError':\n case 'timeout':\n return 'timeout';\n case 'NotSupportedError':\n case 'SecurityError':\n return 'unsupported';\n default:\n return 'unknown';\n }\n}\n\n/**\n * Copy for each failure, safe to show a user.\n *\n * The `cancelled` string deliberately does not accuse anyone of cancelling: the\n * same classification covers a silent timeout, and the spec will not say which\n * happened.\n */\nexport function webauthnErrorMessage(failure: WebauthnFailure): string {\n switch (failure) {\n case 'cancelled':\n return 'The request was cancelled or timed out. You can try again.';\n case 'already_registered':\n return 'This device is already registered on your account. Try a different device, or remove the existing one first.';\n case 'timeout':\n return 'The request timed out before it completed. Please try again.';\n case 'unsupported':\n return 'This browser or device cannot be used for passkeys. Try a different browser, or use another sign-in method.';\n case 'unknown':\n return 'Something went wrong. Please try again.';\n }\n}\n\n/** The platform's own error name, however it arrived. */\nfunction errorName(err: unknown): string | undefined {\n if (typeof err === 'string') return err;\n if (typeof err !== 'object' || err === null) return undefined;\n const name = (err as { name?: unknown }).name;\n return typeof name === 'string' ? name : undefined;\n}\n","// The WebAuthn platform ceremony (CONTRACT.md §24.6).\n//\n// This is the half of a passkey ceremony that talks to an *authenticator*, and\n// the only half that needs a browser. It lives on its own subpath so the\n// isomorphic `/rest` core stays free of DOM code: a Node consumer gets the\n// §24.1 relying-party layer and nothing here, which is §24.7's posture for the\n// Node build stated as a module boundary rather than as a runtime throw.\n//\n// ## What this module is allowed to change, which is almost nothing\n//\n// §24.0: the server picks every option and verifies every response, so the\n// options reach `navigator.credentials` as the server sent them and the\n// authenticator's answer goes back untouched. The two things that happen here\n// look like exceptions and are not:\n//\n// 1. **base64url → ArrayBuffer.** The DOM API takes `BufferSource` where the\n// JSON form carries a base64url string. Those are the same bytes in the\n// representation each side demands, which is a transcription, not an\n// adjustment. Nothing is defaulted, dropped, reordered or re-derived —\n// the round-trip test asserts exactly that.\n// 2. **`authenticatorAttachment`.** §24.6 rule 4's single permitted\n// addition, and only from an explicit caller argument. It selects which\n// authenticator the user is prompted for; it cannot weaken what the\n// server will accept. Without it, a user who asked for a security key is\n// prompted for the platform biometric instead.\n\nimport type {\n AxiamClient,\n WebauthnAuthenticationResponse,\n WebauthnCreationChallenge,\n WebauthnCreationOptionsJson,\n WebauthnCredential,\n WebauthnCredentialDescriptorJson,\n WebauthnLoginResult,\n WebauthnRegistrationResponse,\n WebauthnRequestChallenge,\n WebauthnRequestOptionsJson,\n WebauthnWorkspace,\n} from '../rest/index.js';\nimport { base64UrlToBytes, bytesToBase64Url } from './base64url.js';\n\n// §24.6b rule 5's classification lives in the isomorphic core, not here: an\n// Android app catching a `CreateCredentialException` wants the same vocabulary,\n// and it never loads this module. Re-exported so a browser consumer still finds\n// it on the subpath it is already importing from.\nexport { classifyWebauthnError, webauthnErrorMessage } from '../rest/index.js';\nexport type { WebauthnFailure } from '../rest/index.js';\n\n// ---------------------------------------------------------------------------\n// Feature detection (§24.6 rule 6)\n// ---------------------------------------------------------------------------\n\n/**\n * Whether this runtime can perform a WebAuthn ceremony at all.\n *\n * A query, not an exception (§24.6 rule 6) — a caller hides the enrolment\n * button rather than offering one that throws. Answers `false` in Node, where\n * the §24.1 relying-party layer still works fine.\n */\nexport function isWebauthnSupported(): boolean {\n return (\n typeof globalThis !== 'undefined' &&\n typeof (globalThis as { PublicKeyCredential?: unknown }).PublicKeyCredential !== 'undefined' &&\n typeof navigator !== 'undefined' &&\n typeof navigator.credentials?.get === 'function'\n );\n}\n\n/**\n * Whether this browser supports **conditional mediation** — passkey autofill,\n * where saved passkeys are offered from inside the username field rather than\n * behind a button.\n *\n * Returns `false` rather than throwing where the probe itself is missing\n * (§24.6 rule 3): conditional UI is a progressive enhancement, and its absence\n * must degrade to the explicit prompt, never to a broken sign-in page.\n */\nexport async function isConditionalMediationAvailable(): Promise<boolean> {\n if (!isWebauthnSupported()) return false;\n const ctor = (globalThis as { PublicKeyCredential?: { isConditionalMediationAvailable?: unknown } })\n .PublicKeyCredential;\n const probe = ctor?.isConditionalMediationAvailable;\n if (typeof probe !== 'function') return false;\n try {\n return await (probe as () => Promise<boolean>).call(ctor);\n } catch {\n return false;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Composed helpers (§24.6 rule 1 — additive; the six wire ops stay public)\n// ---------------------------------------------------------------------------\n\n/**\n * Which kind of authenticator the user reached for.\n *\n * A hint only (§24.6 rule 4). `platform` is a passkey built into the device\n * (Touch ID, Windows Hello, a phone); `cross-platform` is a removable security\n * key.\n */\nexport type AuthenticatorKind = 'platform' | 'cross-platform';\n\n/** Options shared by the two sign-in helpers. */\nexport interface WebauthnCeremonyOptions {\n /**\n * Use conditional mediation (passkey autofill) instead of a modal prompt.\n *\n * The returned promise may never settle — the user simply may not pick a\n * passkey — so a caller using this must be prepared to abandon it, and MUST\n * NOT surface an abandoned ceremony as an authentication failure (§24.6\n * rule 3). The browser aborts it when the page navigates.\n */\n conditional?: boolean;\n /** Abort the ceremony. Also how a conditional ceremony is abandoned. */\n signal?: AbortSignal;\n}\n\n/**\n * Enrol a passkey or security key for the signed-in user (§24.6).\n *\n * Runs the full ceremony: `register/start`, the authenticator, then\n * `register/finish`. The three steps stay individually callable on\n * `AxiamClient` — a caller driving a virtual authenticator in a test needs the\n * pair directly, which is why this helper is additive rather than the only way\n * in (§24.6 rule 1).\n *\n * @param kind optional `authenticatorAttachment` hint. Omitted entirely when\n * not passed — the SDK never infers it and never defaults it.\n */\nexport async function webauthnRegister(\n client: AxiamClient,\n credentialName: string,\n kind?: AuthenticatorKind,\n options?: WebauthnCeremonyOptions,\n): Promise<WebauthnCredential> {\n requireSupport('webauthnRegister');\n\n const { challenge, stateToken } = await client.webauthnRegisterStart();\n const credential = await createCredential(challenge, kind, options?.signal);\n return client.webauthnRegisterFinish(stateToken, credentialName, credential);\n}\n\n/**\n * Sign in with a passkey as a **second factor** (§24.6).\n *\n * `challengeToken` is the `mfaToken` from a `login()` that answered\n * `mfa_required` with `\"webauthn\"` among its methods.\n */\nexport async function webauthnLogin(\n client: AxiamClient,\n challengeToken: string,\n options?: WebauthnCeremonyOptions,\n): Promise<WebauthnLoginResult> {\n requireSupport('webauthnLogin');\n\n const { challenge, stateToken } = await client.webauthnAuthenticateStart(challengeToken);\n const assertion = await getAssertion(challenge, options);\n return client.webauthnAuthenticateFinish(stateToken, assertion);\n}\n\n/**\n * Sign in with a passkey **without typing a username first** (§24.6).\n *\n * The workspace still has to be named — a discoverable credential is resolved\n * inside one tenant — but it comes from the client's own configuration unless\n * overridden, and slugs are accepted.\n */\nexport async function webauthnDiscoverableLogin(\n client: AxiamClient,\n workspace?: WebauthnWorkspace,\n options?: WebauthnCeremonyOptions,\n): Promise<WebauthnLoginResult> {\n requireSupport('webauthnDiscoverableLogin');\n\n const { challenge, stateToken } = await client.webauthnDiscoverableStart(workspace);\n const assertion = await getAssertion(challenge, options);\n return client.webauthnDiscoverableFinish(stateToken, assertion);\n}\n\n// ---------------------------------------------------------------------------\n// Ceremony internals\n// ---------------------------------------------------------------------------\n\nfunction requireSupport(operation: string): void {\n if (!isWebauthnSupported()) {\n throw new Error(\n `${operation}: this runtime has no WebAuthn authenticator. Check isWebauthnSupported() first, ` +\n 'or use the relying-party operations on AxiamClient with a response produced elsewhere ' +\n '(CONTRACT.md §24.6).',\n );\n }\n}\n\n/** Run `navigator.credentials.create()` and return the JSON form of its answer. */\nasync function createCredential(\n challenge: WebauthnCreationChallenge,\n kind: AuthenticatorKind | undefined,\n signal: AbortSignal | undefined,\n): Promise<WebauthnRegistrationResponse> {\n const credential = (await navigator.credentials.create({\n publicKey: toCreationOptions(challenge.publicKey, kind),\n ...(signal ? { signal } : {}),\n })) as PublicKeyCredential | null;\n\n if (!credential) {\n // Spec-wise unreachable — a rejection is how failure is reported — but a\n // `null` here would otherwise become a confusing property access.\n throw new Error('webauthnRegister: the authenticator returned no credential.');\n }\n\n const response = credential.response as AuthenticatorAttestationResponse;\n const transports =\n typeof response.getTransports === 'function' ? response.getTransports() : undefined;\n\n return {\n id: credential.id,\n rawId: bytesToBase64Url(credential.rawId),\n response: {\n clientDataJSON: bytesToBase64Url(response.clientDataJSON),\n attestationObject: bytesToBase64Url(response.attestationObject),\n ...(transports && transports.length > 0 ? { transports } : {}),\n },\n type: credential.type,\n ...(credential.authenticatorAttachment\n ? { authenticatorAttachment: credential.authenticatorAttachment }\n : {}),\n clientExtensionResults: credential.getClientExtensionResults() as Record<string, unknown>,\n };\n}\n\n/** Run `navigator.credentials.get()` and return the JSON form of its answer. */\nasync function getAssertion(\n challenge: WebauthnRequestChallenge,\n options: WebauthnCeremonyOptions | undefined,\n): Promise<WebauthnAuthenticationResponse> {\n const credential = (await navigator.credentials.get({\n publicKey: toRequestOptions(challenge.publicKey),\n ...(options?.conditional ? { mediation: 'conditional' as CredentialMediationRequirement } : {}),\n ...(options?.signal ? { signal: options.signal } : {}),\n })) as PublicKeyCredential | null;\n\n if (!credential) {\n throw new Error('webauthnLogin: the authenticator returned no assertion.');\n }\n\n const response = credential.response as AuthenticatorAssertionResponse;\n return {\n id: credential.id,\n rawId: bytesToBase64Url(credential.rawId),\n response: {\n clientDataJSON: bytesToBase64Url(response.clientDataJSON),\n authenticatorData: bytesToBase64Url(response.authenticatorData),\n signature: bytesToBase64Url(response.signature),\n ...(response.userHandle ? { userHandle: bytesToBase64Url(response.userHandle) } : {}),\n },\n type: credential.type,\n ...(credential.authenticatorAttachment\n ? { authenticatorAttachment: credential.authenticatorAttachment }\n : {}),\n clientExtensionResults: credential.getClientExtensionResults() as Record<string, unknown>,\n };\n}\n\n/**\n * Transcribe the server's creation options into what the DOM API takes.\n *\n * Every optional field is forwarded **only if the server sent it** — §24.0\n * rule 1 forbids expanding an absent `authenticatorSelection` into an empty\n * object or supplying a `timeout` the server did not choose. The string enums\n * (`residentKey`, `userVerification`, `attestation`) are cast rather than\n * validated: §24.0 rule 2 says an SDK may fail to parse but must not refuse\n * options it parsed, and a client-side allow-list of acceptable values is a\n * second policy engine.\n */\nfunction toCreationOptions(\n json: WebauthnCreationOptionsJson,\n kind: AuthenticatorKind | undefined,\n): PublicKeyCredentialCreationOptions {\n const selection = json.authenticatorSelection;\n // The only place this module adds anything (§24.6 rule 4). When the caller\n // passed no kind and the server sent no selection, the key stays absent.\n const authenticatorSelection =\n selection || kind\n ? ({\n ...(selection?.residentKey ? { residentKey: selection.residentKey } : {}),\n ...(selection?.requireResidentKey !== undefined\n ? { requireResidentKey: selection.requireResidentKey }\n : {}),\n ...(selection?.userVerification\n ? { userVerification: selection.userVerification }\n : {}),\n ...(kind\n ? { authenticatorAttachment: kind }\n : selection?.authenticatorAttachment\n ? { authenticatorAttachment: selection.authenticatorAttachment }\n : {}),\n } as AuthenticatorSelectionCriteria)\n : undefined;\n\n return {\n challenge: base64UrlToBytes(json.challenge),\n rp: json.rp,\n user: {\n id: base64UrlToBytes(json.user.id),\n name: json.user.name,\n displayName: json.user.displayName,\n },\n pubKeyCredParams: json.pubKeyCredParams as PublicKeyCredentialParameters[],\n ...(json.timeout !== undefined ? { timeout: json.timeout } : {}),\n ...(json.excludeCredentials\n ? { excludeCredentials: json.excludeCredentials.map(toDescriptor) }\n : {}),\n ...(authenticatorSelection ? { authenticatorSelection } : {}),\n ...(json.attestation\n ? { attestation: json.attestation as AttestationConveyancePreference }\n : {}),\n ...(json.extensions\n ? { extensions: json.extensions as AuthenticationExtensionsClientInputs }\n : {}),\n };\n}\n\n/** The same transcription for an assertion challenge. */\nfunction toRequestOptions(json: WebauthnRequestOptionsJson): PublicKeyCredentialRequestOptions {\n return {\n challenge: base64UrlToBytes(json.challenge),\n ...(json.timeout !== undefined ? { timeout: json.timeout } : {}),\n ...(json.rpId ? { rpId: json.rpId } : {}),\n ...(json.allowCredentials\n ? { allowCredentials: json.allowCredentials.map(toDescriptor) }\n : {}),\n ...(json.userVerification\n ? { userVerification: json.userVerification as UserVerificationRequirement }\n : {}),\n ...(json.extensions\n ? { extensions: json.extensions as AuthenticationExtensionsClientInputs }\n : {}),\n };\n}\n\nfunction toDescriptor(d: WebauthnCredentialDescriptorJson): PublicKeyCredentialDescriptor {\n return {\n id: base64UrlToBytes(d.id),\n type: d.type as PublicKeyCredentialType,\n ...(d.transports ? { transports: d.transports as AuthenticatorTransport[] } : {}),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/browser/base64url.ts","../../src/rest/webauthnErrors.ts","../../src/browser/webauthn.ts"],"names":[],"mappings":";AAsBO,SAAS,iBAAiB,KAAA,EAAwC;AACvE,EAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,IAAA,EAAM,GAAG,CAAA,CAAE,OAAA,CAAQ,MAAM,GAAG,CAAA;AACzD,EAAA,MAAM,MAAA,GAAS,IAAA,CAAK,MAAA,CAAO,MAAA,CAAO,IAAA,CAAK,IAAA,CAAK,MAAA,CAAO,MAAA,GAAS,CAAC,CAAA,GAAI,CAAA,EAAG,GAAG,CAAC,CAAA;AACxE,EAAA,MAAM,QAAQ,IAAI,UAAA,CAAW,IAAI,WAAA,CAAY,MAAA,CAAO,MAAM,CAAC,CAAA;AAC3D,EAAA,KAAA,IAAS,IAAI,CAAA,EAAG,CAAA,GAAI,MAAA,CAAO,MAAA,EAAQ,KAAK,CAAA,EAAG;AACzC,IAAA,KAAA,CAAM,CAAC,CAAA,GAAI,MAAA,CAAO,UAAA,CAAW,CAAC,CAAA;AAAA,EAChC;AACA,EAAA,OAAO,KAAA;AACT;AAGO,SAAS,iBAAiB,MAAA,EAA0C;AACzE,EAAA,MAAM,QAAQ,MAAA,YAAkB,UAAA,GAAa,MAAA,GAAS,IAAI,WAAW,MAAM,CAAA;AAC3E,EAAA,IAAI,MAAA,GAAS,EAAA;AAGb,EAAA,MAAM,KAAA,GAAQ,KAAA;AACd,EAAA,KAAA,IAAS,IAAI,CAAA,EAAG,CAAA,GAAI,KAAA,CAAM,MAAA,EAAQ,KAAK,KAAA,EAAO;AAC5C,IAAA,MAAA,IAAU,MAAA,CA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,gBAAA,EAAkB,IAAA,CAAK,gBAAA,CAAiB,GAAA,CAAI,YAAY,CAAA,EAAE,GAC5D,EAAC;AAAA,IACL,GAAI,KAAK,gBAAA,GACL,EAAE,kBAAkB,IAAA,CAAK,gBAAA,KACzB,EAAC;AAAA,IACL,GAAI,KAAK,UAAA,GACL,EAAE,YAAY,IAAA,CAAK,UAAA,KACnB;AAAC,GACP;AACF;AAEA,SAAS,aAAa,CAAA,EAAoE;AACxF,EAAA,OAAO;AAAA,IACL,EAAA,EAAI,gBAAA,CAAiB,CAAA,CAAE,EAAE,CAAA;AAAA,IACzB,MAAM,CAAA,CAAE,IAAA;AAAA,IACR,GAAI,EAAE,UAAA,GAAa,EAAE,YAAY,CAAA,CAAE,UAAA,KAA2C;AAAC,GACjF;AACF","file":"index.mjs","sourcesContent":["// base64url ⇄ ArrayBuffer, for the WebAuthn JSON form (CONTRACT.md §24.6).\n//\n// Hand-rolled rather than pulled from `@simplewebauthn/browser`, which is what\n// the AXIAM admin UI uses. The conversion is thirty lines and fully specified\n// by RFC 4648 §5; a runtime dependency on every consumer's bundle to avoid\n// writing them, in a package whose whole job is to add as little as possible\n// to a browser bundle, is the wrong trade. The test file pins both directions\n// against fixed vectors, including the padding cases that are the only part\n// anyone gets wrong.\n//\n// Every buffer in a WebAuthn JSON message is base64url, **unpadded**. We\n// accept padding on the way in, because a server or a library that emits it is\n// not wrong, and never emit it on the way out.\n\n/**\n * Decode an unpadded (or padded) base64url string to bytes.\n *\n * Typed `Uint8Array<ArrayBuffer>` rather than the bare `Uint8Array`, whose\n * default parameter is `ArrayBufferLike` and therefore admits\n * `SharedArrayBuffer` — which `BufferSource`, and so every WebAuthn DOM\n * option, does not. The buffer is freshly allocated here and is never shared.\n */\nexport function base64UrlToBytes(value: string): Uint8Array<ArrayBuffer> {\n const padded = value.replace(/-/g, '+').replace(/_/g, '/');\n const binary = atob(padded.padEnd(Math.ceil(padded.length / 4) * 4, '='));\n const bytes = new Uint8Array(new ArrayBuffer(binary.length));\n for (let i = 0; i < binary.length; i += 1) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n\n/** Encode bytes as unpadded base64url. */\nexport function bytesToBase64Url(buffer: ArrayBuffer | Uint8Array): string {\n const bytes = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer);\n let binary = '';\n // Chunked: `String.fromCharCode(...bytes)` blows the argument limit on an\n // attestation object, which is routinely a few kilobytes.\n const CHUNK = 0x8000;\n for (let i = 0; i < bytes.length; i += CHUNK) {\n binary += String.fromCharCode(...bytes.subarray(i, i + CHUNK));\n }\n return btoa(binary).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}\n","// Ceremony failure classification (CONTRACT.md §24.6b rule 5).\n//\n// Isomorphic on purpose. §24.6b rule 5's closing paragraph puts this in the\n// core rather than beside the linked-API helper: an Android app catching a\n// `CreateCredentialException`, or a Node service handed an error string by the\n// handset that ran the ceremony, has the same five outcomes and the same reason\n// to want one vocabulary for them. Nothing here touches the DOM — it reads the\n// error's `name`, which is the only machine-readable part any platform gives.\n\n/**\n * A ceremony failure a caller can say something useful about.\n *\n * Five outcomes, and the interesting ones are the first two.\n */\nexport type WebauthnFailure =\n | 'cancelled'\n | 'already_registered'\n | 'timeout'\n | 'unsupported'\n | 'unknown';\n\n/**\n * Map a platform ceremony error to its canonical classification (§24.6b rule 5).\n *\n * Accepts anything: a browser `DOMException`, an Android\n * `CreateCredentialException` name relayed as a string, an\n * `ASAuthorizationError` code relayed by name. Everything unrecognized is\n * `unknown` rather than a throw — a classifier that can fail is one more thing\n * for an error handler to handle.\n */\nexport function classifyWebauthnError(err: unknown): WebauthnFailure {\n const name = errorName(err);\n switch (name) {\n // NotAllowedError covers BOTH an explicit refusal and a silent timeout.\n // The spec deliberately refuses to distinguish them, because telling a\n // website which one happened leaks whether an authenticator was present.\n // \"cancelled\" is therefore the honest label for both — and it must not be\n // recovered by timing the call.\n case 'NotAllowedError':\n case 'canceled':\n case 'cancelled':\n return 'cancelled';\n // The authenticator already holds a credential for this account: the\n // server sent it in `excludeCredentials` and the authenticator refused to\n // silently mint a second. That is the exclusion list working, not a\n // failure — and it is the only classification whose remedy is \"use a\n // different device\" rather than \"try again\".\n case 'InvalidStateError':\n return 'already_registered';\n case 'AbortError':\n case 'timeout':\n return 'timeout';\n case 'NotSupportedError':\n case 'SecurityError':\n return 'unsupported';\n default:\n return 'unknown';\n }\n}\n\n/**\n * Copy for each failure, safe to show a user.\n *\n * The `cancelled` string deliberately does not accuse anyone of cancelling: the\n * same classification covers a silent timeout, and the spec will not say which\n * happened.\n */\nexport function webauthnErrorMessage(failure: WebauthnFailure): string {\n switch (failure) {\n case 'cancelled':\n return 'The request was cancelled or timed out. You can try again.';\n case 'already_registered':\n return 'This device is already registered on your account. Try a different device, or remove the existing one first.';\n case 'timeout':\n return 'The request timed out before it completed. Please try again.';\n case 'unsupported':\n return 'This browser or device cannot be used for passkeys. Try a different browser, or use another sign-in method.';\n case 'unknown':\n return 'Something went wrong. Please try again.';\n }\n}\n\n/** The platform's own error name, however it arrived. */\nfunction errorName(err: unknown): string | undefined {\n if (typeof err === 'string') return err;\n if (typeof err !== 'object' || err === null) return undefined;\n const name = (err as { name?: unknown }).name;\n return typeof name === 'string' ? name : undefined;\n}\n","// The WebAuthn platform ceremony (CONTRACT.md §24.6).\n//\n// This is the half of a passkey ceremony that talks to an *authenticator*, and\n// the only half that needs a browser. It lives on its own subpath so the\n// isomorphic `/rest` core stays free of DOM code: a Node consumer gets the\n// §24.1 relying-party layer and nothing here, which is §24.7's posture for the\n// Node build stated as a module boundary rather than as a runtime throw.\n//\n// ## What this module is allowed to change, which is almost nothing\n//\n// §24.0: the server picks every option and verifies every response, so the\n// options reach `navigator.credentials` as the server sent them and the\n// authenticator's answer goes back untouched. The two things that happen here\n// look like exceptions and are not:\n//\n// 1. **base64url → ArrayBuffer.** The DOM API takes `BufferSource` where the\n// JSON form carries a base64url string. Those are the same bytes in the\n// representation each side demands, which is a transcription, not an\n// adjustment. Nothing is defaulted, dropped, reordered or re-derived —\n// the round-trip test asserts exactly that.\n// 2. **`authenticatorAttachment`.** §24.6 rule 4's single permitted\n// addition, and only from an explicit caller argument. It selects which\n// authenticator the user is prompted for; it cannot weaken what the\n// server will accept. Without it, a user who asked for a security key is\n// prompted for the platform biometric instead.\n\nimport type {\n AxiamClient,\n LoginResult,\n Sensitive,\n WebauthnAuthenticationResponse,\n WebauthnCreationChallenge,\n WebauthnCreationOptionsJson,\n WebauthnCredential,\n WebauthnCredentialDescriptorJson,\n WebauthnLoginResult,\n WebauthnRegistrationResponse,\n WebauthnRequestChallenge,\n WebauthnRequestOptionsJson,\n WebauthnWorkspace,\n} from '../rest/index.js';\nimport { base64UrlToBytes, bytesToBase64Url } from './base64url.js';\n\n// §24.6b rule 5's classification lives in the isomorphic core, not here: an\n// Android app catching a `CreateCredentialException` wants the same vocabulary,\n// and it never loads this module. Re-exported so a browser consumer still finds\n// it on the subpath it is already importing from.\nexport { classifyWebauthnError, webauthnErrorMessage } from '../rest/index.js';\nexport type { WebauthnFailure } from '../rest/index.js';\n\n// ---------------------------------------------------------------------------\n// Feature detection (§24.6 rule 6)\n// ---------------------------------------------------------------------------\n\n/**\n * Whether this runtime can perform a WebAuthn ceremony at all.\n *\n * A query, not an exception (§24.6 rule 6) — a caller hides the enrolment\n * button rather than offering one that throws. Answers `false` in Node, where\n * the §24.1 relying-party layer still works fine.\n */\nexport function isWebauthnSupported(): boolean {\n return (\n typeof globalThis !== 'undefined' &&\n typeof (globalThis as { PublicKeyCredential?: unknown }).PublicKeyCredential !== 'undefined' &&\n typeof navigator !== 'undefined' &&\n typeof navigator.credentials?.get === 'function'\n );\n}\n\n/**\n * Whether this browser supports **conditional mediation** — passkey autofill,\n * where saved passkeys are offered from inside the username field rather than\n * behind a button.\n *\n * Returns `false` rather than throwing where the probe itself is missing\n * (§24.6 rule 3): conditional UI is a progressive enhancement, and its absence\n * must degrade to the explicit prompt, never to a broken sign-in page.\n */\nexport async function isConditionalMediationAvailable(): Promise<boolean> {\n if (!isWebauthnSupported()) return false;\n const ctor = (globalThis as { PublicKeyCredential?: { isConditionalMediationAvailable?: unknown } })\n .PublicKeyCredential;\n const probe = ctor?.isConditionalMediationAvailable;\n if (typeof probe !== 'function') return false;\n try {\n return await (probe as () => Promise<boolean>).call(ctor);\n } catch {\n return false;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Composed helpers (§24.6 rule 1 — additive; the six wire ops stay public)\n// ---------------------------------------------------------------------------\n\n/**\n * Which kind of authenticator the user reached for.\n *\n * A hint only (§24.6 rule 4). `platform` is a passkey built into the device\n * (Touch ID, Windows Hello, a phone); `cross-platform` is a removable security\n * key.\n */\nexport type AuthenticatorKind = 'platform' | 'cross-platform';\n\n/** Options shared by the two sign-in helpers. */\nexport interface WebauthnCeremonyOptions {\n /**\n * Use conditional mediation (passkey autofill) instead of a modal prompt.\n *\n * The returned promise may never settle — the user simply may not pick a\n * passkey — so a caller using this must be prepared to abandon it, and MUST\n * NOT surface an abandoned ceremony as an authentication failure (§24.6\n * rule 3). The browser aborts it when the page navigates.\n */\n conditional?: boolean;\n /** Abort the ceremony. Also how a conditional ceremony is abandoned. */\n signal?: AbortSignal;\n}\n\n/**\n * Enrol a passkey or security key for the signed-in user (§24.6).\n *\n * Runs the full ceremony: `register/start`, the authenticator, then\n * `register/finish`. The three steps stay individually callable on\n * `AxiamClient` — a caller driving a virtual authenticator in a test needs the\n * pair directly, which is why this helper is additive rather than the only way\n * in (§24.6 rule 1).\n *\n * @param kind optional `authenticatorAttachment` hint. Omitted entirely when\n * not passed — the SDK never infers it and never defaults it.\n */\nexport async function webauthnRegister(\n client: AxiamClient,\n credentialName: string,\n kind?: AuthenticatorKind,\n options?: WebauthnCeremonyOptions,\n): Promise<WebauthnCredential> {\n requireSupport('webauthnRegister');\n\n const { challenge, stateToken } = await client.webauthnRegisterStart();\n const credential = await createCredential(challenge, kind, options?.signal);\n return client.webauthnRegisterFinish(stateToken, credentialName, credential);\n}\n\n/**\n * Enrol a passkey or security key as the account's **first** factor, during\n * forced login setup (§24.6, contract 1.45) — the setup-token twin of\n * {@link webauthnRegister}, reached where `mfaSetupEnroll`/`mfaSetupConfirm`'s\n * TOTP path is reached: `login()` answered `mfa_setup_required` because the\n * tenant requires MFA and this account has none.\n *\n * Runs the full ceremony: `setup/register/start`, the authenticator, then\n * `setup/register/finish` — which, unlike `webauthnRegisterFinish`,\n * adopts credentials and completes the interrupted login (§25.2 rule 2,\n * mirrored). The pair stays individually callable on `AxiamClient` for the\n * same reason {@link webauthnRegister} is additive rather than the only way\n * in (§24.6 rule 1).\n *\n * @param setupToken the token from `login()`'s `mfa_setup_required` outcome.\n * @param kind optional `authenticatorAttachment` hint. Omitted entirely when\n * not passed — the SDK never infers it and never defaults it.\n */\nexport async function webauthnSetupRegister(\n client: AxiamClient,\n setupToken: Sensitive<string> | string,\n credentialName: string,\n kind?: AuthenticatorKind,\n options?: WebauthnCeremonyOptions,\n): Promise<LoginResult> {\n requireSupport('webauthnSetupRegister');\n\n const { challenge, stateToken } = await client.webauthnSetupRegisterStart(setupToken);\n const credential = await createCredential(challenge, kind, options?.signal);\n return client.webauthnSetupRegisterFinish(setupToken, stateToken, credentialName, credential);\n}\n\n/**\n * Sign in with a passkey as a **second factor** (§24.6).\n *\n * `challengeToken` is the `mfaToken` from a `login()` that answered\n * `mfa_required` with `\"webauthn\"` among its methods.\n */\nexport async function webauthnLogin(\n client: AxiamClient,\n challengeToken: string,\n options?: WebauthnCeremonyOptions,\n): Promise<WebauthnLoginResult> {\n requireSupport('webauthnLogin');\n\n const { challenge, stateToken } = await client.webauthnAuthenticateStart(challengeToken);\n const assertion = await getAssertion(challenge, options);\n return client.webauthnAuthenticateFinish(stateToken, assertion);\n}\n\n/**\n * Sign in with a passkey **without typing a username first** (§24.6).\n *\n * The workspace still has to be named — a discoverable credential is resolved\n * inside one tenant — but it comes from the client's own configuration unless\n * overridden, and slugs are accepted.\n */\nexport async function webauthnDiscoverableLogin(\n client: AxiamClient,\n workspace?: WebauthnWorkspace,\n options?: WebauthnCeremonyOptions,\n): Promise<WebauthnLoginResult> {\n requireSupport('webauthnDiscoverableLogin');\n\n const { challenge, stateToken } = await client.webauthnDiscoverableStart(workspace);\n const assertion = await getAssertion(challenge, options);\n return client.webauthnDiscoverableFinish(stateToken, assertion);\n}\n\n// ---------------------------------------------------------------------------\n// Ceremony internals\n// ---------------------------------------------------------------------------\n\nfunction requireSupport(operation: string): void {\n if (!isWebauthnSupported()) {\n throw new Error(\n `${operation}: this runtime has no WebAuthn authenticator. Check isWebauthnSupported() first, ` +\n 'or use the relying-party operations on AxiamClient with a response produced elsewhere ' +\n '(CONTRACT.md §24.6).',\n );\n }\n}\n\n/** Run `navigator.credentials.create()` and return the JSON form of its answer. */\nasync function createCredential(\n challenge: WebauthnCreationChallenge,\n kind: AuthenticatorKind | undefined,\n signal: AbortSignal | undefined,\n): Promise<WebauthnRegistrationResponse> {\n const credential = (await navigator.credentials.create({\n publicKey: toCreationOptions(challenge.publicKey, kind),\n ...(signal ? { signal } : {}),\n })) as PublicKeyCredential | null;\n\n if (!credential) {\n // Spec-wise unreachable — a rejection is how failure is reported — but a\n // `null` here would otherwise become a confusing property access.\n throw new Error('webauthnRegister: the authenticator returned no credential.');\n }\n\n const response = credential.response as AuthenticatorAttestationResponse;\n const transports =\n typeof response.getTransports === 'function' ? response.getTransports() : undefined;\n\n return {\n id: credential.id,\n rawId: bytesToBase64Url(credential.rawId),\n response: {\n clientDataJSON: bytesToBase64Url(response.clientDataJSON),\n attestationObject: bytesToBase64Url(response.attestationObject),\n ...(transports && transports.length > 0 ? { transports } : {}),\n },\n type: credential.type,\n ...(credential.authenticatorAttachment\n ? { authenticatorAttachment: credential.authenticatorAttachment }\n : {}),\n clientExtensionResults: credential.getClientExtensionResults() as Record<string, unknown>,\n };\n}\n\n/** Run `navigator.credentials.get()` and return the JSON form of its answer. */\nasync function getAssertion(\n challenge: WebauthnRequestChallenge,\n options: WebauthnCeremonyOptions | undefined,\n): Promise<WebauthnAuthenticationResponse> {\n const credential = (await navigator.credentials.get({\n publicKey: toRequestOptions(challenge.publicKey),\n ...(options?.conditional ? { mediation: 'conditional' as CredentialMediationRequirement } : {}),\n ...(options?.signal ? { signal: options.signal } : {}),\n })) as PublicKeyCredential | null;\n\n if (!credential) {\n throw new Error('webauthnLogin: the authenticator returned no assertion.');\n }\n\n const response = credential.response as AuthenticatorAssertionResponse;\n return {\n id: credential.id,\n rawId: bytesToBase64Url(credential.rawId),\n response: {\n clientDataJSON: bytesToBase64Url(response.clientDataJSON),\n authenticatorData: bytesToBase64Url(response.authenticatorData),\n signature: bytesToBase64Url(response.signature),\n ...(response.userHandle ? { userHandle: bytesToBase64Url(response.userHandle) } : {}),\n },\n type: credential.type,\n ...(credential.authenticatorAttachment\n ? { authenticatorAttachment: credential.authenticatorAttachment }\n : {}),\n clientExtensionResults: credential.getClientExtensionResults() as Record<string, unknown>,\n };\n}\n\n/**\n * Transcribe the server's creation options into what the DOM API takes.\n *\n * Every optional field is forwarded **only if the server sent it** — §24.0\n * rule 1 forbids expanding an absent `authenticatorSelection` into an empty\n * object or supplying a `timeout` the server did not choose. The string enums\n * (`residentKey`, `userVerification`, `attestation`) are cast rather than\n * validated: §24.0 rule 2 says an SDK may fail to parse but must not refuse\n * options it parsed, and a client-side allow-list of acceptable values is a\n * second policy engine.\n */\nfunction toCreationOptions(\n json: WebauthnCreationOptionsJson,\n kind: AuthenticatorKind | undefined,\n): PublicKeyCredentialCreationOptions {\n const selection = json.authenticatorSelection;\n // The only place this module adds anything (§24.6 rule 4). When the caller\n // passed no kind and the server sent no selection, the key stays absent.\n const authenticatorSelection =\n selection || kind\n ? ({\n ...(selection?.residentKey ? { residentKey: selection.residentKey } : {}),\n ...(selection?.requireResidentKey !== undefined\n ? { requireResidentKey: selection.requireResidentKey }\n : {}),\n ...(selection?.userVerification\n ? { userVerification: selection.userVerification }\n : {}),\n ...(kind\n ? { authenticatorAttachment: kind }\n : selection?.authenticatorAttachment\n ? { authenticatorAttachment: selection.authenticatorAttachment }\n : {}),\n } as AuthenticatorSelectionCriteria)\n : undefined;\n\n return {\n challenge: base64UrlToBytes(json.challenge),\n rp: json.rp,\n user: {\n id: base64UrlToBytes(json.user.id),\n name: json.user.name,\n displayName: json.user.displayName,\n },\n pubKeyCredParams: json.pubKeyCredParams as PublicKeyCredentialParameters[],\n ...(json.timeout !== undefined ? { timeout: json.timeout } : {}),\n ...(json.excludeCredentials\n ? { excludeCredentials: json.excludeCredentials.map(toDescriptor) }\n : {}),\n ...(authenticatorSelection ? { authenticatorSelection } : {}),\n ...(json.attestation\n ? { attestation: json.attestation as AttestationConveyancePreference }\n : {}),\n ...(json.extensions\n ? { extensions: json.extensions as AuthenticationExtensionsClientInputs }\n : {}),\n };\n}\n\n/** The same transcription for an assertion challenge. */\nfunction toRequestOptions(json: WebauthnRequestOptionsJson): PublicKeyCredentialRequestOptions {\n return {\n challenge: base64UrlToBytes(json.challenge),\n ...(json.timeout !== undefined ? { timeout: json.timeout } : {}),\n ...(json.rpId ? { rpId: json.rpId } : {}),\n ...(json.allowCredentials\n ? { allowCredentials: json.allowCredentials.map(toDescriptor) }\n : {}),\n ...(json.userVerification\n ? { userVerification: json.userVerification as UserVerificationRequirement }\n : {}),\n ...(json.extensions\n ? { extensions: json.extensions as AuthenticationExtensionsClientInputs }\n : {}),\n };\n}\n\nfunction toDescriptor(d: WebauthnCredentialDescriptorJson): PublicKeyCredentialDescriptor {\n return {\n id: base64UrlToBytes(d.id),\n type: d.type as PublicKeyCredentialType,\n ...(d.transports ? { transports: d.transports as AuthenticatorTransport[] } : {}),\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as Sensitive } from './sensitive-BC_s7Rrd.cjs';
|
|
2
|
-
import { S as SharedSession, A as AxiamClientOptions } from './session-
|
|
2
|
+
import { S as SharedSession, A as AxiamClientOptions } from './session-oiuBA1ZA.cjs';
|
|
3
3
|
import { a as AccessDecision, L as LoginResult, A as AccessCheck } from './types-zXSpiQM-.cjs';
|
|
4
4
|
import { a as TelemetryDispatcher, O as Outcome } from './telemetry-DrGqL4kb.cjs';
|
|
5
5
|
|
|
@@ -3249,6 +3249,49 @@ interface ServiceAccountResponse {
|
|
|
3249
3249
|
/** `updated_at`. */
|
|
3250
3250
|
updated_at: string;
|
|
3251
3251
|
}
|
|
3252
|
+
/** One of a user's sessions, as an administrator sees it. */
|
|
3253
|
+
interface SessionResponse {
|
|
3254
|
+
/** RFC 8176 method references for that authentication. */
|
|
3255
|
+
amr: string[];
|
|
3256
|
+
/**
|
|
3257
|
+
* X7.2 — when the end user actually authenticated, which is not `created_at`
|
|
3258
|
+
* on a session produced by refresh rotation.
|
|
3259
|
+
*/
|
|
3260
|
+
authenticated_at: string;
|
|
3261
|
+
/** `created_at`. */
|
|
3262
|
+
created_at: string;
|
|
3263
|
+
/** `expires_at`. */
|
|
3264
|
+
expires_at: string;
|
|
3265
|
+
/** `id`. */
|
|
3266
|
+
id: string;
|
|
3267
|
+
/** `ip_address`. */
|
|
3268
|
+
ip_address?: string | null;
|
|
3269
|
+
/**
|
|
3270
|
+
* T-254 — when a refresh token of this session was last presented after it
|
|
3271
|
+
* had already been rotated. `None` if that has never happened.
|
|
3272
|
+
*/
|
|
3273
|
+
refresh_replay_at?: string | null;
|
|
3274
|
+
/**
|
|
3275
|
+
* T-254 — replays accepted under the FAPI 2.0 §5.3.2.1-9 grace window. Only
|
|
3276
|
+
* ever non-zero for a client registered `profile: fapi2`.
|
|
3277
|
+
*/
|
|
3278
|
+
refresh_replay_grace_accepted: number;
|
|
3279
|
+
/**
|
|
3280
|
+
* T-254 — replays refused because there was no window to accept them in.
|
|
3281
|
+
* Nothing a conformant client does.
|
|
3282
|
+
*/
|
|
3283
|
+
refresh_replay_refused: number;
|
|
3284
|
+
/**
|
|
3285
|
+
* T-254 — the badge: `none`, `fapi_grace_retry` or `refused`.
|
|
3286
|
+
*
|
|
3287
|
+
* Derived from the two counters below rather than stored, so it cannot
|
|
3288
|
+
* disagree with them. A refusal outranks an accepted grace retry however the
|
|
3289
|
+
* counts compare.
|
|
3290
|
+
*/
|
|
3291
|
+
refresh_replay_verdict: string;
|
|
3292
|
+
/** `user_agent`. */
|
|
3293
|
+
user_agent?: string | null;
|
|
3294
|
+
}
|
|
3252
3295
|
/** Body for `PUT .../ca-certificates/{id}/mtls-trust-anchor`. */
|
|
3253
3296
|
interface SetMtlsTrustAnchor {
|
|
3254
3297
|
/** Whether this CA should be trusted for client-certificate authentication. */
|
|
@@ -3341,6 +3384,29 @@ interface SignAuditBatchRequest {
|
|
|
3341
3384
|
/** `entry_ids`. */
|
|
3342
3385
|
entry_ids: string[];
|
|
3343
3386
|
}
|
|
3387
|
+
/**
|
|
3388
|
+
* Body of `POST /api/v1/certificates/sign-csr`.
|
|
3389
|
+
*
|
|
3390
|
+
* No `subject` and no `key_algorithm`: both are read out of the CSR, which
|
|
3391
|
+
* is the only place they can be stated without the row and the certificate
|
|
3392
|
+
* being able to disagree. No key is returned, so there is no key field
|
|
3393
|
+
* anywhere on this exchange.
|
|
3394
|
+
*/
|
|
3395
|
+
interface SignCertificateCsrRequest {
|
|
3396
|
+
/** `cert_type`. */
|
|
3397
|
+
cert_type: CertificateType;
|
|
3398
|
+
/**
|
|
3399
|
+
* PEM-encoded PKCS#10 request — a `BEGIN CERTIFICATE REQUEST` block. The
|
|
3400
|
+
* legacy OpenSSL `BEGIN NEW CERTIFICATE REQUEST` header is not accepted.
|
|
3401
|
+
*/
|
|
3402
|
+
csr_pem: string;
|
|
3403
|
+
/** `issuer_ca_id`. */
|
|
3404
|
+
issuer_ca_id: string;
|
|
3405
|
+
/** `metadata`. */
|
|
3406
|
+
metadata?: unknown;
|
|
3407
|
+
/** Validity duration in days. */
|
|
3408
|
+
validity_days: number;
|
|
3409
|
+
}
|
|
3344
3410
|
/**
|
|
3345
3411
|
* Body of `POST .../tenants/{tenant_id}/signing-cas/sign-csr`.
|
|
3346
3412
|
*
|
|
@@ -4685,6 +4751,8 @@ declare class UsersApi {
|
|
|
4685
4751
|
unlock(userId: string): Promise<UserResponse>;
|
|
4686
4752
|
/** `GET /api/v1/users/{user_id}/roles` */
|
|
4687
4753
|
listRoles(userId: string): Promise<RoleAssignment[]>;
|
|
4754
|
+
/** `GET /api/v1/users/{user_id}/sessions` */
|
|
4755
|
+
listSessions(userId: string): Promise<SessionResponse[]>;
|
|
4688
4756
|
}
|
|
4689
4757
|
|
|
4690
4758
|
/**
|
|
@@ -5190,6 +5258,13 @@ declare class CertificatesApi {
|
|
|
5190
5258
|
* issued exactly once, including the ones that look idempotent.
|
|
5191
5259
|
*/
|
|
5192
5260
|
generate(body: CreateCertificateRequest): Promise<GeneratedCertificate>;
|
|
5261
|
+
/**
|
|
5262
|
+
* `POST /api/v1/certificates/sign-csr`
|
|
5263
|
+
*
|
|
5264
|
+
* Not retried on failure (§27.4 rule 8): every write on this surface is
|
|
5265
|
+
* issued exactly once, including the ones that look idempotent.
|
|
5266
|
+
*/
|
|
5267
|
+
signCsr(body: SignCertificateCsrRequest): Promise<Certificate>;
|
|
5193
5268
|
/** `GET /api/v1/certificates/{id}` */
|
|
5194
5269
|
get(id: string): Promise<Certificate>;
|
|
5195
5270
|
/**
|
|
@@ -6360,6 +6435,19 @@ declare class AxiamClient {
|
|
|
6360
6435
|
webauthnDiscoverableStart(workspace?: WebauthnWorkspace): Promise<WebauthnAuthenticationChallenge>;
|
|
6361
6436
|
/** `POST .../authenticate/discoverable/finish` (§24.1). Leaves the client authenticated (§24.3). */
|
|
6362
6437
|
webauthnDiscoverableFinish(stateToken: Sensitive<string> | string, response: WebauthnAuthenticationResponse | string): Promise<WebauthnLoginResult>;
|
|
6438
|
+
/**
|
|
6439
|
+
* `POST /api/v1/auth/webauthn/setup/register/start` (§24.1, contract 1.45)
|
|
6440
|
+
* — the WebAuthn twin of `mfaSetupEnroll`. Takes no session; the setup
|
|
6441
|
+
* token from `login()`'s `mfa_setup_required` outcome is the only credential.
|
|
6442
|
+
*/
|
|
6443
|
+
webauthnSetupRegisterStart(setupToken: Sensitive<string> | string): Promise<WebauthnRegistrationChallenge>;
|
|
6444
|
+
/**
|
|
6445
|
+
* `POST /api/v1/auth/webauthn/setup/register/finish` (§24.1, contract 1.45)
|
|
6446
|
+
* — the WebAuthn twin of `mfaSetupConfirm`. Adopts credentials exactly as
|
|
6447
|
+
* `mfaSetupConfirm` does (§25.2 rule 2): it completes the login `login()`
|
|
6448
|
+
* left interrupted.
|
|
6449
|
+
*/
|
|
6450
|
+
webauthnSetupRegisterFinish(setupToken: Sensitive<string> | string, stateToken: Sensitive<string> | string, credentialName: string, response: WebauthnRegistrationResponse | string): Promise<LoginResult>;
|
|
6363
6451
|
/** `POST /api/v1/auth/mfa/enroll` (§25.1) — voluntary TOTP enrolment, by a signed-in user. */
|
|
6364
6452
|
mfaEnroll(): Promise<MfaEnrollment>;
|
|
6365
6453
|
/** `POST /api/v1/auth/mfa/confirm` (§25.1) — activate the factor `mfaEnroll` offered. */
|
|
@@ -6389,4 +6477,4 @@ declare class AxiamClient {
|
|
|
6389
6477
|
confirmPasswordReset(confirmation: PasswordResetConfirmation): Promise<void>;
|
|
6390
6478
|
}
|
|
6391
6479
|
|
|
6392
|
-
export { type CreateReactorRequest as $, AxiamClient as A, BASE_DELAY_MS as B, type CaCertificate as C, CertificatesApi as D, type CertificationLevel as E, type Change as F, type GrantSpec as G, type ClientAuthMethod as H, type ClientProfile as I, type ComplianceReportEntry as J, type ConsentView as K, type CreateCaCertificateRequest as L, type ManagementManifest as M, type CreateCertificateRequest as N, type CreateFederationConfigRequest as O, type PermissionSpec as P, type CreateFederationConfigRequestWire as Q, type ResourceSpec as R, type ScopeSpec as S, type CreateGroupRequest as T, type UserSpec as U, type CreateIntermediateCaRequest as V, type WebauthnWorkspace as W, type CreateNotificationRuleRequest as X, type CreateOAuth2ClientRequest as Y, type CreatePermissionRequest as Z, type CreatePgpKeyRequest as _, type WebauthnLoginResult as a, type OAuth2ClientResponse as a$, type CreateResourceRequest as a0, type CreateRoleRequest as a1, type CreateScimTokenRequest as a2, type CreateScimTokenResponse as a3, type CreateScimTokenResponseWire as a4, type CreateScopeRequest as a5, type CreateServiceAccountRequest as a6, type CreateTenantRequest as a7, type CreateUserRequest as a8, type CreateUserRequestWire as a9, type HealthResponse as aA, type ImportCaCertificateRequest as aB, type ImportCaCertificateRequestWire as aC, type KeyAlgorithm as aD, type LockoutPolicy as aE, MAX_ATTEMPTS as aF, MAX_DELAY_MS as aG, MAX_TTL_MS as aH, type ManagementNamespaces as aI, type ManagementPlan as aJ, ManifestApi as aK, type ManifestFailure as aL, type MdsRefreshOutcome as aM, type MdsStatusResponse as aN, type MfaEnrollment as aO, type MfaMethodResponse as aP, type MfaMethodType as aQ, type MfaPolicy as aR, type MigrateCustodyResponse as aS, type MtlsTrustAnchorResponse as aT, type NamespaceScope as aU, type NotificationEventType as aV, type NotificationPolicy as aW, type NotificationRuleResponse as aX, NotificationRulesApi as aY, type OAuth2ClientCreatedResponse as aZ, type OAuth2ClientCreatedResponseWire as a_, type CreateWebhookRequest as aa, type CreateWebhookRequestWire as ab, DecisionMemo as ac, type EmailConfig as ad, EmailConfigApi as ae, type EmailConfigOverride as af, type EmailTestResult as ag, type EmailVerificationPolicy as ah, type EncryptRequest as ai, type EncryptedExport as aj, type FailurePolicy as ak, FederationApi as al, type FederationConfigResponse as am, type FederationLinkResponse as an, type FinishRequest as ao, type GeneratedCaCertificate as ap, type GeneratedCaCertificateWire as aq, type GeneratedCertificate as ar, type GeneratedCertificateWire as as, type GeneratedPgpKey as at, type GeneratedPgpKeyWire as au, type GrantPermissionRequest as av, type GrantScopeConsent as aw, type GrantedScope as ax, type Group as ay, GroupsApi as az, type WebauthnCredential as b,
|
|
6480
|
+
export { type CreateReactorRequest as $, AxiamClient as A, BASE_DELAY_MS as B, type CaCertificate as C, CertificatesApi as D, type CertificationLevel as E, type Change as F, type GrantSpec as G, type ClientAuthMethod as H, type ClientProfile as I, type ComplianceReportEntry as J, type ConsentView as K, type CreateCaCertificateRequest as L, type ManagementManifest as M, type CreateCertificateRequest as N, type CreateFederationConfigRequest as O, type PermissionSpec as P, type CreateFederationConfigRequestWire as Q, type ResourceSpec as R, type ScopeSpec as S, type CreateGroupRequest as T, type UserSpec as U, type CreateIntermediateCaRequest as V, type WebauthnWorkspace as W, type CreateNotificationRuleRequest as X, type CreateOAuth2ClientRequest as Y, type CreatePermissionRequest as Z, type CreatePgpKeyRequest as _, type WebauthnLoginResult as a, type OAuth2ClientResponse as a$, type CreateResourceRequest as a0, type CreateRoleRequest as a1, type CreateScimTokenRequest as a2, type CreateScimTokenResponse as a3, type CreateScimTokenResponseWire as a4, type CreateScopeRequest as a5, type CreateServiceAccountRequest as a6, type CreateTenantRequest as a7, type CreateUserRequest as a8, type CreateUserRequestWire as a9, type HealthResponse as aA, type ImportCaCertificateRequest as aB, type ImportCaCertificateRequestWire as aC, type KeyAlgorithm as aD, type LockoutPolicy as aE, MAX_ATTEMPTS as aF, MAX_DELAY_MS as aG, MAX_TTL_MS as aH, type ManagementNamespaces as aI, type ManagementPlan as aJ, ManifestApi as aK, type ManifestFailure as aL, type MdsRefreshOutcome as aM, type MdsStatusResponse as aN, type MfaEnrollment as aO, type MfaMethodResponse as aP, type MfaMethodType as aQ, type MfaPolicy as aR, type MigrateCustodyResponse as aS, type MtlsTrustAnchorResponse as aT, type NamespaceScope as aU, type NotificationEventType as aV, type NotificationPolicy as aW, type NotificationRuleResponse as aX, NotificationRulesApi as aY, type OAuth2ClientCreatedResponse as aZ, type OAuth2ClientCreatedResponseWire as a_, type CreateWebhookRequest as aa, type CreateWebhookRequestWire as ab, DecisionMemo as ac, type EmailConfig as ad, EmailConfigApi as ae, type EmailConfigOverride as af, type EmailTestResult as ag, type EmailVerificationPolicy as ah, type EncryptRequest as ai, type EncryptedExport as aj, type FailurePolicy as ak, FederationApi as al, type FederationConfigResponse as am, type FederationLinkResponse as an, type FinishRequest as ao, type GeneratedCaCertificate as ap, type GeneratedCaCertificateWire as aq, type GeneratedCertificate as ar, type GeneratedCertificateWire as as, type GeneratedPgpKey as at, type GeneratedPgpKeyWire as au, type GrantPermissionRequest as av, type GrantScopeConsent as aw, type GrantedScope as ax, type Group as ay, GroupsApi as az, type WebauthnCredential as b, SettingsApi as b$, Oauth2ClientsApi as b0, type OidcAuthorizeRequest as b1, type OidcAuthorizeResponse as b2, type OidcCallbackRequest as b3, type OidcCallbackResponse as b4, type OidcPolicy as b5, type OpaqueEnrollment as b6, type OpaqueEnrollmentPayload as b7, type OpaquePolicy as b8, type Organization as b9, type ResolvedPermissionGrant as bA, type Resource as bB, ResourcesApi as bC, type RetryOptions as bD, type RetryPolicy as bE, type Role as bF, type RoleAssignment as bG, type RoleGroupAssignment as bH, type RoleServiceAccountAssignment as bI, type RoleUserAssignment as bJ, RolesApi as bK, type RotateSecretResponse as bL, type RotateSecretResponseWire as bM, type ScimTokenResponse as bN, type ScimTokenStatus as bO, ScimTokensApi as bP, type Scope as bQ, ScopesApi as bR, type SecuritySettings as bS, type ServiceAccountCreatedResponse as bT, type ServiceAccountCreatedResponseWire as bU, type ServiceAccountResponse as bV, ServiceAccountsApi as bW, type SessionResponse as bX, type SetMtlsTrustAnchor as bY, type SetOrgEmailConfig as bZ, type SetOrgSettings as b_, OrganizationsApi as ba, type Page as bb, type PageRequest as bc, type PasswordPolicy as bd, type PasswordResetConfirmation as be, type PasswordResetContext as bf, type PasswordResetRequest as bg, type Permission as bh, type PermissionEffect as bi, PermissionsApi as bj, type PgpKey as bk, type PgpKeyAlgorithm as bl, type PgpKeyPurpose as bm, type PgpKeyStatus as bn, PgpKeysApi as bo, type PlannedAction as bp, PlatformApi as bq, type PolicyResponse as br, PrivacyApi as bs, type PrivacyPolicy as bt, type ProviderConfig as bu, type ReactorEventDescriptor as bv, type ReactorMode as bw, type ReactorResponse as bx, ReactorsApi as by, type ReadyResponse as bz, type GroupSpec as c, generatedPgpKeyFromWire as c$, type SettingsScope as c0, type SignAuditBatchRequest as c1, type SignCertificateCsrRequest as c2, type SignIntermediateCsrRequest as c3, type SignedAuditBatch as c4, type SmtpConfig as c5, type StepOutcome as c6, type Target as c7, TelemetryReporter as c8, type Tenant as c9, UsersApi as cA, type WebauthnAttestationPolicy as cB, type WebauthnAuthenticationChallenge as cC, type WebauthnAuthenticationResponse as cD, type WebauthnCreationChallenge as cE, type WebauthnCreationOptionsJson as cF, type WebauthnCredentialDescriptorJson as cG, type WebauthnPolicy as cH, WebauthnPolicyApi as cI, type WebauthnRegistrationChallenge as cJ, type WebauthnRegistrationResponse as cK, type WebauthnRequestChallenge as cL, type WebauthnRequestOptionsJson as cM, type WebhookResponse as cN, WebhooksApi as cO, backoffMs as cP, changedCount as cQ, changes as cR, collectPages as cS, createFederationConfigRequestToWire as cT, createScimTokenResponseFromWire as cU, createUserRequestToWire as cV, createWebhookRequestToWire as cW, delayMs as cX, failure as cY, generatedCaCertificateFromWire as cZ, generatedCertificateFromWire as c_, type TenantKind as ca, type TenantSettingsOverride as cb, type TenantStatus as cc, TenantsApi as cd, type TokenExchangeTrustRequest as ce, type TokenExchangeTrustResponse as cf, type TokenPolicy as cg, type UnknownAaguidAction as ch, type UpdateFederationConfigRequest as ci, type UpdateFederationConfigRequestWire as cj, type UpdateGroup as ck, type UpdateNotificationRuleRequest as cl, type UpdateOAuth2ClientRequest as cm, type UpdateOrganizationRequest as cn, type UpdatePermissionRequest as co, type UpdateReactorRequest as cp, type UpdateResourceRequest as cq, type UpdateRole as cr, type UpdateScopeRequest as cs, type UpdateServiceAccount as ct, type UpdateTenant as cu, type UpdateUserRequest as cv, type UpdateWebhookRequest as cw, type UpdateWebhookRequestWire as cx, type UserResponse as cy, type UserStatus as cz, type RoleSpec as d, hasMore as d0, importCaCertificateRequestToWire as d1, isComplete as d2, isConverged as d3, managementNamespaces as d4, memoKey as d5, normalizeSearch as d6, oAuth2ClientCreatedResponseFromWire as d7, omitEmptyTenantScope as d8, opaqueEnrollment as d9, opaqueEnrollmentForSelf as da, pageQuery as db, rotateSecretResponseFromWire as dc, serviceAccountCreatedResponseFromWire as dd, topologicalOrder as de, updateFederationConfigRequestToWire as df, updateWebhookRequestToWire as dg, validate as dh, webauthnRequestJson as di, withRetry as dj, type ActorType as e, type AddMemberRequest as f, type AddServiceAccountMemberRequest as g, type ApiProviderConfig as h, type AppliedStep as i, type ApplyReport as j, type AssignRoleToGroupRequest as k, type AssignRoleToServiceAccountRequest as l, type AssignRoleToUserRequest as m, type AttestationMode as n, AuditApi as o, type AuditListFilter as p, type AuditListSystemFilter as q, type AuditLogEntry as r, type AuditOutcome as s, type AuthnRequestParamsMode as t, type BindCertificate as u, CaCertificatesApi as v, type Certificate as w, type CertificatePolicy as x, type CertificateStatus as y, type CertificateType as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as Sensitive } from './sensitive-BC_s7Rrd.js';
|
|
2
|
-
import { S as SharedSession, A as AxiamClientOptions } from './session-
|
|
2
|
+
import { S as SharedSession, A as AxiamClientOptions } from './session-ymrHvMuJ.js';
|
|
3
3
|
import { a as AccessDecision, L as LoginResult, A as AccessCheck } from './types-BOX-6Srv.js';
|
|
4
4
|
import { a as TelemetryDispatcher, O as Outcome } from './telemetry-DrGqL4kb.js';
|
|
5
5
|
|
|
@@ -3249,6 +3249,49 @@ interface ServiceAccountResponse {
|
|
|
3249
3249
|
/** `updated_at`. */
|
|
3250
3250
|
updated_at: string;
|
|
3251
3251
|
}
|
|
3252
|
+
/** One of a user's sessions, as an administrator sees it. */
|
|
3253
|
+
interface SessionResponse {
|
|
3254
|
+
/** RFC 8176 method references for that authentication. */
|
|
3255
|
+
amr: string[];
|
|
3256
|
+
/**
|
|
3257
|
+
* X7.2 — when the end user actually authenticated, which is not `created_at`
|
|
3258
|
+
* on a session produced by refresh rotation.
|
|
3259
|
+
*/
|
|
3260
|
+
authenticated_at: string;
|
|
3261
|
+
/** `created_at`. */
|
|
3262
|
+
created_at: string;
|
|
3263
|
+
/** `expires_at`. */
|
|
3264
|
+
expires_at: string;
|
|
3265
|
+
/** `id`. */
|
|
3266
|
+
id: string;
|
|
3267
|
+
/** `ip_address`. */
|
|
3268
|
+
ip_address?: string | null;
|
|
3269
|
+
/**
|
|
3270
|
+
* T-254 — when a refresh token of this session was last presented after it
|
|
3271
|
+
* had already been rotated. `None` if that has never happened.
|
|
3272
|
+
*/
|
|
3273
|
+
refresh_replay_at?: string | null;
|
|
3274
|
+
/**
|
|
3275
|
+
* T-254 — replays accepted under the FAPI 2.0 §5.3.2.1-9 grace window. Only
|
|
3276
|
+
* ever non-zero for a client registered `profile: fapi2`.
|
|
3277
|
+
*/
|
|
3278
|
+
refresh_replay_grace_accepted: number;
|
|
3279
|
+
/**
|
|
3280
|
+
* T-254 — replays refused because there was no window to accept them in.
|
|
3281
|
+
* Nothing a conformant client does.
|
|
3282
|
+
*/
|
|
3283
|
+
refresh_replay_refused: number;
|
|
3284
|
+
/**
|
|
3285
|
+
* T-254 — the badge: `none`, `fapi_grace_retry` or `refused`.
|
|
3286
|
+
*
|
|
3287
|
+
* Derived from the two counters below rather than stored, so it cannot
|
|
3288
|
+
* disagree with them. A refusal outranks an accepted grace retry however the
|
|
3289
|
+
* counts compare.
|
|
3290
|
+
*/
|
|
3291
|
+
refresh_replay_verdict: string;
|
|
3292
|
+
/** `user_agent`. */
|
|
3293
|
+
user_agent?: string | null;
|
|
3294
|
+
}
|
|
3252
3295
|
/** Body for `PUT .../ca-certificates/{id}/mtls-trust-anchor`. */
|
|
3253
3296
|
interface SetMtlsTrustAnchor {
|
|
3254
3297
|
/** Whether this CA should be trusted for client-certificate authentication. */
|
|
@@ -3341,6 +3384,29 @@ interface SignAuditBatchRequest {
|
|
|
3341
3384
|
/** `entry_ids`. */
|
|
3342
3385
|
entry_ids: string[];
|
|
3343
3386
|
}
|
|
3387
|
+
/**
|
|
3388
|
+
* Body of `POST /api/v1/certificates/sign-csr`.
|
|
3389
|
+
*
|
|
3390
|
+
* No `subject` and no `key_algorithm`: both are read out of the CSR, which
|
|
3391
|
+
* is the only place they can be stated without the row and the certificate
|
|
3392
|
+
* being able to disagree. No key is returned, so there is no key field
|
|
3393
|
+
* anywhere on this exchange.
|
|
3394
|
+
*/
|
|
3395
|
+
interface SignCertificateCsrRequest {
|
|
3396
|
+
/** `cert_type`. */
|
|
3397
|
+
cert_type: CertificateType;
|
|
3398
|
+
/**
|
|
3399
|
+
* PEM-encoded PKCS#10 request — a `BEGIN CERTIFICATE REQUEST` block. The
|
|
3400
|
+
* legacy OpenSSL `BEGIN NEW CERTIFICATE REQUEST` header is not accepted.
|
|
3401
|
+
*/
|
|
3402
|
+
csr_pem: string;
|
|
3403
|
+
/** `issuer_ca_id`. */
|
|
3404
|
+
issuer_ca_id: string;
|
|
3405
|
+
/** `metadata`. */
|
|
3406
|
+
metadata?: unknown;
|
|
3407
|
+
/** Validity duration in days. */
|
|
3408
|
+
validity_days: number;
|
|
3409
|
+
}
|
|
3344
3410
|
/**
|
|
3345
3411
|
* Body of `POST .../tenants/{tenant_id}/signing-cas/sign-csr`.
|
|
3346
3412
|
*
|
|
@@ -4685,6 +4751,8 @@ declare class UsersApi {
|
|
|
4685
4751
|
unlock(userId: string): Promise<UserResponse>;
|
|
4686
4752
|
/** `GET /api/v1/users/{user_id}/roles` */
|
|
4687
4753
|
listRoles(userId: string): Promise<RoleAssignment[]>;
|
|
4754
|
+
/** `GET /api/v1/users/{user_id}/sessions` */
|
|
4755
|
+
listSessions(userId: string): Promise<SessionResponse[]>;
|
|
4688
4756
|
}
|
|
4689
4757
|
|
|
4690
4758
|
/**
|
|
@@ -5190,6 +5258,13 @@ declare class CertificatesApi {
|
|
|
5190
5258
|
* issued exactly once, including the ones that look idempotent.
|
|
5191
5259
|
*/
|
|
5192
5260
|
generate(body: CreateCertificateRequest): Promise<GeneratedCertificate>;
|
|
5261
|
+
/**
|
|
5262
|
+
* `POST /api/v1/certificates/sign-csr`
|
|
5263
|
+
*
|
|
5264
|
+
* Not retried on failure (§27.4 rule 8): every write on this surface is
|
|
5265
|
+
* issued exactly once, including the ones that look idempotent.
|
|
5266
|
+
*/
|
|
5267
|
+
signCsr(body: SignCertificateCsrRequest): Promise<Certificate>;
|
|
5193
5268
|
/** `GET /api/v1/certificates/{id}` */
|
|
5194
5269
|
get(id: string): Promise<Certificate>;
|
|
5195
5270
|
/**
|
|
@@ -6360,6 +6435,19 @@ declare class AxiamClient {
|
|
|
6360
6435
|
webauthnDiscoverableStart(workspace?: WebauthnWorkspace): Promise<WebauthnAuthenticationChallenge>;
|
|
6361
6436
|
/** `POST .../authenticate/discoverable/finish` (§24.1). Leaves the client authenticated (§24.3). */
|
|
6362
6437
|
webauthnDiscoverableFinish(stateToken: Sensitive<string> | string, response: WebauthnAuthenticationResponse | string): Promise<WebauthnLoginResult>;
|
|
6438
|
+
/**
|
|
6439
|
+
* `POST /api/v1/auth/webauthn/setup/register/start` (§24.1, contract 1.45)
|
|
6440
|
+
* — the WebAuthn twin of `mfaSetupEnroll`. Takes no session; the setup
|
|
6441
|
+
* token from `login()`'s `mfa_setup_required` outcome is the only credential.
|
|
6442
|
+
*/
|
|
6443
|
+
webauthnSetupRegisterStart(setupToken: Sensitive<string> | string): Promise<WebauthnRegistrationChallenge>;
|
|
6444
|
+
/**
|
|
6445
|
+
* `POST /api/v1/auth/webauthn/setup/register/finish` (§24.1, contract 1.45)
|
|
6446
|
+
* — the WebAuthn twin of `mfaSetupConfirm`. Adopts credentials exactly as
|
|
6447
|
+
* `mfaSetupConfirm` does (§25.2 rule 2): it completes the login `login()`
|
|
6448
|
+
* left interrupted.
|
|
6449
|
+
*/
|
|
6450
|
+
webauthnSetupRegisterFinish(setupToken: Sensitive<string> | string, stateToken: Sensitive<string> | string, credentialName: string, response: WebauthnRegistrationResponse | string): Promise<LoginResult>;
|
|
6363
6451
|
/** `POST /api/v1/auth/mfa/enroll` (§25.1) — voluntary TOTP enrolment, by a signed-in user. */
|
|
6364
6452
|
mfaEnroll(): Promise<MfaEnrollment>;
|
|
6365
6453
|
/** `POST /api/v1/auth/mfa/confirm` (§25.1) — activate the factor `mfaEnroll` offered. */
|
|
@@ -6389,4 +6477,4 @@ declare class AxiamClient {
|
|
|
6389
6477
|
confirmPasswordReset(confirmation: PasswordResetConfirmation): Promise<void>;
|
|
6390
6478
|
}
|
|
6391
6479
|
|
|
6392
|
-
export { type CreateReactorRequest as $, AxiamClient as A, BASE_DELAY_MS as B, type CaCertificate as C, CertificatesApi as D, type CertificationLevel as E, type Change as F, type GrantSpec as G, type ClientAuthMethod as H, type ClientProfile as I, type ComplianceReportEntry as J, type ConsentView as K, type CreateCaCertificateRequest as L, type ManagementManifest as M, type CreateCertificateRequest as N, type CreateFederationConfigRequest as O, type PermissionSpec as P, type CreateFederationConfigRequestWire as Q, type ResourceSpec as R, type ScopeSpec as S, type CreateGroupRequest as T, type UserSpec as U, type CreateIntermediateCaRequest as V, type WebauthnWorkspace as W, type CreateNotificationRuleRequest as X, type CreateOAuth2ClientRequest as Y, type CreatePermissionRequest as Z, type CreatePgpKeyRequest as _, type WebauthnLoginResult as a, type OAuth2ClientResponse as a$, type CreateResourceRequest as a0, type CreateRoleRequest as a1, type CreateScimTokenRequest as a2, type CreateScimTokenResponse as a3, type CreateScimTokenResponseWire as a4, type CreateScopeRequest as a5, type CreateServiceAccountRequest as a6, type CreateTenantRequest as a7, type CreateUserRequest as a8, type CreateUserRequestWire as a9, type HealthResponse as aA, type ImportCaCertificateRequest as aB, type ImportCaCertificateRequestWire as aC, type KeyAlgorithm as aD, type LockoutPolicy as aE, MAX_ATTEMPTS as aF, MAX_DELAY_MS as aG, MAX_TTL_MS as aH, type ManagementNamespaces as aI, type ManagementPlan as aJ, ManifestApi as aK, type ManifestFailure as aL, type MdsRefreshOutcome as aM, type MdsStatusResponse as aN, type MfaEnrollment as aO, type MfaMethodResponse as aP, type MfaMethodType as aQ, type MfaPolicy as aR, type MigrateCustodyResponse as aS, type MtlsTrustAnchorResponse as aT, type NamespaceScope as aU, type NotificationEventType as aV, type NotificationPolicy as aW, type NotificationRuleResponse as aX, NotificationRulesApi as aY, type OAuth2ClientCreatedResponse as aZ, type OAuth2ClientCreatedResponseWire as a_, type CreateWebhookRequest as aa, type CreateWebhookRequestWire as ab, DecisionMemo as ac, type EmailConfig as ad, EmailConfigApi as ae, type EmailConfigOverride as af, type EmailTestResult as ag, type EmailVerificationPolicy as ah, type EncryptRequest as ai, type EncryptedExport as aj, type FailurePolicy as ak, FederationApi as al, type FederationConfigResponse as am, type FederationLinkResponse as an, type FinishRequest as ao, type GeneratedCaCertificate as ap, type GeneratedCaCertificateWire as aq, type GeneratedCertificate as ar, type GeneratedCertificateWire as as, type GeneratedPgpKey as at, type GeneratedPgpKeyWire as au, type GrantPermissionRequest as av, type GrantScopeConsent as aw, type GrantedScope as ax, type Group as ay, GroupsApi as az, type WebauthnCredential as b,
|
|
6480
|
+
export { type CreateReactorRequest as $, AxiamClient as A, BASE_DELAY_MS as B, type CaCertificate as C, CertificatesApi as D, type CertificationLevel as E, type Change as F, type GrantSpec as G, type ClientAuthMethod as H, type ClientProfile as I, type ComplianceReportEntry as J, type ConsentView as K, type CreateCaCertificateRequest as L, type ManagementManifest as M, type CreateCertificateRequest as N, type CreateFederationConfigRequest as O, type PermissionSpec as P, type CreateFederationConfigRequestWire as Q, type ResourceSpec as R, type ScopeSpec as S, type CreateGroupRequest as T, type UserSpec as U, type CreateIntermediateCaRequest as V, type WebauthnWorkspace as W, type CreateNotificationRuleRequest as X, type CreateOAuth2ClientRequest as Y, type CreatePermissionRequest as Z, type CreatePgpKeyRequest as _, type WebauthnLoginResult as a, type OAuth2ClientResponse as a$, type CreateResourceRequest as a0, type CreateRoleRequest as a1, type CreateScimTokenRequest as a2, type CreateScimTokenResponse as a3, type CreateScimTokenResponseWire as a4, type CreateScopeRequest as a5, type CreateServiceAccountRequest as a6, type CreateTenantRequest as a7, type CreateUserRequest as a8, type CreateUserRequestWire as a9, type HealthResponse as aA, type ImportCaCertificateRequest as aB, type ImportCaCertificateRequestWire as aC, type KeyAlgorithm as aD, type LockoutPolicy as aE, MAX_ATTEMPTS as aF, MAX_DELAY_MS as aG, MAX_TTL_MS as aH, type ManagementNamespaces as aI, type ManagementPlan as aJ, ManifestApi as aK, type ManifestFailure as aL, type MdsRefreshOutcome as aM, type MdsStatusResponse as aN, type MfaEnrollment as aO, type MfaMethodResponse as aP, type MfaMethodType as aQ, type MfaPolicy as aR, type MigrateCustodyResponse as aS, type MtlsTrustAnchorResponse as aT, type NamespaceScope as aU, type NotificationEventType as aV, type NotificationPolicy as aW, type NotificationRuleResponse as aX, NotificationRulesApi as aY, type OAuth2ClientCreatedResponse as aZ, type OAuth2ClientCreatedResponseWire as a_, type CreateWebhookRequest as aa, type CreateWebhookRequestWire as ab, DecisionMemo as ac, type EmailConfig as ad, EmailConfigApi as ae, type EmailConfigOverride as af, type EmailTestResult as ag, type EmailVerificationPolicy as ah, type EncryptRequest as ai, type EncryptedExport as aj, type FailurePolicy as ak, FederationApi as al, type FederationConfigResponse as am, type FederationLinkResponse as an, type FinishRequest as ao, type GeneratedCaCertificate as ap, type GeneratedCaCertificateWire as aq, type GeneratedCertificate as ar, type GeneratedCertificateWire as as, type GeneratedPgpKey as at, type GeneratedPgpKeyWire as au, type GrantPermissionRequest as av, type GrantScopeConsent as aw, type GrantedScope as ax, type Group as ay, GroupsApi as az, type WebauthnCredential as b, SettingsApi as b$, Oauth2ClientsApi as b0, type OidcAuthorizeRequest as b1, type OidcAuthorizeResponse as b2, type OidcCallbackRequest as b3, type OidcCallbackResponse as b4, type OidcPolicy as b5, type OpaqueEnrollment as b6, type OpaqueEnrollmentPayload as b7, type OpaquePolicy as b8, type Organization as b9, type ResolvedPermissionGrant as bA, type Resource as bB, ResourcesApi as bC, type RetryOptions as bD, type RetryPolicy as bE, type Role as bF, type RoleAssignment as bG, type RoleGroupAssignment as bH, type RoleServiceAccountAssignment as bI, type RoleUserAssignment as bJ, RolesApi as bK, type RotateSecretResponse as bL, type RotateSecretResponseWire as bM, type ScimTokenResponse as bN, type ScimTokenStatus as bO, ScimTokensApi as bP, type Scope as bQ, ScopesApi as bR, type SecuritySettings as bS, type ServiceAccountCreatedResponse as bT, type ServiceAccountCreatedResponseWire as bU, type ServiceAccountResponse as bV, ServiceAccountsApi as bW, type SessionResponse as bX, type SetMtlsTrustAnchor as bY, type SetOrgEmailConfig as bZ, type SetOrgSettings as b_, OrganizationsApi as ba, type Page as bb, type PageRequest as bc, type PasswordPolicy as bd, type PasswordResetConfirmation as be, type PasswordResetContext as bf, type PasswordResetRequest as bg, type Permission as bh, type PermissionEffect as bi, PermissionsApi as bj, type PgpKey as bk, type PgpKeyAlgorithm as bl, type PgpKeyPurpose as bm, type PgpKeyStatus as bn, PgpKeysApi as bo, type PlannedAction as bp, PlatformApi as bq, type PolicyResponse as br, PrivacyApi as bs, type PrivacyPolicy as bt, type ProviderConfig as bu, type ReactorEventDescriptor as bv, type ReactorMode as bw, type ReactorResponse as bx, ReactorsApi as by, type ReadyResponse as bz, type GroupSpec as c, generatedPgpKeyFromWire as c$, type SettingsScope as c0, type SignAuditBatchRequest as c1, type SignCertificateCsrRequest as c2, type SignIntermediateCsrRequest as c3, type SignedAuditBatch as c4, type SmtpConfig as c5, type StepOutcome as c6, type Target as c7, TelemetryReporter as c8, type Tenant as c9, UsersApi as cA, type WebauthnAttestationPolicy as cB, type WebauthnAuthenticationChallenge as cC, type WebauthnAuthenticationResponse as cD, type WebauthnCreationChallenge as cE, type WebauthnCreationOptionsJson as cF, type WebauthnCredentialDescriptorJson as cG, type WebauthnPolicy as cH, WebauthnPolicyApi as cI, type WebauthnRegistrationChallenge as cJ, type WebauthnRegistrationResponse as cK, type WebauthnRequestChallenge as cL, type WebauthnRequestOptionsJson as cM, type WebhookResponse as cN, WebhooksApi as cO, backoffMs as cP, changedCount as cQ, changes as cR, collectPages as cS, createFederationConfigRequestToWire as cT, createScimTokenResponseFromWire as cU, createUserRequestToWire as cV, createWebhookRequestToWire as cW, delayMs as cX, failure as cY, generatedCaCertificateFromWire as cZ, generatedCertificateFromWire as c_, type TenantKind as ca, type TenantSettingsOverride as cb, type TenantStatus as cc, TenantsApi as cd, type TokenExchangeTrustRequest as ce, type TokenExchangeTrustResponse as cf, type TokenPolicy as cg, type UnknownAaguidAction as ch, type UpdateFederationConfigRequest as ci, type UpdateFederationConfigRequestWire as cj, type UpdateGroup as ck, type UpdateNotificationRuleRequest as cl, type UpdateOAuth2ClientRequest as cm, type UpdateOrganizationRequest as cn, type UpdatePermissionRequest as co, type UpdateReactorRequest as cp, type UpdateResourceRequest as cq, type UpdateRole as cr, type UpdateScopeRequest as cs, type UpdateServiceAccount as ct, type UpdateTenant as cu, type UpdateUserRequest as cv, type UpdateWebhookRequest as cw, type UpdateWebhookRequestWire as cx, type UserResponse as cy, type UserStatus as cz, type RoleSpec as d, hasMore as d0, importCaCertificateRequestToWire as d1, isComplete as d2, isConverged as d3, managementNamespaces as d4, memoKey as d5, normalizeSearch as d6, oAuth2ClientCreatedResponseFromWire as d7, omitEmptyTenantScope as d8, opaqueEnrollment as d9, opaqueEnrollmentForSelf as da, pageQuery as db, rotateSecretResponseFromWire as dc, serviceAccountCreatedResponseFromWire as dd, topologicalOrder as de, updateFederationConfigRequestToWire as df, updateWebhookRequestToWire as dg, validate as dh, webauthnRequestJson as di, withRetry as dj, type ActorType as e, type AddMemberRequest as f, type AddServiceAccountMemberRequest as g, type ApiProviderConfig as h, type AppliedStep as i, type ApplyReport as j, type AssignRoleToGroupRequest as k, type AssignRoleToServiceAccountRequest as l, type AssignRoleToUserRequest as m, type AttestationMode as n, AuditApi as o, type AuditListFilter as p, type AuditListSystemFilter as q, type AuditLogEntry as r, type AuditOutcome as s, type AuthnRequestParamsMode as t, type BindCertificate as u, CaCertificatesApi as v, type Certificate as w, type CertificatePolicy as x, type CertificateStatus as y, type CertificateType as z };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
1
2
|
import { CookieJar } from 'tough-cookie';
|
|
2
|
-
import { S as SharedSession, A as AxiamClientOptions, N as NodeTlsOptions } from './session-
|
|
3
|
-
import { A as AxiamClient } from './client-
|
|
3
|
+
import { S as SharedSession, A as AxiamClientOptions, N as NodeTlsOptions } from './session-ymrHvMuJ.js';
|
|
4
|
+
import { A as AxiamClient } from './client-DLapMy-5.js';
|
|
4
5
|
import { S as Sensitive } from './sensitive-BC_s7Rrd.js';
|
|
5
6
|
import { V as Verifier } from './jwks-CSXHo3DS.js';
|
|
6
|
-
import { AxiosInstance } from 'axios';
|
|
7
7
|
|
|
8
8
|
/** Tracks the access/refresh token pair for a Node session, kept in sync with the cookie jar after each REST call/refresh. */
|
|
9
9
|
declare class TokenManager {
|
|
@@ -58,7 +58,17 @@ declare class NodeSession extends SharedSession {
|
|
|
58
58
|
readonly tokenManager: TokenManager;
|
|
59
59
|
/** Local JWKS verifier for validating access tokens without a server round-trip. */
|
|
60
60
|
readonly jwksVerifier: Verifier;
|
|
61
|
-
constructor(options: AxiamClientOptions, base: SharedSession, tokenManager: TokenManager, jwksVerifier: Verifier, jar: CookieJar);
|
|
61
|
+
constructor(options: AxiamClientOptions, base: SharedSession, tokenManager: TokenManager, jwksVerifier: Verifier, jar: CookieJar, tlsOptions?: NodeTlsOptions);
|
|
62
|
+
/**
|
|
63
|
+
* Overrides {@link SharedSession.noCredentialsConfig}: `withCredentials` is
|
|
64
|
+
* a browser-XHR concept axios's Node http adapter ignores outright, so the
|
|
65
|
+
* only way to keep this jar's cookies off one particular request is to
|
|
66
|
+
* issue it through a different agent — one `wrapAxios` never touched.
|
|
67
|
+
*
|
|
68
|
+
* The pair is built once and reused (see {@link buildPlainNodeAgents}); a
|
|
69
|
+
* fresh `https.Agent` per call would open a fresh TLS socket per call.
|
|
70
|
+
*/
|
|
71
|
+
noCredentialsConfig(): AxiosRequestConfig;
|
|
62
72
|
/**
|
|
63
73
|
* Drives the actual `POST /api/v1/auth/refresh` HTTP call. Passed to this
|
|
64
74
|
* session's per-instance `refreshGuard` (inherited from SharedSession) by
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { AxiosRequestConfig, AxiosInstance } from 'axios';
|
|
1
2
|
import { CookieJar } from 'tough-cookie';
|
|
2
|
-
import { S as SharedSession, A as AxiamClientOptions, N as NodeTlsOptions } from './session-
|
|
3
|
-
import { A as AxiamClient } from './client-
|
|
3
|
+
import { S as SharedSession, A as AxiamClientOptions, N as NodeTlsOptions } from './session-oiuBA1ZA.cjs';
|
|
4
|
+
import { A as AxiamClient } from './client-CzVEJTC5.cjs';
|
|
4
5
|
import { S as Sensitive } from './sensitive-BC_s7Rrd.cjs';
|
|
5
6
|
import { V as Verifier } from './jwks-CSXHo3DS.cjs';
|
|
6
|
-
import { AxiosInstance } from 'axios';
|
|
7
7
|
|
|
8
8
|
/** Tracks the access/refresh token pair for a Node session, kept in sync with the cookie jar after each REST call/refresh. */
|
|
9
9
|
declare class TokenManager {
|
|
@@ -58,7 +58,17 @@ declare class NodeSession extends SharedSession {
|
|
|
58
58
|
readonly tokenManager: TokenManager;
|
|
59
59
|
/** Local JWKS verifier for validating access tokens without a server round-trip. */
|
|
60
60
|
readonly jwksVerifier: Verifier;
|
|
61
|
-
constructor(options: AxiamClientOptions, base: SharedSession, tokenManager: TokenManager, jwksVerifier: Verifier, jar: CookieJar);
|
|
61
|
+
constructor(options: AxiamClientOptions, base: SharedSession, tokenManager: TokenManager, jwksVerifier: Verifier, jar: CookieJar, tlsOptions?: NodeTlsOptions);
|
|
62
|
+
/**
|
|
63
|
+
* Overrides {@link SharedSession.noCredentialsConfig}: `withCredentials` is
|
|
64
|
+
* a browser-XHR concept axios's Node http adapter ignores outright, so the
|
|
65
|
+
* only way to keep this jar's cookies off one particular request is to
|
|
66
|
+
* issue it through a different agent — one `wrapAxios` never touched.
|
|
67
|
+
*
|
|
68
|
+
* The pair is built once and reused (see {@link buildPlainNodeAgents}); a
|
|
69
|
+
* fresh `https.Agent` per call would open a fresh TLS socket per call.
|
|
70
|
+
*/
|
|
71
|
+
noCredentialsConfig(): AxiosRequestConfig;
|
|
62
72
|
/**
|
|
63
73
|
* Drives the actual `POST /api/v1/auth/refresh` HTTP call. Passed to this
|
|
64
74
|
* session's per-instance `refreshGuard` (inherited from SharedSession) by
|
package/dist/grpc/index.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as grpc from '@grpc/grpc-js';
|
|
2
2
|
import { Interceptor } from '@grpc/grpc-js';
|
|
3
|
-
import { N as NodeSession } from '../cookieJar-
|
|
4
|
-
export { A as ACCESS_COOKIE, C as CSRF_COOKIE, R as REFRESH_COOKIE, T as TokenManager, c as createJar, a as createNodeClient, b as createNodeSession, e as extractCookieValue, w as wrapAxios } from '../cookieJar-
|
|
3
|
+
import { N as NodeSession } from '../cookieJar-DoJeU4IN.cjs';
|
|
4
|
+
export { A as ACCESS_COOKIE, C as CSRF_COOKIE, R as REFRESH_COOKIE, T as TokenManager, c as createJar, a as createNodeClient, b as createNodeSession, e as extractCookieValue, w as wrapAxios } from '../cookieJar-DoJeU4IN.cjs';
|
|
5
5
|
import { a as AccessDecision } from '../types-zXSpiQM-.cjs';
|
|
6
6
|
export { A as AxiamClaims, J as JWKS_PATH, V as Verifier, c as createVerifier } from '../jwks-CSXHo3DS.cjs';
|
|
7
|
-
import 'tough-cookie';
|
|
8
|
-
import '../session-B0Lkz0X9.cjs';
|
|
9
7
|
import 'axios';
|
|
8
|
+
import 'tough-cookie';
|
|
9
|
+
import '../session-oiuBA1ZA.cjs';
|
|
10
10
|
import '../telemetry-DrGqL4kb.cjs';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-CzVEJTC5.cjs';
|
|
12
12
|
import '../sensitive-BC_s7Rrd.cjs';
|
|
13
13
|
|
|
14
14
|
/**
|
package/dist/grpc/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import * as grpc from '@grpc/grpc-js';
|
|
2
2
|
import { Interceptor } from '@grpc/grpc-js';
|
|
3
|
-
import { N as NodeSession } from '../cookieJar
|
|
4
|
-
export { A as ACCESS_COOKIE, C as CSRF_COOKIE, R as REFRESH_COOKIE, T as TokenManager, c as createJar, a as createNodeClient, b as createNodeSession, e as extractCookieValue, w as wrapAxios } from '../cookieJar
|
|
3
|
+
import { N as NodeSession } from '../cookieJar-DIpQK-11.js';
|
|
4
|
+
export { A as ACCESS_COOKIE, C as CSRF_COOKIE, R as REFRESH_COOKIE, T as TokenManager, c as createJar, a as createNodeClient, b as createNodeSession, e as extractCookieValue, w as wrapAxios } from '../cookieJar-DIpQK-11.js';
|
|
5
5
|
import { a as AccessDecision } from '../types-BOX-6Srv.js';
|
|
6
6
|
export { A as AxiamClaims, J as JWKS_PATH, V as Verifier, c as createVerifier } from '../jwks-CSXHo3DS.js';
|
|
7
|
-
import 'tough-cookie';
|
|
8
|
-
import '../session-fJCGq5jw.js';
|
|
9
7
|
import 'axios';
|
|
8
|
+
import 'tough-cookie';
|
|
9
|
+
import '../session-ymrHvMuJ.js';
|
|
10
10
|
import '../telemetry-DrGqL4kb.js';
|
|
11
|
-
import '../client-
|
|
11
|
+
import '../client-DLapMy-5.js';
|
|
12
12
|
import '../sensitive-BC_s7Rrd.js';
|
|
13
13
|
|
|
14
14
|
/**
|