oauth2-cli 1.2.4 → 1.2.5
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 +7 -0
- package/dist/Client.js +3 -29
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [1.2.5](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.4...oauth2-cli/1.2.5) (2026-03-08)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* use the full power of requestish to build request URL ([ff4da89](https://github.com/battis/oauth2-cli/commit/ff4da8900e83df0d4dbd941058084523ad7ce3a6))
|
|
11
|
+
|
|
5
12
|
## [1.2.4](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.3...oauth2-cli/1.2.4) (2026-03-08)
|
|
6
13
|
|
|
7
14
|
|
package/dist/Client.js
CHANGED
|
@@ -254,35 +254,9 @@ export class Client extends EventEmitter {
|
|
|
254
254
|
* @param dPoPOptions Optional, see {@link OpenIDClient.DPoPOptions}
|
|
255
255
|
*/
|
|
256
256
|
async request(url, method = 'GET', body, headers = {}, dPoPOptions) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
catch (error) {
|
|
261
|
-
if (this.base_url || this.credentials.issuer) {
|
|
262
|
-
try {
|
|
263
|
-
url = new URL(url, this.base_url || this.credentials.issuer);
|
|
264
|
-
}
|
|
265
|
-
catch (error) {
|
|
266
|
-
throw new Error(`${this.name} request url invalid`, {
|
|
267
|
-
cause: {
|
|
268
|
-
url,
|
|
269
|
-
base_url: this.base_url,
|
|
270
|
-
issuer: this.credentials.issuer,
|
|
271
|
-
error
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
throw new Error(`${this.name} request url invalid`, {
|
|
278
|
-
cause: {
|
|
279
|
-
url,
|
|
280
|
-
error
|
|
281
|
-
}
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
const request = async () => await OpenIDClient.fetchProtectedResource(...(await this.prepareRequest(await this.getConfiguration(), (await this.getToken()).access_token, requestish.URL.from(requestish.URLSearchParams.appendTo(url, this.inject?.search || {})), method, await requestish.Body.from(body), requestish.Headers.merge(this.inject?.headers, headers), dPoPOptions)));
|
|
257
|
+
url = new URL(url, this.base_url || this.credentials.issuer);
|
|
258
|
+
url = requestish.URL.from(requestish.URLSearchParams.appendTo(url, requestish.URLSearchParams.merge(this.inject?.search, url.searchParams)));
|
|
259
|
+
const request = async () => await OpenIDClient.fetchProtectedResource(...(await this.prepareRequest(await this.getConfiguration(), (await this.getToken()).access_token, url, method, await requestish.Body.from(body), requestish.Headers.merge(this.inject?.headers, headers), dPoPOptions)));
|
|
286
260
|
try {
|
|
287
261
|
return this.prepareResponse(await request());
|
|
288
262
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oauth2-cli",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "Acquire API access tokens via OAuth 2.0 / OpenID Connect within CLI tools",
|
|
5
5
|
"homepage": "https://github.com/battis/oauth2-cli/tree/main/packages/oauth2-cli#readme",
|
|
6
6
|
"repository": {
|