axiam-sdk 1.0.0-alpha2 → 1.0.0-alpha21
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 +219 -8
- package/dist/amqp/index.d.cts +1 -1
- package/dist/amqp/index.d.ts +1 -1
- package/dist/amqp/index.js +4 -0
- package/dist/amqp/index.js.map +1 -1
- package/dist/amqp/index.mjs +4 -0
- package/dist/amqp/index.mjs.map +1 -1
- package/dist/{authzCore-xwmCivHH.d.ts → authzCore-DtSN59if.d.ts} +19 -2
- package/dist/{authzCore-CV-Td-V1.d.cts → authzCore-DuRI1aJf.d.cts} +19 -2
- package/dist/client-B_FqmZ0i.d.cts +72 -0
- package/dist/client-Dn1fs5MH.d.ts +72 -0
- package/dist/cookieJar-BTDnjjbL.d.cts +122 -0
- package/dist/cookieJar-Cl8Lq9dL.d.ts +122 -0
- package/dist/grpc/index.d.cts +113 -6
- package/dist/grpc/index.d.ts +113 -6
- package/dist/grpc/index.js +435 -18
- package/dist/grpc/index.js.map +1 -1
- package/dist/grpc/index.mjs +434 -19
- package/dist/grpc/index.mjs.map +1 -1
- package/dist/index.d.cts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +209 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +204 -14
- package/dist/index.mjs.map +1 -1
- package/dist/jwks-BgojMGC5.d.cts +152 -0
- package/dist/jwks-BgojMGC5.d.ts +152 -0
- package/dist/middleware/index.d.cts +208 -8
- package/dist/middleware/index.d.ts +208 -8
- package/dist/middleware/index.js +1107 -1
- package/dist/middleware/index.js.map +1 -1
- package/dist/middleware/index.mjs +1100 -3
- package/dist/middleware/index.mjs.map +1 -1
- package/dist/nestjs/index.d.cts +2 -2
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/nestjs/index.js +3 -0
- package/dist/nestjs/index.js.map +1 -1
- package/dist/nestjs/index.mjs +3 -0
- package/dist/nestjs/index.mjs.map +1 -1
- package/dist/node/index.d.cts +50 -94
- package/dist/node/index.d.ts +50 -94
- package/dist/node/index.js +1039 -15
- package/dist/node/index.js.map +1 -1
- package/dist/node/index.mjs +1023 -16
- package/dist/node/index.mjs.map +1 -1
- package/dist/oidcState-BGxqWUun.d.cts +598 -0
- package/dist/oidcState-CkFuCjpM.d.ts +598 -0
- package/dist/rest/index.d.cts +107 -5
- package/dist/rest/index.d.ts +107 -5
- package/dist/rest/index.js +209 -13
- package/dist/rest/index.js.map +1 -1
- package/dist/rest/index.mjs +204 -14
- package/dist/rest/index.mjs.map +1 -1
- package/dist/sensitive-BC_s7Rrd.d.cts +39 -0
- package/dist/sensitive-BC_s7Rrd.d.ts +39 -0
- package/dist/session-BWUWhhyB.d.cts +154 -0
- package/dist/session-BWUWhhyB.d.ts +154 -0
- package/package.json +2 -2
- package/dist/client-BPg9kfKV.d.ts +0 -150
- package/dist/client-CAeQw1a-.d.cts +0 -150
- package/dist/jwks-CX-nhD6A.d.cts +0 -29
- package/dist/jwks-CX-nhD6A.d.ts +0 -29
- package/dist/sensitive-CWBH_tHr.d.cts +0 -12
- package/dist/sensitive-CWBH_tHr.d.ts +0 -12
package/dist/node/index.d.ts
CHANGED
|
@@ -1,104 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
import
|
|
1
|
+
export { A as ACCESS_COOKIE, C as CSRF_COOKIE, N as NodeSession, R as REFRESH_COOKIE, T as TokenManager, c as createJar, a as createNodeClient, b as createNodeSession, e as extractCookieValue, w as wrapAxios } from '../cookieJar-Cl8Lq9dL.js';
|
|
2
|
+
export { A as AxiamClaims, I as ID_TOKEN_ALG, a as IdTokenClaims, b as IdTokenExpectations, c as IdTokenVerifier, J as JWKS_PATH, d as JwksVerifier, M as MAX_CLOCK_SKEW_SEC, V as Verifier, e as createJwksVerifier, f as createVerifier } from '../jwks-BgojMGC5.js';
|
|
3
|
+
export { A as AuthorizationRequest, D as DISCOVERY_PATH, I as IntrospectParams, a as IntrospectionResult, L as LoginClientCredentialsParams, M as MIN_DISCOVERY_TTL_MS, b as MemoryOidcStateStore, O as OIDC_STATE_TTL_MS, c as OidcBeginParams, d as OidcClient, e as OidcClientOptions, f as OidcConfiguration, g as OidcExchangeParams, h as OidcRefreshParams, i as OidcStateEntry, j as OidcStateStore, k as OidcTokenSet, R as RevokeParams, S as SSO_CALLBACK_PATH, l as SSO_START_PATH, m as SsoCompleteParams, n as SsoCompleteResult, o as SsoStartParams, p as SsoStartResult, q as createOidcClient, r as normalizeOrigin } from '../oidcState-CkFuCjpM.js';
|
|
4
|
+
import { S as Sensitive } from '../sensitive-BC_s7Rrd.js';
|
|
5
|
+
import 'tough-cookie';
|
|
6
|
+
import '../session-BWUWhhyB.js';
|
|
7
|
+
import 'axios';
|
|
8
|
+
import '../client-Dn1fs5MH.js';
|
|
7
9
|
import '../types-BVkMoqLU.js';
|
|
8
10
|
|
|
9
|
-
declare class TokenManager {
|
|
10
|
-
#private;
|
|
11
|
-
constructor(jar: CookieJar, baseUrl: string, tenantId?: string);
|
|
12
|
-
/**
|
|
13
|
-
* Synchronous, best-effort read of the last-known access token. Returns
|
|
14
|
-
* `null` if no token has been cached yet (no request/refresh has
|
|
15
|
-
* completed since construction, or `syncFromJar()` was never called).
|
|
16
|
-
*/
|
|
17
|
-
cachedAccessToken(): Sensitive<string> | null;
|
|
18
|
-
/**
|
|
19
|
-
* Async read of the current `axiam_refresh` cookie value from the jar,
|
|
20
|
-
* wrapped in Sensitive<T>. Queried against the refresh endpoint's URL
|
|
21
|
-
* since the cookie is path-scoped to `/api/v1/auth/refresh` (not visible
|
|
22
|
-
* at the bare base URL).
|
|
23
|
-
*/
|
|
24
|
-
refreshTokenValue(): Promise<Sensitive<string> | null>;
|
|
25
|
-
/**
|
|
26
|
-
* Refresh the in-memory cached access token from the jar. Call this after
|
|
27
|
-
* every REST request/refresh so the synchronous gRPC-interceptor fast-path
|
|
28
|
-
* (`cachedAccessToken()`) stays current (Pitfall 3).
|
|
29
|
-
*/
|
|
30
|
-
syncFromJar(): Promise<void>;
|
|
31
|
-
/** The resolved tenant identifier (slug or UUID form), if known. */
|
|
32
|
-
tenantId(): string | undefined;
|
|
33
|
-
/** Set/update the resolved tenant identifier (e.g. after decoding the access token's tenant_id claim). */
|
|
34
|
-
setTenantId(tenantId: string): void;
|
|
35
|
-
/** Clear all cached token state (used by logout()). */
|
|
36
|
-
clear(): void;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare class NodeSession extends SharedSession {
|
|
40
|
-
#private;
|
|
41
|
-
readonly tokenManager: TokenManager;
|
|
42
|
-
readonly jwksVerifier: Verifier;
|
|
43
|
-
constructor(options: AxiamClientOptions, base: SharedSession, tokenManager: TokenManager, jwksVerifier: Verifier, jar: CookieJar);
|
|
44
|
-
/**
|
|
45
|
-
* Drives the actual `POST /api/v1/auth/refresh` HTTP call. Passed to this
|
|
46
|
-
* session's per-instance `refreshGuard` (inherited from SharedSession) by
|
|
47
|
-
* both REST's reactive interceptor (rest/interceptors.ts) and gRPC's
|
|
48
|
-
* callWithRefresh — since `refreshGuard` is scoped to THIS session
|
|
49
|
-
* instance (CR-02, D-13), both transports share exactly one in-flight
|
|
50
|
-
* refresh for this session regardless of which one triggers it, while
|
|
51
|
-
* remaining fully independent from any other session's guard.
|
|
52
|
-
*/
|
|
53
|
-
doRefresh: () => Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Session-level hook (CR-01, D-05) invoked by rest/auth.ts after a
|
|
56
|
-
* successful login()/verifyMfa(). Refreshes the cached access token (so
|
|
57
|
-
* the gRPC interceptor's synchronous fast-path is current immediately
|
|
58
|
-
* after login) and reads the `axiam_csrf` cookie out of the jar into
|
|
59
|
-
* `session.csrfToken`, mirroring TokenManager.syncFromJar()'s pattern.
|
|
60
|
-
*/
|
|
61
|
-
onAuthenticated: () => Promise<void>;
|
|
62
|
-
}
|
|
63
|
-
/** Build the Node persona's session: REST SharedSession + cookie jar + TokenManager + JWKS verifier. */
|
|
64
|
-
declare function createNodeSession(options: AxiamClientOptions): NodeSession;
|
|
65
11
|
/**
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
*
|
|
72
|
-
* correctly under Node.
|
|
12
|
+
* The only PKCE code-challenge method this SDK emits (RFC 7636 §4.2,
|
|
13
|
+
* CONTRACT.md §12.1 rule 3). `plain` is intentionally absent.
|
|
14
|
+
*/
|
|
15
|
+
declare const CODE_CHALLENGE_METHOD_S256 = "S256";
|
|
16
|
+
/**
|
|
17
|
+
* Entropy, in bytes, of a generated `state` / `nonce` / `code_verifier`.
|
|
73
18
|
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* built from the same `NodeSession`.
|
|
19
|
+
* §12.1 rule 1 requires at least 16 bytes (128 bits) and RECOMMENDS 32;
|
|
20
|
+
* rule 2 RECOMMENDS 32 bytes for the verifier, which base64url-encodes to
|
|
21
|
+
* exactly 43 characters — the minimum RFC 7636 §4.1 length, drawn only from
|
|
22
|
+
* the unreserved set `[A-Za-z0-9-._~]`.
|
|
79
23
|
*/
|
|
80
|
-
declare
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
24
|
+
declare const CSPRNG_BYTES = 32;
|
|
25
|
+
/**
|
|
26
|
+
* Generate a URL-safe random token: `bytes` CSPRNG bytes, base64url-encoded
|
|
27
|
+
* **without** padding (RFC 4648 §5 — Node's `'base64url'` encoding never
|
|
28
|
+
* emits `=`).
|
|
29
|
+
*
|
|
30
|
+
* Used for both `state` and `nonce`, which §12.3 rule 2 classes as
|
|
31
|
+
* **non-secret**: they are returned as plain strings, are echoed through the
|
|
32
|
+
* browser's address bar by construction, and are safe to log.
|
|
33
|
+
*/
|
|
34
|
+
declare function randomUrlSafeToken(bytes?: number): string;
|
|
90
35
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
36
|
+
* Generate a fresh PKCE `code_verifier` (RFC 7636 §4.1): 32 CSPRNG bytes
|
|
37
|
+
* base64url-encoded without padding, i.e. 43 characters from the unreserved
|
|
38
|
+
* set.
|
|
39
|
+
*
|
|
40
|
+
* Returned already wrapped in {@link Sensitive} — §12.5 makes the verifier
|
|
41
|
+
* secret **for its whole lifetime**, including while it sits in the
|
|
42
|
+
* `AuthorizationRequest` handed back to the caller and in any
|
|
43
|
+
* `OidcStateStore` entry.
|
|
95
44
|
*/
|
|
96
|
-
declare function
|
|
45
|
+
declare function generateCodeVerifier(): Sensitive<string>;
|
|
97
46
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
47
|
+
* Derive the PKCE `code_challenge` from a verifier:
|
|
48
|
+
* `BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))`, unpadded
|
|
49
|
+
* (RFC 7636 §4.2, CONTRACT.md §12.1 rule 3).
|
|
50
|
+
*
|
|
51
|
+
* The verifier is hashed as ASCII exactly as the RFC specifies. Verified
|
|
52
|
+
* against the RFC 7636 Appendix B test vector in
|
|
53
|
+
* `test/node/oidcPkce.test.ts`, which every SDK must carry (§12.1 rule 3).
|
|
54
|
+
*
|
|
55
|
+
* The challenge is a one-way digest and is **not** secret — it travels in the
|
|
56
|
+
* authorization URL — so it is returned as a plain string.
|
|
101
57
|
*/
|
|
102
|
-
declare function
|
|
58
|
+
declare function computeCodeChallenge(codeVerifier: string): string;
|
|
103
59
|
|
|
104
|
-
export {
|
|
60
|
+
export { CODE_CHALLENGE_METHOD_S256, CSPRNG_BYTES, computeCodeChallenge, generateCodeVerifier, randomUrlSafeToken };
|