@hawcx/oauth-client 5.2.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +226 -0
- package/README.md +30 -0
- package/dist/client-assertion.d.ts.map +1 -1
- package/dist/client-assertion.js +6 -2
- package/dist/client-assertion.js.map +1 -1
- package/dist/delegation/exceptions.d.ts +34 -0
- package/dist/delegation/exceptions.d.ts.map +1 -1
- package/dist/delegation/exceptions.js +39 -1
- package/dist/delegation/exceptions.js.map +1 -1
- package/dist/delegation/hawcx.d.ts +6 -2
- package/dist/delegation/hawcx.d.ts.map +1 -1
- package/dist/delegation/hawcx.js.map +1 -1
- package/dist/delegation/index.d.ts +2 -1
- package/dist/delegation/index.d.ts.map +1 -1
- package/dist/delegation/index.js +3 -1
- package/dist/delegation/index.js.map +1 -1
- package/dist/delegation/transport.d.ts +6 -2
- package/dist/delegation/transport.d.ts.map +1 -1
- package/dist/delegation/transport.js +9 -2
- package/dist/delegation/transport.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/url.d.ts +66 -0
- package/dist/internal/url.d.ts.map +1 -0
- package/dist/internal/url.js +155 -0
- package/dist/internal/url.js.map +1 -0
- package/dist/management/jwt_transport.d.ts +44 -3
- package/dist/management/jwt_transport.d.ts.map +1 -1
- package/dist/management/jwt_transport.js +60 -4
- package/dist/management/jwt_transport.js.map +1 -1
- package/dist/management/response_signature.d.ts +65 -0
- package/dist/management/response_signature.d.ts.map +1 -0
- package/dist/management/response_signature.js +170 -0
- package/dist/management/response_signature.js.map +1 -0
- package/dist/oauth.d.ts +1 -1
- package/dist/oauth.d.ts.map +1 -1
- package/dist/oauth.js +35 -24
- package/dist/oauth.js.map +1 -1
- package/dist/stepup/client.d.ts +11 -0
- package/dist/stepup/client.d.ts.map +1 -1
- package/dist/stepup/client.js +6 -1
- package/dist/stepup/client.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,232 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [6.0.0] - 2026-10-10
|
|
11
|
+
|
|
12
|
+
First public release since 5.2.0. **Major version** because of the BREAKING
|
|
13
|
+
entries below, which change behaviour for configurations that 5.2.0 accepted.
|
|
14
|
+
It contains everything from the internal release candidates 6.0.0-rc.1 and
|
|
15
|
+
6.0.0-rc.2, plus one fix to `ClientAssertionSigner` made after rc.2.
|
|
16
|
+
|
|
17
|
+
### Breaking — action needed when upgrading from 5.2.0
|
|
18
|
+
|
|
19
|
+
- **Management API response signatures are verified by default
|
|
20
|
+
(TOB-HSDK-11).** `JwtBearerTransport` and `StepUpClient.withPrivateKeyJwt`
|
|
21
|
+
now verify `X-Response-Signature` on every successful response. This
|
|
22
|
+
reverses the 5.2.0 note that callers "may" verify the header themselves.
|
|
23
|
+
The SDK checks the following:
|
|
24
|
+
- the JWS uses ES256, ES384 or ES512 and verifies against
|
|
25
|
+
`${issuer}/.well-known/jwks.json`;
|
|
26
|
+
- `iat` is within `clockSkewSeconds` (default 300);
|
|
27
|
+
- `body_sha256` matches the exact response bytes;
|
|
28
|
+
- the token carries no `aud`, `sub` or `nonce`.
|
|
29
|
+
|
|
30
|
+
Responses with status 400 and above are not verified. hx_auth signs every
|
|
31
|
+
jwt-mode 2xx, so production traffic is unaffected. **Action needed** if any
|
|
32
|
+
of these apply:
|
|
33
|
+
- A gateway, CDN or proxy strips response headers. Every call fails with
|
|
34
|
+
`ResponseSignatureInvalidError`; let `X-Response-Signature` through.
|
|
35
|
+
- Mocks, stubs or contract-test harnesses built against 5.2.0 return
|
|
36
|
+
unsigned 2xx responses. Sign the responses, or disable verification in the
|
|
37
|
+
test harness.
|
|
38
|
+
- `baseUrl` is not the OP host, such as an internal service URL or local dev
|
|
39
|
+
with separate ports. The JWKS is fetched from `baseUrl` by default, so set
|
|
40
|
+
`issuer`.
|
|
41
|
+
- **`baseUrl` (and `issuer`) values that used to be accepted now throw at
|
|
42
|
+
construction (TOB-HSDK-13).** The affected classes are `JwtBearerTransport`
|
|
43
|
+
and `StepUpClient.withPrivateKeyJwt` (`DelegationRequestError`),
|
|
44
|
+
`DelegationTransport` and the `DelegationClient`/`StepUpClient` ECIES
|
|
45
|
+
factories (`DelegationRequestError`), legacy `HawcxOAuth`
|
|
46
|
+
(`HawcxOAuthError`), and `HawcxOAuth.fromIssuer` (`DiscoveryError`):
|
|
47
|
+
- **Plain `http:` on a non-loopback host.** Examples:
|
|
48
|
+
`http://hawcx-api:8080` (docker-compose service name),
|
|
49
|
+
`http://0.0.0.0:8080`, `http://host.docker.internal:8080`, and in-cluster
|
|
50
|
+
service URLs behind a TLS-terminating gateway. Only `localhost`,
|
|
51
|
+
`127.0.0.1` and `[::1]` may use `http:`. **Action needed:** use `https:`,
|
|
52
|
+
or point the SDK at a loopback address.
|
|
53
|
+
- **Userinfo, query or fragment in the base.** For example
|
|
54
|
+
`https://user:pw@api.hawcx.com`, `https://api.hawcx.com?tenant=x` or
|
|
55
|
+
`https://api.hawcx.com#x`. **Action needed:** remove them.
|
|
56
|
+
- **The signed JWT `aud` string changes for non-canonical base spellings
|
|
57
|
+
(TOB-HSDK-13).** Host case and default ports are now normalised, so
|
|
58
|
+
`baseUrl: 'https://API.Hawcx.com:443'` produces
|
|
59
|
+
`aud = https://api.hawcx.com/v1/...`, where 5.2.0 produced
|
|
60
|
+
`https://API.Hawcx.com:443/v1/...`. The new value is the one `fetch`
|
|
61
|
+
actually sends. **Action needed** only if a server compares `aud` by exact
|
|
62
|
+
string against a configured non-canonical value: update that value, or use
|
|
63
|
+
a canonical `baseUrl`. Canonical bases (lower-case host, no default port,
|
|
64
|
+
with or without a trailing slash or a path prefix) produce byte-identical
|
|
65
|
+
URLs and `aud`.
|
|
66
|
+
|
|
67
|
+
### Added
|
|
68
|
+
|
|
69
|
+
- New options on `JwtBearerTransport` and `StepUpClient.withPrivateKeyJwt`:
|
|
70
|
+
`issuer` (defaults to `baseUrl`), `verifyResponseSignature` (defaults to
|
|
71
|
+
`true`) and `clockSkewSeconds`. `verifyResponseSignature: false` is an
|
|
72
|
+
**emergency escape hatch** that restores the 5.2.0 behaviour and emits a
|
|
73
|
+
one-time process warning. `withPrivateKeyJwt` now also passes
|
|
74
|
+
`clockSkewSeconds` through to the transport.
|
|
75
|
+
- New error classes, both subclasses of `DelegationResponseError`, exported
|
|
76
|
+
with a stable `code`:
|
|
77
|
+
- `ResponseSignatureInvalidError` (`response_signature_invalid`).
|
|
78
|
+
- `ResponseSignatureUnavailableError` (`response_signature_unavailable`).
|
|
79
|
+
It means the signing keys could not be fetched, and **the request may
|
|
80
|
+
already have been applied** server-side.
|
|
81
|
+
|
|
82
|
+
### Changed
|
|
83
|
+
|
|
84
|
+
- Every security-relevant URL is now parsed and joined with the WHATWG `URL`
|
|
85
|
+
API rather than by string concatenation (TOB-HSDK-13). This covers
|
|
86
|
+
`JwtBearerTransport` and `DelegationTransport` (`baseUrl` + endpoint),
|
|
87
|
+
legacy `new HawcxOAuth({ baseUrl })` (`/oauth2/token` and `/keys`), and the
|
|
88
|
+
`fromIssuer` issuer and discovery URL. Each joined URL must keep the base's
|
|
89
|
+
origin and stay under the base path prefix, or the SDK throws (fail
|
|
90
|
+
closed). An endpoint must be a relative path that starts with a single
|
|
91
|
+
`/`. It may not contain `//`, a backslash, whitespace or control
|
|
92
|
+
characters, a fragment, or a percent-encoded `/`, `.` or `\` (`%2f`,
|
|
93
|
+
`%2e`, `%5c`, any case) in its path.
|
|
94
|
+
- Discovered `token_endpoint` and `jwks_uri` values carrying userinfo are now
|
|
95
|
+
rejected (`DiscoveryError`).
|
|
96
|
+
- The `clearCache()` deprecation warning now says it will be removed in a
|
|
97
|
+
future major version rather than in 6.0.0. It is still deprecated (use
|
|
98
|
+
`refreshJwks()`) and still present in 6.0.0.
|
|
99
|
+
|
|
100
|
+
### Fixed
|
|
101
|
+
|
|
102
|
+
- **Discovery mode now sends `client_id` on the public-client (PKCE) token
|
|
103
|
+
exchange.** Previously `exchangeCode()` added `client_id` to the token form
|
|
104
|
+
only when a `private_key_jwt` signer was set; a public PKCE exchange sent
|
|
105
|
+
only the `X-Config-Id` header. The OP then fell back to the project's
|
|
106
|
+
default client (`token.legacy_config_id_fallback`) and stamped the id_token
|
|
107
|
+
`aud` with that client's id, so on a project with more than one public OIDC
|
|
108
|
+
client, an app using a non-default client failed verification with
|
|
109
|
+
"Unexpected JWT audience". `exchangeCode()` now always sends the configured
|
|
110
|
+
`clientId` as `client_id` in discovery mode (RFC 6749 §4.1.3), for public
|
|
111
|
+
and `private_key_jwt` clients alike; the OP resolves that specific client
|
|
112
|
+
and stamps `aud` with it. `X-Config-Id` is still sent.
|
|
113
|
+
- Single-client projects are unaffected: their `clientId` is the default
|
|
114
|
+
client, so the resolved client and `aud` are the same as before.
|
|
115
|
+
- Legacy mode (`new HawcxOAuth({ configId, baseUrl })`) has no `clientId`
|
|
116
|
+
and is unchanged: it sends no `client_id`.
|
|
117
|
+
- `ClientAssertionSigner.sign()` now reads the clock once for `iat` and `exp`.
|
|
118
|
+
Two separate reads could straddle a second boundary and make the assertion
|
|
119
|
+
one second longer than its lifetime; at `withLifetimeSeconds(120)` that
|
|
120
|
+
exceeds the OP's 120s cap and the token exchange is rejected.
|
|
121
|
+
|
|
122
|
+
## [6.0.0-rc.2] - 2026-10-10
|
|
123
|
+
|
|
124
|
+
> **Release candidate, internal only.** Published to AWS CodeArtifact
|
|
125
|
+
> (`npm-internal`), not public npm; the release workflow refuses to publish a
|
|
126
|
+
> prerelease publicly. Contains everything in 6.0.0-rc.1 plus the fix below.
|
|
127
|
+
> To install, point the `@hawcx` scope at CodeArtifact
|
|
128
|
+
> (`aws codeartifact login --tool npm --domain hawcx --repository npm-internal --namespace @hawcx`)
|
|
129
|
+
> and run `npm install @hawcx/oauth-client@6.0.0-rc.2`.
|
|
130
|
+
|
|
131
|
+
### Fixed
|
|
132
|
+
|
|
133
|
+
- **Discovery mode now sends `client_id` on the public-client (PKCE) token
|
|
134
|
+
exchange.** Previously `exchangeCode()` added `client_id` to the token form
|
|
135
|
+
only when a `private_key_jwt` signer was set; a public PKCE exchange sent
|
|
136
|
+
only the `X-Config-Id` header. The OP then fell back to the project's
|
|
137
|
+
default client (`token.legacy_config_id_fallback`) and stamped the id_token
|
|
138
|
+
`aud` with that client's id, so on a project with more than one public OIDC
|
|
139
|
+
client, an app using a non-default client failed verification with
|
|
140
|
+
"Unexpected JWT audience". `exchangeCode()` now always sends the configured
|
|
141
|
+
`clientId` as `client_id` in discovery mode (RFC 6749 §4.1.3), for public
|
|
142
|
+
and `private_key_jwt` clients alike; the OP resolves that specific client
|
|
143
|
+
and stamps `aud` with it. `X-Config-Id` is still sent.
|
|
144
|
+
- Single-client projects are unaffected: their `clientId` is the default
|
|
145
|
+
client, so the resolved client and `aud` are the same as before.
|
|
146
|
+
- Legacy mode (`new HawcxOAuth({ configId, baseUrl })`) has no `clientId`
|
|
147
|
+
and is unchanged: it sends no `client_id`.
|
|
148
|
+
|
|
149
|
+
## [6.0.0-rc.1] - 2026-10-07
|
|
150
|
+
|
|
151
|
+
> **Release candidate, internal only.** Published to AWS CodeArtifact
|
|
152
|
+
> (`npm-internal`), not public npm; the release workflow refuses to publish a
|
|
153
|
+
> prerelease publicly. **Major version** because of the BREAKING entries below,
|
|
154
|
+
> which change behaviour for configurations that 5.2.0 accepted. To install,
|
|
155
|
+
> point the `@hawcx` scope at CodeArtifact
|
|
156
|
+
> (`aws codeartifact login --tool npm --domain hawcx --repository npm-internal --namespace @hawcx`)
|
|
157
|
+
> and run `npm install @hawcx/oauth-client@6.0.0-rc.1`.
|
|
158
|
+
|
|
159
|
+
### Security — management API response signatures are verified by default (TOB-HSDK-11)
|
|
160
|
+
|
|
161
|
+
- **BREAKING — `JwtBearerTransport` and `StepUpClient.withPrivateKeyJwt` now
|
|
162
|
+
verify `X-Response-Signature` on every successful response, and this is on
|
|
163
|
+
by default.** This reverses the 5.2.0 note that callers "may" verify the
|
|
164
|
+
header themselves. The SDK checks the following:
|
|
165
|
+
- the JWS uses ES256, ES384 or ES512 and verifies against
|
|
166
|
+
`${issuer}/.well-known/jwks.json`;
|
|
167
|
+
- `iat` is within `clockSkewSeconds` (default 300);
|
|
168
|
+
- `body_sha256` matches the exact response bytes;
|
|
169
|
+
- the token carries no `aud`, `sub` or `nonce`.
|
|
170
|
+
|
|
171
|
+
Responses with status 400 and above are not verified. hx_auth signs every
|
|
172
|
+
jwt-mode 2xx, so production traffic is unaffected. The following will
|
|
173
|
+
**break**:
|
|
174
|
+
- A gateway, CDN or proxy that strips response headers. Every call fails
|
|
175
|
+
with `ResponseSignatureInvalidError`.
|
|
176
|
+
- Customer mocks, stubs and contract-test harnesses built against 5.2.0 that
|
|
177
|
+
return unsigned 2xx responses. Sign the responses, or disable verification
|
|
178
|
+
in the test harness.
|
|
179
|
+
- A `baseUrl` that is not the OP host, such as an internal service URL or
|
|
180
|
+
local dev with separate ports. The JWKS is fetched from `baseUrl` by
|
|
181
|
+
default, so set `issuer`.
|
|
182
|
+
- New options on both: `issuer` (defaults to `baseUrl`),
|
|
183
|
+
`verifyResponseSignature` (defaults to `true`) and `clockSkewSeconds`.
|
|
184
|
+
`verifyResponseSignature: false` is an **emergency escape hatch** that
|
|
185
|
+
restores the 5.2.0 behaviour and emits a one-time process warning.
|
|
186
|
+
`withPrivateKeyJwt` now also passes `clockSkewSeconds` through to the
|
|
187
|
+
transport.
|
|
188
|
+
- New error classes, both subclasses of `DelegationResponseError`, exported
|
|
189
|
+
with a stable `code`:
|
|
190
|
+
- `ResponseSignatureInvalidError` (`response_signature_invalid`).
|
|
191
|
+
- `ResponseSignatureUnavailableError` (`response_signature_unavailable`).
|
|
192
|
+
It means the signing keys could not be fetched, and **the request may
|
|
193
|
+
already have been applied** server-side.
|
|
194
|
+
|
|
195
|
+
### Security — structured URL validation and joining (TOB-HSDK-13)
|
|
196
|
+
|
|
197
|
+
- Every security-relevant URL is now parsed and joined with the WHATWG `URL`
|
|
198
|
+
API rather than by string concatenation. This covers `JwtBearerTransport`
|
|
199
|
+
and `DelegationTransport` (`baseUrl` + endpoint), legacy
|
|
200
|
+
`new HawcxOAuth({ baseUrl })` (`/oauth2/token` and `/keys`), and the
|
|
201
|
+
`fromIssuer` issuer and discovery URL. Each joined URL must keep the base's
|
|
202
|
+
origin and stay under the base path prefix, or the SDK throws (fail
|
|
203
|
+
closed). An endpoint must be a relative path that starts with a single
|
|
204
|
+
`/`. It may not contain `//`, a backslash, whitespace or control
|
|
205
|
+
characters, a fragment, or a percent-encoded `/`, `.` or `\` (`%2f`,
|
|
206
|
+
`%2e`, `%5c`, any case) in its path.
|
|
207
|
+
- **BREAKING — `baseUrl` (and `issuer`) values that used to be accepted now
|
|
208
|
+
throw at construction.** The affected classes are `JwtBearerTransport` and
|
|
209
|
+
`StepUpClient.withPrivateKeyJwt` (`DelegationRequestError`),
|
|
210
|
+
`DelegationTransport` and the `DelegationClient`/`StepUpClient`
|
|
211
|
+
ECIES factories (`DelegationRequestError`), legacy `HawcxOAuth`
|
|
212
|
+
(`HawcxOAuthError`), and `HawcxOAuth.fromIssuer` (`DiscoveryError`):
|
|
213
|
+
- **Plain `http:` on a non-loopback host.** Examples:
|
|
214
|
+
`http://hawcx-api:8080` (docker-compose service name),
|
|
215
|
+
`http://0.0.0.0:8080`, `http://host.docker.internal:8080`, and in-cluster
|
|
216
|
+
service URLs behind a TLS-terminating gateway. Only `localhost`,
|
|
217
|
+
`127.0.0.1` and `[::1]` may use `http:`. Use `https:`, or point the SDK
|
|
218
|
+
at a loopback address.
|
|
219
|
+
- **Userinfo, query or fragment in the base.** For example
|
|
220
|
+
`https://user:pw@api.hawcx.com`, `https://api.hawcx.com?tenant=x` or
|
|
221
|
+
`https://api.hawcx.com#x`.
|
|
222
|
+
- **BREAKING — the signed JWT `aud` string changes for non-canonical base
|
|
223
|
+
spellings.** Host case and default ports are now normalised, so
|
|
224
|
+
`baseUrl: 'https://API.Hawcx.com:443'` produces
|
|
225
|
+
`aud = https://api.hawcx.com/v1/...`, where 5.2.0 produced
|
|
226
|
+
`https://API.Hawcx.com:443/v1/...`. The new value is the one `fetch`
|
|
227
|
+
actually sends. A server that compares `aud` by exact string against a
|
|
228
|
+
configured non-canonical value will reject the new form. Canonical bases
|
|
229
|
+
(lower-case host, no default port, with or without a trailing slash or a
|
|
230
|
+
path prefix) produce byte-identical URLs and `aud`.
|
|
231
|
+
- Discovered `token_endpoint` and `jwks_uri` values carrying userinfo are now
|
|
232
|
+
rejected (`DiscoveryError`).
|
|
233
|
+
|
|
8
234
|
## [5.2.0] - 2026-06-26
|
|
9
235
|
|
|
10
236
|
### Added — Management API authentication via `private_key_jwt` (Path A)
|
package/README.md
CHANGED
|
@@ -479,6 +479,36 @@ object, a PKCS#8 PEM string, or a pre-imported jose `KeyLike`.
|
|
|
479
479
|
Each request is signed with a short-lived per-request EdDSA JWT whose `aud` is the
|
|
480
480
|
full request URL and whose `body_sha256` claim covers the exact bytes sent.
|
|
481
481
|
|
|
482
|
+
Every successful response is authenticated too. The SDK verifies the
|
|
483
|
+
`X-Response-Signature` JWS (ES256/ES384/ES512) against
|
|
484
|
+
`${issuer}/.well-known/jwks.json`. It also checks that the JWS `iat` is within
|
|
485
|
+
`clockSkewSeconds` (default 300) and that its `body_sha256` matches the exact
|
|
486
|
+
response bytes. `issuer` defaults to `baseUrl`, because the management API and
|
|
487
|
+
the OP share a host in every Hawcx environment. Set `issuer` explicitly if they
|
|
488
|
+
differ, for example in local development.
|
|
489
|
+
|
|
490
|
+
> **Scope:** by default the JWKS comes from the **same origin as the API**.
|
|
491
|
+
> Verification therefore protects against tampering *between* that origin and
|
|
492
|
+
> you: caches, proxies and gateways, or a compromised downstream service. It
|
|
493
|
+
> does **not** protect against a compromised origin. If you need that, pin
|
|
494
|
+
> `issuer` to a separately trusted host.
|
|
495
|
+
|
|
496
|
+
Failures throw one of two subclasses of `DelegationResponseError`, each with a
|
|
497
|
+
stable `code`:
|
|
498
|
+
|
|
499
|
+
- `ResponseSignatureInvalidError` (`code: 'response_signature_invalid'`): the
|
|
500
|
+
header is missing or empty, or the signature does not verify. Treat the
|
|
501
|
+
response as untrusted.
|
|
502
|
+
- `ResponseSignatureUnavailableError` (`code: 'response_signature_unavailable'`):
|
|
503
|
+
the signing keys could not be obtained. The JWKS fetch failed, timed out or
|
|
504
|
+
returned something unusable, or a newly rotated `kid` arrived while refetching
|
|
505
|
+
was cooling down. **The server has already processed the request**, so a
|
|
506
|
+
non-idempotent write such as `consumeReceipt` may have been applied. Reconcile
|
|
507
|
+
state rather than retrying blindly.
|
|
508
|
+
|
|
509
|
+
`verifyResponseSignature: false` turns verification off. It is an emergency
|
|
510
|
+
escape hatch only, and it logs a one-time process warning.
|
|
511
|
+
|
|
482
512
|
### Methods
|
|
483
513
|
|
|
484
514
|
#### `stepUp.startToken(options): Promise<StepUpStartTokenResponse>`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-assertion.d.ts","sourceRoot":"","sources":["../src/client-assertion.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAmC,KAAK,GAAG,EAAE,MAAM,MAAM,CAAC;AAKjE,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,2DACwB,CAAC;AAK3D,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA6B;IACzD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,iEAAiE;IACjE,OAAO,CAAC,UAAU,CAAC,CAAuB;IAE1C,OAAO;IAUP;;;;;OAKG;IACH,MAAM,CAAC,cAA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;;;;OAIG;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB;IAK3D,OAAO,CAAC,SAAS;IAYjB;;;;;;OAMG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAgBhE"}
|
package/dist/client-assertion.js
CHANGED
|
@@ -119,13 +119,17 @@ class ClientAssertionSigner {
|
|
|
119
119
|
*/
|
|
120
120
|
async sign(clientId, audience) {
|
|
121
121
|
const key = await this.importKey();
|
|
122
|
+
// One clock read for both claims: separate reads can straddle a second
|
|
123
|
+
// boundary and make exp - iat one second longer than the lifetime, which at
|
|
124
|
+
// the 120s maximum exceeds the OP's cap.
|
|
125
|
+
const now = Math.floor(Date.now() / 1000);
|
|
122
126
|
return new jose_1.SignJWT({})
|
|
123
127
|
.setProtectedHeader({ alg: 'EdDSA', typ: 'JWT', kid: this.kid })
|
|
124
128
|
.setIssuer(clientId)
|
|
125
129
|
.setSubject(clientId)
|
|
126
130
|
.setAudience(audience)
|
|
127
|
-
.setIssuedAt()
|
|
128
|
-
.setExpirationTime(
|
|
131
|
+
.setIssuedAt(now)
|
|
132
|
+
.setExpirationTime(now + this.lifetimeSeconds)
|
|
129
133
|
.setJti((0, node_crypto_1.randomUUID)())
|
|
130
134
|
.sign(key);
|
|
131
135
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-assertion.js","sourceRoot":"","sources":["../src/client-assertion.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,6CAAyC;AAEzC,+BAAiE;AAKjE,qEAAqE;AACxD,QAAA,qBAAqB,GAChC,wDAAwD,CAAC;AAE3D,MAAM,wBAAwB,GAAG,EAAE,CAAC;AACpC,MAAM,oBAAoB,GAAG,GAAG,CAAC,CAAC,qCAAqC;AAEvE,MAAa,qBAAqB;IAOhC,YACE,WAAuC,EACvC,GAAW,EACX,eAAuB;QAEvB,IAAI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AAW,CAAC,QAAQ,CAAC;aACrB,WAAW,CAAC,GAAG,CAAC;aAChB,iBAAiB,CAAC,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC;aAC7C,MAAM,CAAC,IAAA,wBAAU,GAAE,CAAC;aACpB,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACF;AArID,sDAqIC;AAED,SAAS,aAAa,CAAC,GAAgB;IACrC,kFAAkF;IAClF,MAAM,IAAI,GAAI,GAA0B,CAAC,iBAAiB,CAAC;IAC3D,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,+BAA+B,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
|
|
@@ -36,4 +36,38 @@ export declare class DelegationRequestError extends DelegationError {
|
|
|
36
36
|
export declare class DelegationResponseError extends DelegationError {
|
|
37
37
|
constructor(message: string, options?: DelegationErrorOptions);
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Stable machine-readable reasons for management-API response-signature
|
|
41
|
+
* failures (TOB-HSDK-11). See {@link ResponseSignatureInvalidError} and
|
|
42
|
+
* {@link ResponseSignatureUnavailableError}.
|
|
43
|
+
*/
|
|
44
|
+
export type ResponseSignatureErrorCode = 'response_signature_invalid' | 'response_signature_unavailable';
|
|
45
|
+
/**
|
|
46
|
+
* The management API response's `X-Response-Signature` is missing, empty, or
|
|
47
|
+
* does not verify (bad signature, disallowed `alg`, kid absent from a freshly
|
|
48
|
+
* fetched JWKS, stale/future `iat`, body hash mismatch, wrong token type).
|
|
49
|
+
* Treat the response as untrusted.
|
|
50
|
+
*/
|
|
51
|
+
export declare class ResponseSignatureInvalidError extends DelegationResponseError {
|
|
52
|
+
readonly code: ResponseSignatureErrorCode;
|
|
53
|
+
constructor(message: string, options?: DelegationErrorOptions);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The response signature could not be checked because the verification
|
|
57
|
+
* infrastructure was unavailable: the issuer JWKS fetch failed or timed out,
|
|
58
|
+
* returned a non-200 or malformed document, or the signing `kid` was unknown
|
|
59
|
+
* while a refetch was suppressed by the JWKS refetch cooldown (e.g. during
|
|
60
|
+
* key rotation).
|
|
61
|
+
*
|
|
62
|
+
* **The server already processed the request.** For a non-idempotent write
|
|
63
|
+
* (e.g. `StepUpClient.consumeReceipt`) the operation may have been applied
|
|
64
|
+
* even though this error is thrown — reconcile state rather than blindly
|
|
65
|
+
* retrying. This error does NOT imply the response was genuine: its body is
|
|
66
|
+
* never returned, and an on-path party that can inject responses can also
|
|
67
|
+
* induce this error (e.g. with an unknown `kid`).
|
|
68
|
+
*/
|
|
69
|
+
export declare class ResponseSignatureUnavailableError extends DelegationResponseError {
|
|
70
|
+
readonly code: ResponseSignatureErrorCode;
|
|
71
|
+
constructor(message: string, options?: DelegationErrorOptions);
|
|
72
|
+
}
|
|
39
73
|
//# sourceMappingURL=exceptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.d.ts","sourceRoot":"","sources":["../../src/delegation/exceptions.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,eAAgB,SAAQ,eAAe;IAClD,SAAgB,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEpB,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;CAMlE;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,eAAe;gBAC5C,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;CAKlE;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,eAAe;IACzD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;gB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H,qBAAa,6BAA8B,SAAQ,uBAAuB;IACxE,SAAgB,IAAI,EAAE,0BAA0B,CAAgC;gBAEpE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;CAKlE;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,iCAAkC,SAAQ,uBAAuB;IAC5E,SAAgB,IAAI,EAAE,0BAA0B,CAAoC;gBAExE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;CAKlE"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Custom exceptions for the Delegation module
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DelegationResponseError = exports.DelegationRequestError = exports.DelegationCryptoError = exports.DelegationError = void 0;
|
|
6
|
+
exports.ResponseSignatureUnavailableError = exports.ResponseSignatureInvalidError = exports.DelegationResponseError = exports.DelegationRequestError = exports.DelegationCryptoError = exports.DelegationError = void 0;
|
|
7
7
|
const errors_1 = require("../errors");
|
|
8
8
|
class DelegationError extends errors_1.HawcxOAuthError {
|
|
9
9
|
constructor(message, options = {}) {
|
|
@@ -56,4 +56,42 @@ class DelegationResponseError extends DelegationError {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
exports.DelegationResponseError = DelegationResponseError;
|
|
59
|
+
/**
|
|
60
|
+
* The management API response's `X-Response-Signature` is missing, empty, or
|
|
61
|
+
* does not verify (bad signature, disallowed `alg`, kid absent from a freshly
|
|
62
|
+
* fetched JWKS, stale/future `iat`, body hash mismatch, wrong token type).
|
|
63
|
+
* Treat the response as untrusted.
|
|
64
|
+
*/
|
|
65
|
+
class ResponseSignatureInvalidError extends DelegationResponseError {
|
|
66
|
+
constructor(message, options = {}) {
|
|
67
|
+
super(message, options);
|
|
68
|
+
this.code = 'response_signature_invalid';
|
|
69
|
+
this.name = 'ResponseSignatureInvalidError';
|
|
70
|
+
Object.setPrototypeOf(this, ResponseSignatureInvalidError.prototype);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.ResponseSignatureInvalidError = ResponseSignatureInvalidError;
|
|
74
|
+
/**
|
|
75
|
+
* The response signature could not be checked because the verification
|
|
76
|
+
* infrastructure was unavailable: the issuer JWKS fetch failed or timed out,
|
|
77
|
+
* returned a non-200 or malformed document, or the signing `kid` was unknown
|
|
78
|
+
* while a refetch was suppressed by the JWKS refetch cooldown (e.g. during
|
|
79
|
+
* key rotation).
|
|
80
|
+
*
|
|
81
|
+
* **The server already processed the request.** For a non-idempotent write
|
|
82
|
+
* (e.g. `StepUpClient.consumeReceipt`) the operation may have been applied
|
|
83
|
+
* even though this error is thrown — reconcile state rather than blindly
|
|
84
|
+
* retrying. This error does NOT imply the response was genuine: its body is
|
|
85
|
+
* never returned, and an on-path party that can inject responses can also
|
|
86
|
+
* induce this error (e.g. with an unknown `kid`).
|
|
87
|
+
*/
|
|
88
|
+
class ResponseSignatureUnavailableError extends DelegationResponseError {
|
|
89
|
+
constructor(message, options = {}) {
|
|
90
|
+
super(message, options);
|
|
91
|
+
this.code = 'response_signature_unavailable';
|
|
92
|
+
this.name = 'ResponseSignatureUnavailableError';
|
|
93
|
+
Object.setPrototypeOf(this, ResponseSignatureUnavailableError.prototype);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.ResponseSignatureUnavailableError = ResponseSignatureUnavailableError;
|
|
59
97
|
//# sourceMappingURL=exceptions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/delegation/exceptions.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,sCAA4C;AAS5C,MAAa,eAAgB,SAAQ,wBAAe;IAGlD,YAAY,OAAe,EAAE,UAAkC,EAAE;QAC/D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC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IAAI,UAAU,IAAI,CAAC,UAAU,GAAG,CAAC;QAC7C,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAtBD,wDAsBC;AAED;;GAEG;AACH,MAAa,uBAAwB,SAAQ,eAAe;IAC1D,YAAY,OAAe,EAAE,UAAkC,EAAE;QAC/D,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC;CACF;AAND,0DAMC;AASD;;;;;GAKG;AACH,MAAa,6BAA8B,SAAQ,uBAAuB;IAGxE,YAAY,OAAe,EAAE,UAAkC,EAAE;QAC/D,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAHV,SAAI,GAA+B,4BAA4B,CAAC;QAI9E,IAAI,CAAC,IAAI,GAAG,+BAA+B,CAAC;QAC5C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,6BAA6B,CAAC,SAAS,CAAC,CAAC;IACvE,CAAC;CACF;AARD,sEAQC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAa,iCAAkC,SAAQ,uBAAuB;IAG5E,YAAY,OAAe,EAAE,UAAkC,EAAE;QAC/D,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAHV,SAAI,GAA+B,gCAAgC,CAAC;QAIlF,IAAI,CAAC,IAAI,GAAG,mCAAmC,CAAC;QAChD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,iCAAiC,CAAC,SAAS,CAAC,CAAC;IAC3E,CAAC;CACF;AARD,8EAQC"}
|
|
@@ -49,11 +49,15 @@ export interface DeviceOperationOptions {
|
|
|
49
49
|
deviceId: string;
|
|
50
50
|
}
|
|
51
51
|
export interface DelegationRequestOptions<TPayload extends JsonObject> {
|
|
52
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* API endpoint path relative to the base URL (e.g., "/hc_auth/v5/update/initiate").
|
|
54
|
+
* Must start with a single "/". When `includeBaseUrl` is false this is an
|
|
55
|
+
* absolute https URL instead.
|
|
56
|
+
*/
|
|
53
57
|
endpoint: string;
|
|
54
58
|
/** Request payload dictionary to be encrypted and sent */
|
|
55
59
|
payload: TPayload;
|
|
56
|
-
/** If true,
|
|
60
|
+
/** If true, joins endpoint onto the base URL (default: true) */
|
|
57
61
|
includeBaseUrl?: boolean;
|
|
58
62
|
/** Optional additional HTTP headers (e.g., API keys) */
|
|
59
63
|
headers?: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hawcx.d.ts","sourceRoot":"","sources":["../../src/delegation/hawcx.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAuD,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAGvG,oBAAY,SAAS;IACnB,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,MAAM,WAAW,2BAA2B;IAC1C,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gEAAgE;IAChE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,gCAAiC,SAAQ,2BAA2B;IACnF,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,0BAA0B,GAAG,2BAA2B,GAAG,qBAAqB,CAAC;AAE7F,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,SAAS,EAAE,SAAS,GAAG,MAAM,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AAE,IAAI,SAAS,UAAU,EAC5D,OAAO,EAAE,wBAAwB,CAAC,IAAI,CAAC,GACtC,OAAO,CAAC,IAAI,CAAC;IAKhB,SAAgB,GAAG;4BACS,kBAAkB,KAAG,OAAO,CAAC,UAAU,CAAC;0BAmC1C,gBAAgB,KAAG,OAAO,CAAC,UAAU,CAAC;MAkB9D;IAEF,SAAgB,KAAK;iCACY,MAAM,KAAG,OAAO,CAAC,UAAU,CAAC;MAO3D;IAEF,SAAgB,OAAO;uBACA,MAAM,KAAG,OAAO,CAAC,UAAU,CAAC;0BAOzB,sBAAsB,KAAG,OAAO,CAAC,UAAU,CAAC;4BAO1C,sBAAsB,KAAG,OAAO,CAAC,UAAU,CAAC;0BAO9C,sBAAsB,KAAG,OAAO,CAAC,UAAU,CAAC;MAOpE;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hawcx.js","sourceRoot":"","sources":["../../src/delegation/hawcx.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,uCAAuG;AACvG,6CAAsD;AAEtD,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB;
|
|
1
|
+
{"version":3,"file":"hawcx.js","sourceRoot":"","sources":["../../src/delegation/hawcx.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAGH,uCAAuG;AACvG,6CAAsD;AAEtD,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAJW,SAAS,yBAAT,SAAS,QAIpB;AAgED,MAAa,gBAAgB;IAM3B,YAAY,OAA6E;QAiCzE,QAAG,GAAG;YACpB,QAAQ,EAAE,KAAK,EAAE,OAA2B,EAAuB,EAAE;gBACnE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE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AE,CAAC;QAC3C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,OAAO,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAClC,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,OAAO,CACX,OAAuC;QAEvC,MAAM,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,gBAAgB,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC;QAC3E,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,IAAI,CAAa,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;CAkGF;AAvID,4CAuIC"}
|
|
@@ -5,5 +5,6 @@ export { DelegationClient, MfaMethod, } from './hawcx';
|
|
|
5
5
|
export type { DelegationClientBaseOptions, DelegationClientSecretKeyOptions, DelegationClientKeyOptions, MfaInitiateOptions, MfaVerifyOptions, DeviceOperationOptions, DelegationRequestOptions, } from './hawcx';
|
|
6
6
|
export { parseHawcxSecretKey, generateCredentialBlob, } from './credentials';
|
|
7
7
|
export type { ParsedCredentials, HawcxCredentialBlob, } from './credentials';
|
|
8
|
-
export { DelegationError, DelegationCryptoError, DelegationRequestError, DelegationResponseError, } from './exceptions';
|
|
8
|
+
export { DelegationError, DelegationCryptoError, DelegationRequestError, DelegationResponseError, ResponseSignatureInvalidError, ResponseSignatureUnavailableError, } from './exceptions';
|
|
9
|
+
export type { ResponseSignatureErrorCode } from './exceptions';
|
|
9
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delegation/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,gBAAgB,EAChB,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/delegation/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,gBAAgB,EAChB,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,2BAA2B,EAC3B,gCAAgC,EAChC,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,GACzB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,6BAA6B,EAC7B,iCAAiC,GAClC,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/delegation/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Hawcx OAuth Client SDK - Delegation Module
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DelegationResponseError = exports.DelegationRequestError = exports.DelegationCryptoError = exports.DelegationError = exports.generateCredentialBlob = exports.parseHawcxSecretKey = exports.MfaMethod = exports.DelegationClient = void 0;
|
|
6
|
+
exports.ResponseSignatureUnavailableError = exports.ResponseSignatureInvalidError = exports.DelegationResponseError = exports.DelegationRequestError = exports.DelegationCryptoError = exports.DelegationError = exports.generateCredentialBlob = exports.parseHawcxSecretKey = exports.MfaMethod = exports.DelegationClient = void 0;
|
|
7
7
|
var hawcx_1 = require("./hawcx");
|
|
8
8
|
Object.defineProperty(exports, "DelegationClient", { enumerable: true, get: function () { return hawcx_1.DelegationClient; } });
|
|
9
9
|
Object.defineProperty(exports, "MfaMethod", { enumerable: true, get: function () { return hawcx_1.MfaMethod; } });
|
|
@@ -15,4 +15,6 @@ Object.defineProperty(exports, "DelegationError", { enumerable: true, get: funct
|
|
|
15
15
|
Object.defineProperty(exports, "DelegationCryptoError", { enumerable: true, get: function () { return exceptions_1.DelegationCryptoError; } });
|
|
16
16
|
Object.defineProperty(exports, "DelegationRequestError", { enumerable: true, get: function () { return exceptions_1.DelegationRequestError; } });
|
|
17
17
|
Object.defineProperty(exports, "DelegationResponseError", { enumerable: true, get: function () { return exceptions_1.DelegationResponseError; } });
|
|
18
|
+
Object.defineProperty(exports, "ResponseSignatureInvalidError", { enumerable: true, get: function () { return exceptions_1.ResponseSignatureInvalidError; } });
|
|
19
|
+
Object.defineProperty(exports, "ResponseSignatureUnavailableError", { enumerable: true, get: function () { return exceptions_1.ResponseSignatureUnavailableError; } });
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/delegation/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iCAGiB;AAFf,yGAAA,gBAAgB,OAAA;AAChB,kGAAA,SAAS,OAAA;AAYX,6CAGuB;AAFrB,kHAAA,mBAAmB,OAAA;AACnB,qHAAA,sBAAsB,OAAA;AAOxB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/delegation/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,iCAGiB;AAFf,yGAAA,gBAAgB,OAAA;AAChB,kGAAA,SAAS,OAAA;AAYX,6CAGuB;AAFrB,kHAAA,mBAAmB,OAAA;AACnB,qHAAA,sBAAsB,OAAA;AAOxB,2CAOsB;AANpB,6GAAA,eAAe,OAAA;AACf,mHAAA,qBAAqB,OAAA;AACrB,oHAAA,sBAAsB,OAAA;AACtB,qHAAA,uBAAuB,OAAA;AACvB,2HAAA,6BAA6B,OAAA;AAC7B,+HAAA,iCAAiC,OAAA"}
|
|
@@ -5,11 +5,15 @@ import { Verifier, EciesX25519Encryptor, EciesX25519Decryptor, Ed25519Signer, Rs
|
|
|
5
5
|
export type Signer = Ed25519Signer | RsaPssSigner;
|
|
6
6
|
export type JsonObject = Record<string, unknown> | object;
|
|
7
7
|
export interface SecureRequestOptions<TPayload extends JsonObject> {
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* API endpoint path relative to the base URL (e.g., "/mfa/update"). Must
|
|
10
|
+
* start with a single "/". When `includeBaseUrl` is false this is instead
|
|
11
|
+
* an absolute URL, which must be https (http only for loopback hosts).
|
|
12
|
+
*/
|
|
9
13
|
endpoint: string;
|
|
10
14
|
/** Request payload dictionary to be encrypted and sent */
|
|
11
15
|
payload: TPayload;
|
|
12
|
-
/** If true,
|
|
16
|
+
/** If true, joins endpoint onto the base URL (default: true) */
|
|
13
17
|
includeBaseUrl?: boolean;
|
|
14
18
|
/** Optional additional HTTP headers (e.g., API keys) */
|
|
15
19
|
headers?: Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/delegation/transport.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,QAAQ,EACR,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACb,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/delegation/transport.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAEL,QAAQ,EACR,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,YAAY,EACb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
const crypto_1 = require("./crypto");
|
|
8
8
|
const exceptions_1 = require("./exceptions");
|
|
9
|
+
const url_1 = require("../internal/url");
|
|
10
|
+
/** Config/URL errors surface as `DelegationRequestError`, like other request failures. */
|
|
11
|
+
const urlError = (message, cause) => new exceptions_1.DelegationRequestError(message, cause === undefined ? {} : { cause });
|
|
9
12
|
class DelegationTransport {
|
|
10
13
|
constructor(options) {
|
|
11
|
-
|
|
14
|
+
// Validated once (TOB-HSDK-13); requests are joined structurally below.
|
|
15
|
+
this.baseUrl = (0, url_1.parseSecureBaseUrl)('baseUrl', options.baseUrl, urlError);
|
|
12
16
|
this.signer = options.signer;
|
|
13
17
|
this.verifier = options.verifier;
|
|
14
18
|
this.encryptor = options.encryptor;
|
|
@@ -21,6 +25,10 @@ class DelegationTransport {
|
|
|
21
25
|
*/
|
|
22
26
|
async send(options) {
|
|
23
27
|
const { endpoint, payload, includeBaseUrl = true, headers: extraHeaders = {} } = options;
|
|
28
|
+
// Resolve and validate the target before signing anything (fail closed).
|
|
29
|
+
const url = includeBaseUrl
|
|
30
|
+
? (0, url_1.safeJoinUrl)(this.baseUrl, endpoint, 'endpoint', urlError)
|
|
31
|
+
: (0, url_1.assertSecureUrl)('endpoint', endpoint, urlError).href;
|
|
24
32
|
let encryptedEnv;
|
|
25
33
|
let headers;
|
|
26
34
|
try {
|
|
@@ -46,7 +54,6 @@ class DelegationTransport {
|
|
|
46
54
|
let response;
|
|
47
55
|
let responseData;
|
|
48
56
|
try {
|
|
49
|
-
const url = includeBaseUrl ? this.baseUrl + endpoint : endpoint;
|
|
50
57
|
const controller = new AbortController();
|
|
51
58
|
const timeoutId = setTimeout(() => controller.abort(), this.timeoutSeconds * 1000);
|
|
52
59
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/delegation/transport.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,qCAOkB;AAClB,6CAA+E;
|
|
1
|
+
{"version":3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C,MAAM,IAAI,GAAG,EAAE,CAAC;gBAC3B,MAAM,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;gBACtE,MAAM,IAAI,mCAAsB,CAAC,gBAAgB,QAAQ,CAAC,MAAM,EAAE,EAAE;oBAClE,UAAU,EAAE,QAAQ,CAAC,MAAM;oBAC3B,YAAY,EAAE,YAAY;oBAC1B,KAAK,EAAE,KAAK;iBACb,CAAC,CAAC;YACL,CAAC;YAED,MAAM,IAAI,oCAAuB,CAAC,mCAAmC,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;CACF;AA/ID,kDA+IC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -19,5 +19,5 @@ export type { HawcxOAuthErrorFields } from './errors';
|
|
|
19
19
|
export { ClientAssertionSigner, CLIENT_ASSERTION_TYPE } from './client-assertion';
|
|
20
20
|
export * from './delegation';
|
|
21
21
|
export * from './stepup';
|
|
22
|
-
export declare const VERSION = "
|
|
22
|
+
export declare const VERSION = "6.0.0";
|
|
23
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -44,5 +44,5 @@ Object.defineProperty(exports, "CLIENT_ASSERTION_TYPE", { enumerable: true, get:
|
|
|
44
44
|
__exportStar(require("./delegation"), exports);
|
|
45
45
|
// Step-up module
|
|
46
46
|
__exportStar(require("./stepup"), exports);
|
|
47
|
-
exports.VERSION = '
|
|
47
|
+
exports.VERSION = '6.0.0';
|
|
48
48
|
//# sourceMappingURL=index.js.map
|