@oauth2-cli/qui-cli 0.5.6 → 0.5.8
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/OAuth2.d.ts +2 -1
- package/dist/OAuth2.js +11 -2
- package/package.json +1 -1
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
|
+
## [0.5.8](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.7...qui-cli-plugin/0.5.8) (2026-01-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add debugging output for requests ([8066cab](https://github.com/battis/oauth2-cli/commit/8066cabf56521f43ff90af21edabd9c20997e4cb))
|
|
11
|
+
|
|
12
|
+
## [0.5.7](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.6...qui-cli-plugin/0.5.7) (2026-01-17)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* include scope param ([abf53c1](https://github.com/battis/oauth2-cli/commit/abf53c156a226e51c771a405058640a380407813))
|
|
18
|
+
|
|
5
19
|
## [0.5.6](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.5...qui-cli-plugin/0.5.6) (2026-01-15)
|
|
6
20
|
|
|
7
21
|
|
package/dist/OAuth2.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as Plugin from '@qui-cli/plugin';
|
|
|
4
4
|
import * as OAuth2CLI from 'oauth2-cli';
|
|
5
5
|
export * from 'oauth2-cli';
|
|
6
6
|
export * from './EnvironmentStorage.js';
|
|
7
|
-
type ParamNames = 'clientId' | 'clientSecret' | 'redirectUri' | 'authorizationEndpoint' | 'tokenEndpoint' | 'tokenPath' | 'accessToken';
|
|
7
|
+
type ParamNames = 'clientId' | 'clientSecret' | 'scope' | 'redirectUri' | 'authorizationEndpoint' | 'tokenEndpoint' | 'tokenPath' | 'accessToken';
|
|
8
8
|
type EnvironmentVars = Record<ParamNames, string>;
|
|
9
9
|
type SupportUrls = Record<ParamNames, URLString>;
|
|
10
10
|
type Hints = Record<ParamNames, string>;
|
|
@@ -17,6 +17,7 @@ type Usage = {
|
|
|
17
17
|
export type Configuration = Plugin.Configuration & {
|
|
18
18
|
clientId?: string;
|
|
19
19
|
clientSecret?: string;
|
|
20
|
+
scope?: string;
|
|
20
21
|
redirectUri?: URLString;
|
|
21
22
|
headers?: Record<string, string>;
|
|
22
23
|
authorizationEndpoint?: URLString;
|
package/dist/OAuth2.js
CHANGED
|
@@ -21,6 +21,7 @@ export class OAuth2Plugin {
|
|
|
21
21
|
opt: {
|
|
22
22
|
clientId: 'clientId',
|
|
23
23
|
clientSecret: 'clientSecret',
|
|
24
|
+
scope: 'scope',
|
|
24
25
|
redirectUri: 'redirectUri',
|
|
25
26
|
authorizationEndpoint: 'authorizationEndpoint',
|
|
26
27
|
tokenEndpoint: 'tokenEndpoint',
|
|
@@ -33,6 +34,7 @@ export class OAuth2Plugin {
|
|
|
33
34
|
env: {
|
|
34
35
|
clientId: 'CLIENT_ID',
|
|
35
36
|
clientSecret: 'CLIENT_SECRET',
|
|
37
|
+
scope: 'SCOPE',
|
|
36
38
|
redirectUri: 'REDIRECT_URI',
|
|
37
39
|
authorizationEndpoint: 'AUTHORIZATION_ENDPOINT',
|
|
38
40
|
tokenEndpoint: 'TOKEN_ENDPOINT',
|
|
@@ -86,6 +88,8 @@ export class OAuth2Plugin {
|
|
|
86
88
|
`${Colors.value(this.cliConfig.env.clientId)}, if present.`,
|
|
87
89
|
clientSecret: `OAuth 2.0 client secret. Defaults to environment variable ` +
|
|
88
90
|
`${Colors.value(this.cliConfig.env.clientSecret)}, if present.`,
|
|
91
|
+
scope: `OAuth 2.0 scope. Defaults to environment variable ` +
|
|
92
|
+
`${Colors.varName(this.cliConfig.env.scope)}, if present.`,
|
|
89
93
|
redirectUri: `OAuth 2.0 redirect URI, must be to host ${Colors.url('localhost')}. ` +
|
|
90
94
|
`Defaults to environment variable ` +
|
|
91
95
|
`${Colors.value(this.cliConfig.env.redirectUri)}, if present.`,
|
|
@@ -147,7 +151,7 @@ export class OAuth2Plugin {
|
|
|
147
151
|
}
|
|
148
152
|
getClient() {
|
|
149
153
|
if (!this.client) {
|
|
150
|
-
const { clientId: client_id, clientSecret: client_secret, redirectUri: redirect_uri, authorizationEndpoint: authorization_endpoint, tokenEndpoint: token_endpoint, headers, store } = this.cliConfig;
|
|
154
|
+
const { clientId: client_id, clientSecret: client_secret, scope, redirectUri: redirect_uri, authorizationEndpoint: authorization_endpoint, tokenEndpoint: token_endpoint, headers, store } = this.cliConfig;
|
|
151
155
|
if (!client_id) {
|
|
152
156
|
throw new Error('OAuth 2.0 client ID not defined');
|
|
153
157
|
}
|
|
@@ -163,6 +167,7 @@ export class OAuth2Plugin {
|
|
|
163
167
|
this.client = this.instantiateClient({
|
|
164
168
|
client_id,
|
|
165
169
|
client_secret,
|
|
170
|
+
scope,
|
|
166
171
|
redirect_uri,
|
|
167
172
|
authorization_endpoint,
|
|
168
173
|
token_endpoint,
|
|
@@ -176,10 +181,14 @@ export class OAuth2Plugin {
|
|
|
176
181
|
return this.getClient().getToken();
|
|
177
182
|
}
|
|
178
183
|
request(...args) {
|
|
184
|
+
const [url, method, body, headers, dPoPOptions] = args;
|
|
185
|
+
Log.debug({ request: { method, url, headers, body, dPoPOptions } });
|
|
179
186
|
return this.getClient().request(...args);
|
|
180
187
|
}
|
|
181
188
|
requestJSON(...args) {
|
|
182
|
-
|
|
189
|
+
const response = this.getClient().requestJSON(...args);
|
|
190
|
+
Log.debug({ response });
|
|
191
|
+
return response;
|
|
183
192
|
}
|
|
184
193
|
fetch(...args) {
|
|
185
194
|
return this.getClient().fetch(...args);
|
package/package.json
CHANGED