@context-use/open-sync 0.5.1 → 0.5.2
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/package.json
CHANGED
package/src/http/providers.ts
CHANGED
|
@@ -51,7 +51,12 @@ export function createProviderController(input: {
|
|
|
51
51
|
await input.providers.configure({ ...(await scope(request)), ...params, ...body }),
|
|
52
52
|
{
|
|
53
53
|
params: t.Object({ service }),
|
|
54
|
-
body: t.Object({
|
|
54
|
+
body: t.Object({
|
|
55
|
+
values,
|
|
56
|
+
requestedScopes: t.Optional(
|
|
57
|
+
t.Array(t.String({ minLength: 1, maxLength: 256 }), { minItems: 1, maxItems: 128 }),
|
|
58
|
+
),
|
|
59
|
+
}),
|
|
55
60
|
},
|
|
56
61
|
)
|
|
57
62
|
.post(
|
|
@@ -124,7 +124,13 @@ export class ProviderService {
|
|
|
124
124
|
),
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
async configure(
|
|
127
|
+
async configure(
|
|
128
|
+
input: ProviderScope & {
|
|
129
|
+
service: string;
|
|
130
|
+
values: Record<string, string>;
|
|
131
|
+
requestedScopes?: string[];
|
|
132
|
+
},
|
|
133
|
+
) {
|
|
128
134
|
this.guard(input);
|
|
129
135
|
if (!(await this.input.canConfigure(input))) {
|
|
130
136
|
fail('forbidden');
|
|
@@ -143,7 +149,10 @@ export class ProviderService {
|
|
|
143
149
|
await this.input.connector.call({
|
|
144
150
|
path: `/api/oauth/configs/${encodeURIComponent(input.service)}`,
|
|
145
151
|
method: 'PUT',
|
|
146
|
-
body:
|
|
152
|
+
body: {
|
|
153
|
+
...oauthClientValues({ auth, values: input.values }),
|
|
154
|
+
requestedScopes: input.requestedScopes,
|
|
155
|
+
},
|
|
147
156
|
});
|
|
148
157
|
},
|
|
149
158
|
});
|