oauth2-cli 1.2.3 → 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 +14 -0
- package/dist/Client.js +3 -18
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
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
|
+
|
|
12
|
+
## [1.2.4](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.3...oauth2-cli/1.2.4) (2026-03-08)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* actually fix base_url completion removing search params ([2575df7](https://github.com/battis/oauth2-cli/commit/2575df7250ec1c5c0ba76ab5f7babc40b2e5a07d))
|
|
18
|
+
|
|
5
19
|
## [1.2.3](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.2...oauth2-cli/1.2.3) (2026-03-08)
|
|
6
20
|
|
|
7
21
|
## [1.2.2](https://github.com/battis/oauth2-cli/compare/oauth2-cli/1.2.1...oauth2-cli/1.2.2) (2026-03-08)
|
package/dist/Client.js
CHANGED
|
@@ -254,24 +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
|
-
url = new URL(url, this.base_url || this.credentials.issuer);
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
throw new Error(`${this.name} request url invalid`, {
|
|
266
|
-
cause: {
|
|
267
|
-
base_url: this.base_url,
|
|
268
|
-
issuer: this.credentials.issuer,
|
|
269
|
-
error
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
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)));
|
|
275
260
|
try {
|
|
276
261
|
return this.prepareResponse(await request());
|
|
277
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": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"open": "^11.0.0",
|
|
24
24
|
"openid-client": "^6.8.2",
|
|
25
25
|
"ora": "^9.3.0",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"requestish": "0.1.10",
|
|
27
|
+
"gcrtl": "0.1.11"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@battis/descriptive-types": "^0.2.6",
|