@oauth2-cli/qui-cli 0.6.6 → 0.7.1
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 +82 -81
- package/dist/Client.d.ts +6 -5
- package/dist/OAuth2.d.ts +8 -6
- package/dist/OAuth2.js +13 -5
- package/dist/OAuth2Plugin.d.ts +37 -25
- package/dist/OAuth2Plugin.js +75 -75
- package/dist/Token/EnvironmentStorage.d.ts +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -4
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,261 +2,262 @@
|
|
|
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
|
+
## [0.7.1](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.7.0...qui-cli-plugin/0.7.1) (2026-02-18)
|
|
6
6
|
|
|
7
|
-
## [0.6.5](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.6.4...qui-cli-plugin/0.6.5) (2026-02-16)
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
### Features
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
* provide parameterized credentials with simplified typing ([5a92c67](https://github.com/battis/oauth2-cli/commit/5a92c67dbd4ab52fa4f0b02a910e788f5ae67adb))
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
### Bug Fixes
|
|
15
14
|
|
|
16
|
-
*
|
|
15
|
+
* simplify dependency hierarchy ([0a72c5d](https://github.com/battis/oauth2-cli/commit/0a72c5df3c814e63ad001a2a15fa0bf7ab72b195))
|
|
17
16
|
|
|
18
|
-
## [0.
|
|
17
|
+
## [0.7.0](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.6.6...qui-cli-plugin/0.7.0) (2026-02-17)
|
|
18
|
+
|
|
19
|
+
### ⚠ BREAKING CHANGES
|
|
20
|
+
|
|
21
|
+
- clarify subclass groupings and extensibility
|
|
22
|
+
- simplify credentials structure
|
|
23
|
+
- rename Token.TokenStorage to less redundant Token.Storage
|
|
24
|
+
- simplify namespacing of Injection and Scope
|
|
25
|
+
- improved clarity of errors and causes
|
|
26
|
+
- remove option args for secrets
|
|
19
27
|
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
- add base_url for API requests (but still fall back to issuer, if not present) ([324b071](https://github.com/battis/oauth2-cli/commit/324b0718f6a86b8d29465802a5add7a21cc49192))
|
|
31
|
+
- clarify subclass groupings and extensibility ([4fec372](https://github.com/battis/oauth2-cli/commit/4fec372019603c4bfada0e26d1813b3c196db536))
|
|
32
|
+
- remove option args for secrets ([eaf55ea](https://github.com/battis/oauth2-cli/commit/eaf55ea7f5f1b2ee1fb3f037b9393a4be95bc19a))
|
|
33
|
+
- rename Token.TokenStorage to less redundant Token.Storage ([149d65a](https://github.com/battis/oauth2-cli/commit/149d65ac218a2c230ed8bca76963e44a5a6ff441))
|
|
34
|
+
- simplify credentials structure ([0e95439](https://github.com/battis/oauth2-cli/commit/0e95439a30f78268ddf7363dc4feeb0b1ff0edba))
|
|
35
|
+
- simplify namespacing of Injection and Scope ([b5db750](https://github.com/battis/oauth2-cli/commit/b5db7503f557a0c2092d327742b1bdd82be0edbb))
|
|
20
36
|
|
|
21
37
|
### Bug Fixes
|
|
22
38
|
|
|
23
|
-
|
|
39
|
+
- improved clarity of errors and causes ([9f1ddce](https://github.com/battis/oauth2-cli/commit/9f1ddcec82c3295e39fc8857784634da072e7570))
|
|
40
|
+
- make oauth2-cli peer to allow patches to propogate ([395dfb0](https://github.com/battis/oauth2-cli/commit/395dfb0b89d504dfc1ca92ac23a1ca5722045dda))
|
|
41
|
+
- pass configured views (and base_url) to client ([af8b15f](https://github.com/battis/oauth2-cli/commit/af8b15f359299746cfe4e08c70b28fbd04eabe37))
|
|
42
|
+
- use configured base_url, not just environment variable ([5f82f9d](https://github.com/battis/oauth2-cli/commit/5f82f9d134353bcd54c661189c0666ccc16a040e))
|
|
24
43
|
|
|
25
|
-
## [0.6.
|
|
44
|
+
## [0.6.3](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.6.2...qui-cli-plugin/0.6.3) (2026-02-16)
|
|
45
|
+
|
|
46
|
+
### Bug Fixes
|
|
26
47
|
|
|
48
|
+
- export Request ([bad6d04](https://github.com/battis/oauth2-cli/commit/bad6d0479c6c8481c3ad56aa7b141a73dc04f729))
|
|
49
|
+
|
|
50
|
+
## [0.6.2](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.6.1...qui-cli-plugin/0.6.2) (2026-02-16)
|
|
27
51
|
|
|
28
52
|
### Bug Fixes
|
|
29
53
|
|
|
30
|
-
|
|
54
|
+
- export ClientOptions for instantiateClient implementation ([23eefbf](https://github.com/battis/oauth2-cli/commit/23eefbfa7a29d59e66463922b731183804c7eb62))
|
|
31
55
|
|
|
32
|
-
## [0.6.
|
|
56
|
+
## [0.6.1](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.6.0...qui-cli-plugin/0.6.1) (2026-02-16)
|
|
57
|
+
|
|
58
|
+
### Bug Fixes
|
|
33
59
|
|
|
60
|
+
- fix accidental regression and re-export unregistered components from OAuth2 ([b5b62bb](https://github.com/battis/oauth2-cli/commit/b5b62bb1735f0e899bf84c83b39e61499ee8da44))
|
|
61
|
+
|
|
62
|
+
## [0.6.0](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.11...qui-cli-plugin/0.6.0) (2026-02-15)
|
|
34
63
|
|
|
35
64
|
### ⚠ BREAKING CHANGES
|
|
36
65
|
|
|
37
|
-
|
|
38
|
-
|
|
66
|
+
- limit TokenStorage to storing _only_ refresh_tokens
|
|
67
|
+
- rewritten from scratch to be more easily maintainable
|
|
39
68
|
|
|
40
69
|
### Features
|
|
41
70
|
|
|
42
|
-
|
|
43
|
-
|
|
71
|
+
- limit TokenStorage to storing _only_ refresh_tokens ([3de9c96](https://github.com/battis/oauth2-cli/commit/3de9c96510d15eebd51a0be7d8df278614541f95))
|
|
72
|
+
- rewritten from scratch to be more easily maintainable ([0f764d3](https://github.com/battis/oauth2-cli/commit/0f764d333135ae70bd9b3c4433b7c4a2ef757979))
|
|
44
73
|
|
|
45
74
|
## [0.5.11](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.10...qui-cli-plugin/0.5.11) (2026-01-20)
|
|
46
75
|
|
|
47
|
-
|
|
48
76
|
### Bug Fixes
|
|
49
77
|
|
|
50
|
-
|
|
78
|
+
- further token managment debugging output ([fda83da](https://github.com/battis/oauth2-cli/commit/fda83da8794d2f7b7221224619b34148ae0a8fe1))
|
|
51
79
|
|
|
52
80
|
## [0.5.10](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.9...qui-cli-plugin/0.5.10) (2026-01-18)
|
|
53
81
|
|
|
54
|
-
|
|
55
82
|
### Bug Fixes
|
|
56
83
|
|
|
57
|
-
|
|
84
|
+
- include @qui-cli/log as peer ([422eb25](https://github.com/battis/oauth2-cli/commit/422eb252fb778e8e12c9fe2ecc0d889ed8e82a0a))
|
|
58
85
|
|
|
59
86
|
## [0.5.9](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.8...qui-cli-plugin/0.5.9) (2026-01-17)
|
|
60
87
|
|
|
61
|
-
|
|
62
88
|
### Bug Fixes
|
|
63
89
|
|
|
64
|
-
|
|
90
|
+
- debug request/response/JSON from Client rather than plugin ([2ed73e1](https://github.com/battis/oauth2-cli/commit/2ed73e18089ffed4fe75d717d523fc86e2ae7f91))
|
|
65
91
|
|
|
66
92
|
## [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)
|
|
67
93
|
|
|
68
|
-
|
|
69
94
|
### Features
|
|
70
95
|
|
|
71
|
-
|
|
96
|
+
- add debugging output for requests ([8066cab](https://github.com/battis/oauth2-cli/commit/8066cabf56521f43ff90af21edabd9c20997e4cb))
|
|
72
97
|
|
|
73
98
|
## [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)
|
|
74
99
|
|
|
75
|
-
|
|
76
100
|
### Bug Fixes
|
|
77
101
|
|
|
78
|
-
|
|
102
|
+
- include scope param ([abf53c1](https://github.com/battis/oauth2-cli/commit/abf53c156a226e51c771a405058640a380407813))
|
|
79
103
|
|
|
80
104
|
## [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)
|
|
81
105
|
|
|
82
|
-
|
|
83
106
|
### Bug Fixes
|
|
84
107
|
|
|
85
|
-
|
|
108
|
+
- correctly implement template Client type ([ed6ac1c](https://github.com/battis/oauth2-cli/commit/ed6ac1cc63b1c41eceb93311105a1f61890a07c8))
|
|
86
109
|
|
|
87
110
|
## [0.5.5](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.4...qui-cli-plugin/0.5.5) (2026-01-15)
|
|
88
111
|
|
|
89
|
-
|
|
90
112
|
### Bug Fixes
|
|
91
113
|
|
|
92
|
-
|
|
114
|
+
- getClient() should return the type instantiated by instiateClient() ([46a4507](https://github.com/battis/oauth2-cli/commit/46a450707954917e1f55595fb3e35f0a62f475fc))
|
|
93
115
|
|
|
94
116
|
## [0.5.4](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.3...qui-cli-plugin/0.5.4) (2026-01-15)
|
|
95
117
|
|
|
96
|
-
|
|
97
118
|
### Bug Fixes
|
|
98
119
|
|
|
99
|
-
|
|
120
|
+
- export EnvironmentStorage from class as well as module ([01cb4ea](https://github.com/battis/oauth2-cli/commit/01cb4eaf54beebd16870adbb1b2664b4e585b14f))
|
|
100
121
|
|
|
101
122
|
## [0.5.3](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.2...qui-cli-plugin/0.5.3) (2026-01-15)
|
|
102
123
|
|
|
103
|
-
|
|
104
124
|
### Bug Fixes
|
|
105
125
|
|
|
106
|
-
|
|
126
|
+
- instantiateClient() _returns_ the client ([a302fdb](https://github.com/battis/oauth2-cli/commit/a302fdba916f68756b24319d432cc6adce09a1ba))
|
|
107
127
|
|
|
108
128
|
## [0.5.2](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.1...qui-cli-plugin/0.5.2) (2026-01-15)
|
|
109
129
|
|
|
110
|
-
|
|
111
130
|
### Features
|
|
112
131
|
|
|
113
|
-
|
|
114
|
-
|
|
132
|
+
- allow injection of custom oauth2-cli Client implementations via instantiateClient() ([cb1b94f](https://github.com/battis/oauth2-cli/commit/cb1b94fb1891343f00b5793fd6f7db33e6489c14))
|
|
133
|
+
- re-export all of oauth2-cli under the plugin module/class namespaces ([0cbdafc](https://github.com/battis/oauth2-cli/commit/0cbdafc84853f4a904e33640b65e4f0300f00b4a))
|
|
115
134
|
|
|
116
135
|
## [0.5.1](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.5.0...qui-cli-plugin/0.5.1) (2026-01-15)
|
|
117
136
|
|
|
118
|
-
|
|
119
137
|
### Bug Fixes
|
|
120
138
|
|
|
121
|
-
|
|
139
|
+
- implement convenience methods as methods, not properties ([a3f67fe](https://github.com/battis/oauth2-cli/commit/a3f67fecde50ae19d8cf960fe6828623e745126b))
|
|
122
140
|
|
|
123
141
|
## [0.5.0](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.4.3...qui-cli-plugin/0.5.0) (2026-01-14)
|
|
124
142
|
|
|
125
|
-
|
|
126
143
|
### ⚠ BREAKING CHANGES
|
|
127
144
|
|
|
128
|
-
|
|
129
|
-
|
|
145
|
+
- move to currently active Node.js v24
|
|
146
|
+
- consistent parameter names and URL support links
|
|
130
147
|
|
|
131
148
|
### Features
|
|
132
149
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
150
|
+
- add configurable hints for CLI option parameters ([b78ab2b](https://github.com/battis/oauth2-cli/commit/b78ab2b894a7807e2fced4531930c648fe275304))
|
|
151
|
+
- configurable opt names to avoid collision with multiple APIs ([d147e3e](https://github.com/battis/oauth2-cli/commit/d147e3e9dfce1f0f4629d5a0e7f649258b7e9487))
|
|
152
|
+
- consistent parameter names and URL support links ([671c371](https://github.com/battis/oauth2-cli/commit/671c3715c7218ab3b92e84a6da69835c5148462a))
|
|
137
153
|
|
|
138
154
|
### Bug Fixes
|
|
139
155
|
|
|
140
|
-
|
|
141
|
-
|
|
156
|
+
- export pre-registered plugin as an EJS module ([19b232e](https://github.com/battis/oauth2-cli/commit/19b232e5c65de4fd43fa604c8a3c38718d4a7ab9))
|
|
157
|
+
- move to currently active Node.js v24 ([a651159](https://github.com/battis/oauth2-cli/commit/a6511594460c7fbc9f59e8a86c6b2f17bfb3564e))
|
|
142
158
|
|
|
143
159
|
## [0.4.3](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.4.2...qui-cli-plugin/0.4.3) (2026-01-12)
|
|
144
160
|
|
|
145
|
-
|
|
146
161
|
### Bug Fixes
|
|
147
162
|
|
|
148
|
-
|
|
163
|
+
- more generous peer dependencies ([38cbed2](https://github.com/battis/oauth2-cli/commit/38cbed28d1046fafe73c9458f3a2f3a3799afaa9))
|
|
149
164
|
|
|
150
165
|
## [0.4.2](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.4.1...qui-cli-plugin/0.4.2) (2026-01-04)
|
|
151
166
|
|
|
152
|
-
|
|
153
167
|
### Bug Fixes
|
|
154
168
|
|
|
155
|
-
|
|
169
|
+
- typo in fetchJSON name ([a19ba97](https://github.com/battis/oauth2-cli/commit/a19ba9700e32a69f7714a428b3c5c60739a11c16))
|
|
156
170
|
|
|
157
171
|
## [0.4.1](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.4.0...qui-cli-plugin/0.4.1) (2026-01-04)
|
|
158
172
|
|
|
159
173
|
## [0.4.0](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.3.4...qui-cli-plugin/0.4.0) (2026-01-04)
|
|
160
174
|
|
|
161
|
-
|
|
162
175
|
### ⚠ BREAKING CHANGES
|
|
163
176
|
|
|
164
|
-
|
|
177
|
+
- rename for simplicity
|
|
165
178
|
|
|
166
179
|
### Features
|
|
167
180
|
|
|
168
|
-
|
|
181
|
+
- rename for simplicity ([110c415](https://github.com/battis/oauth2-cli/commit/110c415d03ef06c0d777ffea5c4cdd9d04a068eb))
|
|
169
182
|
|
|
170
183
|
## [0.3.4](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.3.3...qui-cli-plugin/0.3.4) (2026-01-03)
|
|
171
184
|
|
|
172
|
-
|
|
173
185
|
### Bug Fixes
|
|
174
186
|
|
|
175
|
-
|
|
187
|
+
- export ConfigurationProposal ([3c558c2](https://github.com/battis/oauth2-cli/commit/3c558c2dda012872747cf74fb76dcdd2740f04c6))
|
|
176
188
|
|
|
177
189
|
## [0.3.3](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.3.2...qui-cli-plugin/0.3.3) (2026-01-03)
|
|
178
190
|
|
|
179
|
-
|
|
180
191
|
### Bug Fixes
|
|
181
192
|
|
|
182
|
-
|
|
193
|
+
- export request param types ([244f588](https://github.com/battis/oauth2-cli/commit/244f5886148721f2be06c5da5b3a659fa17391da))
|
|
183
194
|
|
|
184
195
|
## [0.3.2](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.3.1...qui-cli-plugin/0.3.2) (2026-01-03)
|
|
185
196
|
|
|
186
|
-
|
|
187
197
|
### Bug Fixes
|
|
188
198
|
|
|
189
|
-
|
|
199
|
+
- export Credentials ([a175394](https://github.com/battis/oauth2-cli/commit/a1753947d1119e2810d22275c6fbca27b0b19db5))
|
|
190
200
|
|
|
191
201
|
## [0.3.1](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.3.0...qui-cli-plugin/0.3.1) (2026-01-03)
|
|
192
202
|
|
|
193
|
-
|
|
194
203
|
### Features
|
|
195
204
|
|
|
196
|
-
|
|
205
|
+
- extend @oauth2-cli/qui-cli-plugin by instantiating new versions ([14713c5](https://github.com/battis/oauth2-cli/commit/14713c5d1c884c9a1d62ca34d0e5c364ffd8f19b))
|
|
197
206
|
|
|
198
207
|
## [0.3.0](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.2.7...qui-cli-plugin/0.3.0) (2025-12-24)
|
|
199
208
|
|
|
200
|
-
|
|
201
209
|
### ⚠ BREAKING CHANGES
|
|
202
210
|
|
|
203
|
-
|
|
211
|
+
- resolve 1Password secret references successfully
|
|
204
212
|
|
|
205
213
|
### Bug Fixes
|
|
206
214
|
|
|
207
|
-
|
|
215
|
+
- resolve 1Password secret references successfully ([c4446e1](https://github.com/battis/oauth2-cli/commit/c4446e197a66271dac3ea8d58ff44725cc6be1db))
|
|
208
216
|
|
|
209
217
|
## [0.2.7](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.2.6...qui-cli-plugin/0.2.7) (2025-12-23)
|
|
210
218
|
|
|
211
|
-
|
|
212
219
|
### Bug Fixes
|
|
213
220
|
|
|
214
|
-
|
|
221
|
+
- remove overriding default redirect_uri ([2268428](https://github.com/battis/oauth2-cli/commit/2268428bf461b3b92301dde9767558ba3ab5f2f5))
|
|
215
222
|
|
|
216
223
|
## [0.2.6](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.2.5...qui-cli-plugin/0.2.6) (2025-12-23)
|
|
217
224
|
|
|
218
225
|
## [0.2.5](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.2.4...qui-cli-plugin/0.2.5) (2025-12-23)
|
|
219
226
|
|
|
220
|
-
|
|
221
227
|
### Bug Fixes
|
|
222
228
|
|
|
223
|
-
|
|
229
|
+
- expose headers configuration ([bac6bcb](https://github.com/battis/oauth2-cli/commit/bac6bcbf351155472494b82ad620f6b4bc19a1e6))
|
|
224
230
|
|
|
225
231
|
## [0.2.4](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.2.3...qui-cli-plugin/0.2.4) (2025-12-23)
|
|
226
232
|
|
|
227
|
-
|
|
228
233
|
### Bug Fixes
|
|
229
234
|
|
|
230
|
-
|
|
235
|
+
- more aggressively fix typing for partial configuration ([97f7e0c](https://github.com/battis/oauth2-cli/commit/97f7e0c034202fb26654677b5a3a836ff989b116))
|
|
231
236
|
|
|
232
237
|
## [0.2.3](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.2.2...qui-cli-plugin/0.2.3) (2025-12-23)
|
|
233
238
|
|
|
234
|
-
|
|
235
239
|
### Bug Fixes
|
|
236
240
|
|
|
237
|
-
|
|
241
|
+
- allow partial override of environment variable names and suppressed opt args ([c8a118b](https://github.com/battis/oauth2-cli/commit/c8a118ba6dae62f29549ef272448a4a6adea553c))
|
|
238
242
|
|
|
239
243
|
## [0.2.2](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.2.1...qui-cli-plugin/0.2.2) (2025-12-23)
|
|
240
244
|
|
|
241
|
-
|
|
242
245
|
### Features
|
|
243
246
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
- add optional typing to requestJSON() ([5f7cf39](https://github.com/battis/oauth2-cli/commit/5f7cf39d8dc0ca86cbe3df7e8493d3273e630573))
|
|
248
|
+
- configurable options and usage ([aadbc4b](https://github.com/battis/oauth2-cli/commit/aadbc4bffc9eda241763ecd9f134963517250e5f))
|
|
249
|
+
- default suppress token path storage ([9df7f4f](https://github.com/battis/oauth2-cli/commit/9df7f4f6312713e2086366350f0c546a975b2c31))
|
|
250
|
+
- provide EnvironmentStorage implementation ([55fc676](https://github.com/battis/oauth2-cli/commit/55fc676716fa1e4830a6a890b6d0bf5cecf0f57f))
|
|
249
251
|
|
|
250
252
|
### Bug Fixes
|
|
251
253
|
|
|
252
|
-
|
|
254
|
+
- update to current [@qui-cli](https://github.com/qui-cli) versions ([d54c521](https://github.com/battis/oauth2-cli/commit/d54c5210e55586ed688afa42840ec2b9e1cffeb0))
|
|
253
255
|
|
|
254
256
|
## [0.2.1](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.2.0...qui-cli-plugin/0.2.1) (2025-09-11)
|
|
255
257
|
|
|
256
|
-
|
|
257
258
|
### Bug Fixes
|
|
258
259
|
|
|
259
|
-
|
|
260
|
+
- update dependencies to address transient openid-client config error ([f0ca9a8](https://github.com/battis/oauth2-cli/commit/f0ca9a8d2bb4551b80a49e48aa43df5ba66a5a9b))
|
|
260
261
|
|
|
261
262
|
## [0.2.0](https://github.com/battis/oauth2-cli/compare/qui-cli-plugin/0.1.1...qui-cli-plugin/0.2.0) (2025-03-09)
|
|
262
263
|
|
package/dist/Client.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { JSONValue } from '@battis/typescript-tricks';
|
|
1
2
|
import * as OAuth2CLI from 'oauth2-cli';
|
|
2
|
-
import type
|
|
3
|
+
import type * as OpenIDClient from 'openid-client';
|
|
3
4
|
import * as requestish from 'requestish';
|
|
4
|
-
export declare class Client extends OAuth2CLI.Client {
|
|
5
|
-
getConfiguration(): Promise<Configuration>;
|
|
5
|
+
export declare class Client<C extends OAuth2CLI.Credentials = OAuth2CLI.Credentials> extends OAuth2CLI.Client<C> {
|
|
6
|
+
getConfiguration(): Promise<OpenIDClient.Configuration>;
|
|
6
7
|
authorize(): Promise<OAuth2CLI.Token.Response>;
|
|
7
8
|
protected refreshTokenGrant(token: OAuth2CLI.Token.Response): Promise<OAuth2CLI.Token.Response | undefined>;
|
|
8
|
-
request(url: requestish.URL.ish, method?: string, body?: FetchBody, headers?: requestish.Headers.ish, dPoPOptions?: DPoPOptions): Promise<Response>;
|
|
9
|
-
requestJSON<
|
|
9
|
+
request(url: requestish.URL.ish, method?: string, body?: OpenIDClient.FetchBody, headers?: requestish.Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<Response>;
|
|
10
|
+
requestJSON<J extends JSONValue = JSONValue>(url: requestish.URL.ish, method?: string, body?: OpenIDClient.FetchBody, headers?: requestish.Headers.ish, dPoPOptions?: OpenIDClient.DPoPOptions): Promise<J>;
|
|
10
11
|
}
|
package/dist/OAuth2.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export declare const
|
|
1
|
+
export declare const configure: (proposal?: import("./OAuth2Plugin.js").Configuration<import("oauth2-cli").Credentials>) => void;
|
|
2
|
+
export declare const options: () => import("@qui-cli/plugin").Options;
|
|
3
|
+
export declare const init: () => import("@qui-cli/plugin").Options;
|
|
4
|
+
export declare const client: () => import("./Client.js").Client<import("oauth2-cli").Credentials>;
|
|
5
|
+
export declare const request: (url: import("requestish/dist/URL.js").ish, method?: string | undefined, body?: import("openid-client").FetchBody, headers?: import("requestish/dist/Headers.js").ish | undefined, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<Response>;
|
|
6
|
+
export declare const requestJSON: <T extends import("@battis/typescript-tricks").JSONValue>(url: import("requestish/dist/URL.js").ish, method?: string | undefined, body?: import("openid-client").FetchBody, headers?: import("requestish/dist/Headers.js").ish | undefined, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<T>;
|
|
7
|
+
export declare const fetch: (input: import("requestish/dist/URL.js").ish, init?: RequestInit | undefined, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<Response>;
|
|
8
|
+
export declare const fetchJSON: <T extends import("@battis/typescript-tricks").JSONValue>(input: import("requestish/dist/URL.js").ish, init?: RequestInit | undefined, dPoPOptions?: import("openid-client").DPoPOptions | undefined) => Promise<T>;
|
package/dist/OAuth2.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { register } from '@qui-cli/plugin';
|
|
1
2
|
import { OAuth2Plugin } from './OAuth2Plugin.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export const
|
|
3
|
+
const plugin = new OAuth2Plugin();
|
|
4
|
+
// @qui-cli/plugin convenience methods
|
|
5
|
+
export const configure = plugin.configure.bind(plugin);
|
|
6
|
+
export const options = plugin.options.bind(plugin);
|
|
7
|
+
export const init = plugin.options.bind(plugin);
|
|
8
|
+
// oauth2-cli convenience methods
|
|
9
|
+
export const client = () => plugin.client;
|
|
10
|
+
export const request = plugin.request.bind(plugin);
|
|
11
|
+
export const requestJSON = plugin.requestJSON.bind(plugin);
|
|
12
|
+
export const fetch = plugin.fetch.bind(plugin);
|
|
13
|
+
export const fetchJSON = plugin.fetchJSON.bind(plugin);
|
|
14
|
+
await register(plugin);
|
package/dist/OAuth2Plugin.d.ts
CHANGED
|
@@ -1,53 +1,65 @@
|
|
|
1
|
-
import { URLString } from '@battis/descriptive-types';
|
|
1
|
+
import { PathString, URLString } from '@battis/descriptive-types';
|
|
2
2
|
import { JSONValue } from '@battis/typescript-tricks';
|
|
3
3
|
import * as Plugin from '@qui-cli/plugin';
|
|
4
4
|
import * as OAuth2CLI from 'oauth2-cli';
|
|
5
|
+
import * as requestish from 'requestish';
|
|
5
6
|
import { Client } from './Client.js';
|
|
6
|
-
type CredentialKey = 'issuer' | 'client_id' | 'client_secret' | 'redirect_uri' | 'authorization_endpoint' | 'token_endpoint' | 'scope';
|
|
7
|
+
type CredentialKey = 'issuer' | 'client_id' | 'client_secret' | 'redirect_uri' | 'authorization_endpoint' | 'token_endpoint' | 'scope' | 'base_url';
|
|
7
8
|
type EnvironmentVars = Record<CredentialKey, string>;
|
|
8
9
|
type SupportUrls = Record<CredentialKey, URLString>;
|
|
9
10
|
type Hints = Record<CredentialKey, string>;
|
|
10
|
-
type
|
|
11
|
-
type OptionSuppression = Record<CredentialKey, boolean>;
|
|
11
|
+
type EnvVarSuppression = Record<CredentialKey, boolean>;
|
|
12
12
|
type Usage = {
|
|
13
13
|
heading: string;
|
|
14
14
|
text?: string[];
|
|
15
15
|
};
|
|
16
|
-
export type Configuration = Plugin.Configuration & {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
export type Configuration<C extends OAuth2CLI.Credentials = OAuth2CLI.Credentials> = Plugin.Configuration & {
|
|
17
|
+
/** OAuth 2.0/OpenID Connect credential set */
|
|
18
|
+
credentials?: Partial<C>;
|
|
19
|
+
/** Base URL for all non-absolute requests */
|
|
20
|
+
base_url?: requestish.URL.ish;
|
|
21
|
+
/** Request components to inject into server requests */
|
|
22
|
+
inject?: OAuth2CLI.Injection;
|
|
23
|
+
/** Refresh token storage service */
|
|
24
|
+
storage?: OAuth2CLI.Token.Storage;
|
|
25
|
+
/** CLI usage section header and text */
|
|
20
26
|
man?: Usage;
|
|
21
|
-
|
|
27
|
+
/** Reference URLs for particular credential values */
|
|
22
28
|
url?: Partial<SupportUrls>;
|
|
29
|
+
/** Hint values for particular credential values */
|
|
23
30
|
hint?: Partial<Hints>;
|
|
31
|
+
/** Actual environment variable names for each credential value */
|
|
24
32
|
env?: Partial<EnvironmentVars>;
|
|
25
|
-
|
|
33
|
+
/** Should a particular credential value _not_ be loaded from the environment? */
|
|
34
|
+
suppress?: Partial<EnvVarSuppression>;
|
|
35
|
+
/** Optional absolute path to EJS view templates directory */
|
|
36
|
+
views?: PathString;
|
|
26
37
|
};
|
|
27
|
-
export declare class OAuth2Plugin<C extends
|
|
38
|
+
export declare class OAuth2Plugin<C extends OAuth2CLI.Credentials = OAuth2CLI.Credentials, L extends Client<C> = Client<C>> {
|
|
28
39
|
readonly name: string;
|
|
29
40
|
[key: string]: unknown;
|
|
30
41
|
private static names;
|
|
31
|
-
private static
|
|
42
|
+
private static registeredPorts;
|
|
32
43
|
constructor(name?: string);
|
|
33
44
|
private credentials?;
|
|
45
|
+
private base_url?;
|
|
34
46
|
private man;
|
|
35
|
-
private
|
|
36
|
-
private url;
|
|
47
|
+
private url?;
|
|
37
48
|
private hint;
|
|
38
49
|
private env;
|
|
39
|
-
private suppress
|
|
40
|
-
private inject
|
|
50
|
+
private suppress?;
|
|
51
|
+
private inject?;
|
|
52
|
+
private views?;
|
|
41
53
|
private storage?;
|
|
42
|
-
private _client
|
|
43
|
-
configure(proposal?: Configuration): void;
|
|
54
|
+
private _client?;
|
|
55
|
+
configure(proposal?: Configuration<C>): void;
|
|
44
56
|
options(): Plugin.Options;
|
|
45
|
-
init(
|
|
46
|
-
protected instantiateClient(options: OAuth2CLI.ClientOptions):
|
|
47
|
-
get client():
|
|
48
|
-
request(...args: Parameters<OAuth2CLI.Client['request']>): Promise<Response>;
|
|
49
|
-
requestJSON<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client['requestJSON']>): Promise<T>;
|
|
50
|
-
fetch(...args: Parameters<OAuth2CLI.Client['fetch']>): Promise<Response>;
|
|
51
|
-
fetchJSON<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client['fetchJSON']>): Promise<T>;
|
|
57
|
+
init(_: Plugin.ExpectedArguments<typeof this.options>): Promise<void>;
|
|
58
|
+
protected instantiateClient(options: OAuth2CLI.ClientOptions<C>): L;
|
|
59
|
+
get client(): L;
|
|
60
|
+
request(...args: Parameters<OAuth2CLI.Client<C>['request']>): Promise<Response>;
|
|
61
|
+
requestJSON<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client<C>['requestJSON']>): Promise<T>;
|
|
62
|
+
fetch(...args: Parameters<OAuth2CLI.Client<C>['fetch']>): Promise<Response>;
|
|
63
|
+
fetchJSON<T extends JSONValue>(...args: Parameters<OAuth2CLI.Client<C>['fetchJSON']>): Promise<T>;
|
|
52
64
|
}
|
|
53
65
|
export {};
|
package/dist/OAuth2Plugin.js
CHANGED
|
@@ -7,7 +7,7 @@ import * as requestish from 'requestish';
|
|
|
7
7
|
export class OAuth2Plugin {
|
|
8
8
|
name;
|
|
9
9
|
static names = [];
|
|
10
|
-
static
|
|
10
|
+
static registeredPorts = {};
|
|
11
11
|
constructor(name = '@oauth2-cli/qui-cli') {
|
|
12
12
|
this.name = name;
|
|
13
13
|
if (OAuth2Plugin.names.includes(name)) {
|
|
@@ -15,17 +15,9 @@ export class OAuth2Plugin {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
credentials;
|
|
18
|
+
base_url;
|
|
18
19
|
man = {
|
|
19
|
-
heading: 'OAuth 2.0 client options'
|
|
20
|
-
};
|
|
21
|
-
opt = {
|
|
22
|
-
issuer: 'issuer',
|
|
23
|
-
client_id: 'clientId',
|
|
24
|
-
client_secret: 'clientSecret',
|
|
25
|
-
scope: 'scope',
|
|
26
|
-
redirect_uri: 'redirectUri',
|
|
27
|
-
authorization_endpoint: 'authorizationEndpoint',
|
|
28
|
-
token_endpoint: 'tokenEndpoint'
|
|
20
|
+
heading: 'OAuth 2.0 / Open ID Connect client options'
|
|
29
21
|
};
|
|
30
22
|
url = undefined;
|
|
31
23
|
hint = {
|
|
@@ -35,13 +27,17 @@ export class OAuth2Plugin {
|
|
|
35
27
|
issuer: 'ISSUER',
|
|
36
28
|
client_id: 'CLIENT_ID',
|
|
37
29
|
client_secret: 'CLIENT_SECRET',
|
|
38
|
-
scope: 'SCOPE',
|
|
39
30
|
redirect_uri: 'REDIRECT_URI',
|
|
40
31
|
authorization_endpoint: 'AUTHORIZATION_ENDPOINT',
|
|
41
|
-
token_endpoint: 'TOKEN_ENDPOINT'
|
|
32
|
+
token_endpoint: 'TOKEN_ENDPOINT',
|
|
33
|
+
base_url: 'BASE_URL',
|
|
34
|
+
scope: 'SCOPE'
|
|
35
|
+
};
|
|
36
|
+
suppress = {
|
|
37
|
+
scope: true
|
|
42
38
|
};
|
|
43
|
-
suppress = undefined;
|
|
44
39
|
inject = undefined;
|
|
40
|
+
views = undefined;
|
|
45
41
|
storage = undefined;
|
|
46
42
|
_client = undefined;
|
|
47
43
|
configure(proposal = {}) {
|
|
@@ -59,10 +55,10 @@ export class OAuth2Plugin {
|
|
|
59
55
|
return c;
|
|
60
56
|
}
|
|
61
57
|
this.credentials = hydrate(proposal.credentials, this.credentials);
|
|
58
|
+
this.base_url = Plugin.hydrate(proposal.base_url, this.base_url);
|
|
62
59
|
this.storage = Plugin.hydrate(proposal.storage, this.storage);
|
|
63
60
|
this.inject = hydrate(proposal.inject, this.inject);
|
|
64
61
|
this.man = Plugin.hydrate(proposal.man, this.man);
|
|
65
|
-
this.opt = hydrate(proposal.opt, this.opt);
|
|
66
62
|
this.url = hydrate(proposal.url, this.url);
|
|
67
63
|
this.hint = hydrate(proposal.hint, this.hint);
|
|
68
64
|
this.env = hydrate(proposal.env, this.env);
|
|
@@ -71,7 +67,7 @@ export class OAuth2Plugin {
|
|
|
71
67
|
const url = requestish.URL.from(this.credentials.redirect_uri);
|
|
72
68
|
if (url.hostname !== 'localhost' &&
|
|
73
69
|
!/^\/https?\/localhost(:\d+)?\//.test(url.pathname)) {
|
|
74
|
-
Log.warning(`The ${Colors.
|
|
70
|
+
Log.warning(`The ${Colors.varName(this.env.redirect_uri)} value ${Colors.url(this.credentials.redirect_uri)} may not work: it ${Colors.keyword('must')} redirect to ${Colors.url('localhost')}`);
|
|
75
71
|
}
|
|
76
72
|
if (url.protocol !== 'http:' &&
|
|
77
73
|
!/^\/http\/localhost(:\d+)?\//.test(url.pathname)) {
|
|
@@ -79,10 +75,10 @@ export class OAuth2Plugin {
|
|
|
79
75
|
`server listening for the redirect is not automatically ` +
|
|
80
76
|
`provisioned with an SSL certificate`);
|
|
81
77
|
}
|
|
82
|
-
if (OAuth2Plugin.
|
|
83
|
-
OAuth2Plugin.
|
|
78
|
+
if (OAuth2Plugin.registeredPorts[url.port] &&
|
|
79
|
+
OAuth2Plugin.registeredPorts[url.port] !== this.name) {
|
|
84
80
|
Log.warning(`The port ${Colors.value(url.port)} has already been registered to another instance of this plugin ` +
|
|
85
|
-
`named ${Colors.value(OAuth2Plugin.
|
|
81
|
+
`named ${Colors.value(OAuth2Plugin.registeredPorts[url.port])}. This will likely cause a failure if both instances of the ` +
|
|
86
82
|
`plugin are listening for redirects at relatively proximate ` +
|
|
87
83
|
`moments in time.`);
|
|
88
84
|
}
|
|
@@ -90,65 +86,67 @@ export class OAuth2Plugin {
|
|
|
90
86
|
}
|
|
91
87
|
options() {
|
|
92
88
|
const descriptions = {
|
|
93
|
-
issuer: `OpenID issuer URL
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
`
|
|
103
|
-
|
|
104
|
-
|
|
89
|
+
issuer: `The OpenID ${Colors.keyword('issuer')} URL is set from the ` +
|
|
90
|
+
`environment variable ${Colors.varName(this.env.issuer)}, if present. ` +
|
|
91
|
+
`The ${Colors.varName(this.env.issuer)} is also used as a base URL for ` +
|
|
92
|
+
`any relative URL in API requests, unless ` +
|
|
93
|
+
`${Colors.varName(this.env.base_url)} is defined.`,
|
|
94
|
+
client_id: `The OAuth 2.0 ${Colors.keyword('client_id')} is set from the ` +
|
|
95
|
+
`environment variable ${Colors.varName(this.env.client_id)}, if ` +
|
|
96
|
+
`present.`,
|
|
97
|
+
client_secret: `The OAuth 2.0 ${Colors.keyword('client_secret')} is set from the ` +
|
|
98
|
+
`environment variable ${Colors.varName(this.env.client_secret)}, if ` +
|
|
99
|
+
`present.`,
|
|
100
|
+
scope: `The OAuth 2.0 ${Colors.keyword('scope')} is set from the environment ` +
|
|
101
|
+
`variable ${Colors.varName(this.env.scope)}, if present.`,
|
|
102
|
+
redirect_uri: `The OAuth 2.0 ${Colors.keyword('redirect_uri')}, which must at least ` +
|
|
103
|
+
`redirect to ${Colors.url('localhost')}, is set from the environment ` +
|
|
104
|
+
`variable ${Colors.varName(this.env.redirect_uri)}, if present.`,
|
|
105
|
+
authorization_endpoint: `The OAuth 2.0 ${Colors.keyword('authorization_endpoint')} is set ` +
|
|
106
|
+
`from the environment variable ` +
|
|
105
107
|
`${Colors.varName(this.env.authorization_endpoint)}, if present.`,
|
|
106
|
-
token_endpoint: `OAuth 2.0
|
|
107
|
-
|
|
108
|
-
`
|
|
109
|
-
`${Colors.varName(this.env.
|
|
108
|
+
token_endpoint: `The OAuth 2.0 ${Colors.keyword('token_endpoint')} is set from the ` +
|
|
109
|
+
`environment variable ${Colors.varName(this.env.token_endpoint)}, if ` +
|
|
110
|
+
`present and will fall back to ` +
|
|
111
|
+
`${Colors.varName(this.env.authorization_endpoint)} if not provided.`,
|
|
112
|
+
base_url: `The base URL to use for API requests is set from the ` +
|
|
113
|
+
`environment variable ${Colors.varName(this.env.base_url)}, if ` +
|
|
114
|
+
`present. If ${Colors.varName(this.env.base_url)} is not defined, ` +
|
|
115
|
+
`${Colors.varName(this.env.issuer)} will be used as a base URL for ` +
|
|
116
|
+
`relative URL requests.`
|
|
110
117
|
};
|
|
111
|
-
const opt = {};
|
|
112
|
-
for (const paramName of Object.keys(descriptions)) {
|
|
113
|
-
if (!this.suppress || !this.suppress[paramName]) {
|
|
114
|
-
const option = { description: descriptions[paramName] };
|
|
115
|
-
if (this.url && this.url[paramName]) {
|
|
116
|
-
option.description = `${option.description} See ${Colors.url(this.url[paramName])} for more information.`;
|
|
117
|
-
}
|
|
118
|
-
if (this.hint[paramName]) {
|
|
119
|
-
option.hint = this.hint[paramName];
|
|
120
|
-
}
|
|
121
|
-
switch (paramName) {
|
|
122
|
-
case 'client_id':
|
|
123
|
-
case 'client_secret':
|
|
124
|
-
option.secret = true;
|
|
125
|
-
}
|
|
126
|
-
const param = this.credentials
|
|
127
|
-
? this.credentials[paramName]
|
|
128
|
-
: undefined;
|
|
129
|
-
if (typeof param === 'string') {
|
|
130
|
-
option.default = param;
|
|
131
|
-
}
|
|
132
|
-
opt[this.opt[paramName]] = option;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
118
|
return {
|
|
136
119
|
man: [
|
|
137
120
|
{ level: 1, text: this.man.heading },
|
|
138
|
-
...(this.man.text || []).map((t) => ({ text: t }))
|
|
139
|
-
|
|
140
|
-
|
|
121
|
+
...(this.man.text || []).map((t) => ({ text: t })),
|
|
122
|
+
...Object.keys(descriptions)
|
|
123
|
+
.filter((key) => !this.suppress || !this.suppress[key])
|
|
124
|
+
.map((key) => ({
|
|
125
|
+
text: descriptions[key] +
|
|
126
|
+
(this.hint[key] ? ` (e.g. ${this.hint[key]})` : '') +
|
|
127
|
+
(this.url && this.url[key]
|
|
128
|
+
? ` See ${Colors.url(this.url[key])} for more information.`
|
|
129
|
+
: '')
|
|
130
|
+
}))
|
|
131
|
+
]
|
|
141
132
|
};
|
|
142
133
|
}
|
|
143
|
-
async init(
|
|
134
|
+
async init(_) {
|
|
144
135
|
const credentials = {};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
const base_url = this.base_url ||
|
|
137
|
+
(await Env.get({
|
|
138
|
+
key: this.env.base_url
|
|
139
|
+
}));
|
|
140
|
+
for (const key of Object.keys(this.env)) {
|
|
141
|
+
if (key !== 'base_url') {
|
|
142
|
+
// FIXME better typing
|
|
143
|
+
// @ts-expect-error 2322
|
|
144
|
+
credentials[key] =
|
|
148
145
|
(this.credentials ? this.credentials[key] : undefined) ||
|
|
149
|
-
|
|
146
|
+
(await Env.get({ key: this.env[key] }));
|
|
147
|
+
}
|
|
150
148
|
}
|
|
151
|
-
this.configure({ credentials });
|
|
149
|
+
this.configure({ credentials, base_url });
|
|
152
150
|
}
|
|
153
151
|
instantiateClient(options) {
|
|
154
152
|
return new OAuth2CLI.Client(options);
|
|
@@ -156,29 +154,31 @@ export class OAuth2Plugin {
|
|
|
156
154
|
get client() {
|
|
157
155
|
if (!this._client) {
|
|
158
156
|
if (!this.credentials?.client_id) {
|
|
159
|
-
throw new Error(`A ${Colors.
|
|
157
|
+
throw new Error(`A ${Colors.varName(this.env.client_id)} ${Colors.keyword('must')} be configured.`);
|
|
160
158
|
}
|
|
161
159
|
if (!this.credentials?.client_secret) {
|
|
162
|
-
throw new Error(`A ${Colors.
|
|
160
|
+
throw new Error(`A ${Colors.varName(this.env.client_secret)} ${Colors.keyword('must')} be configured.`);
|
|
163
161
|
}
|
|
164
162
|
if (!this.credentials?.redirect_uri) {
|
|
165
|
-
throw new Error(`A ${Colors.
|
|
163
|
+
throw new Error(`A ${Colors.varName(this.env.redirect_uri)} ${Colors.keyword('must')} be configured.`);
|
|
166
164
|
}
|
|
167
165
|
if (!this.credentials?.issuer) {
|
|
168
166
|
if (!this.credentials?.authorization_endpoint) {
|
|
169
|
-
throw new Error(`Either an ${Colors.
|
|
170
|
-
`${Colors.
|
|
167
|
+
throw new Error(`Either an ${Colors.varName(this.env.issuer)} or ` +
|
|
168
|
+
`${Colors.varName(this.env.authorization_endpoint)} ` +
|
|
171
169
|
`${Colors.keyword('must')} be configured.`);
|
|
172
170
|
}
|
|
173
171
|
if (!this.credentials?.token_endpoint) {
|
|
174
|
-
throw new Error(`Either an ${Colors.
|
|
175
|
-
`${Colors.
|
|
172
|
+
throw new Error(`Either an ${Colors.varName(this.env.issuer)} or ` +
|
|
173
|
+
`${Colors.varName(this.env.token_endpoint)} ` +
|
|
176
174
|
`${Colors.keyword('must')} be configured.`);
|
|
177
175
|
}
|
|
178
176
|
}
|
|
179
177
|
this._client = this.instantiateClient({
|
|
180
178
|
credentials: this.credentials,
|
|
179
|
+
base_url: this.base_url,
|
|
181
180
|
inject: this.inject,
|
|
181
|
+
views: this.views,
|
|
182
182
|
storage: this.storage
|
|
183
183
|
});
|
|
184
184
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Token } from 'oauth2-cli';
|
|
2
|
-
export declare class EnvironmentStorage implements Token.
|
|
2
|
+
export declare class EnvironmentStorage implements Token.Storage {
|
|
3
3
|
private tokenEnvVar;
|
|
4
4
|
constructor(tokenEnvVar?: string);
|
|
5
5
|
load(): Promise<string | undefined>;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export * from './OAuth2.js';
|
|
4
|
-
|
|
1
|
+
export { Scope, WebServer } from 'oauth2-cli';
|
|
2
|
+
export * from './Client.js';
|
|
3
|
+
export * as OAuth2 from './OAuth2.js';
|
|
4
|
+
export * from './OAuth2Plugin.js';
|
|
5
|
+
export * as Token from './Token/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oauth2-cli/qui-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "@qui-cli/plugin wrapper for oauth2-cli",
|
|
5
5
|
"homepage": "https://github.com/battis/oauth2-cli/tree/main/packages/qui-cli#readme",
|
|
6
6
|
"repository": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@qui-cli/colors": "^3.2.3",
|
|
20
|
-
"oauth2-cli": "0.
|
|
20
|
+
"oauth2-cli": "0.8.1",
|
|
21
21
|
"requestish": "0.1.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"typescript": "^5.9.3"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@qui-cli/env
|
|
37
|
+
"@qui-cli/env": ">=5",
|
|
38
38
|
"@qui-cli/log": ">=3",
|
|
39
39
|
"@qui-cli/plugin": ">=3"
|
|
40
40
|
},
|