@oxyhq/core 3.8.0 → 3.8.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/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/mixins/OxyServices.user.js +12 -1
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/mixins/OxyServices.user.js +12 -1
- package/dist/types/.tsbuildinfo +1 -1
- package/dist/types/mixins/OxyServices.user.d.ts +20 -0
- package/package.json +1 -1
- package/src/mixins/OxyServices.user.ts +28 -1
|
@@ -230,6 +230,17 @@ export function OxyServicesUserMixin(Base) {
|
|
|
230
230
|
* by `id`); each is run through `normalizeUserIdentity`, matching
|
|
231
231
|
* `getUserById`.
|
|
232
232
|
*
|
|
233
|
+
* **Service-token auth (required).** `/users/by-ids` is a server-to-server
|
|
234
|
+
* bulk fetch of PUBLIC user data and is called via `makeServiceRequest`,
|
|
235
|
+
* which attaches `Authorization: Bearer <serviceToken>`. oxy-api's CSRF
|
|
236
|
+
* middleware skips bearer-authenticated requests, so the calling client
|
|
237
|
+
* MUST be service-configured (`configureServiceAuth(apiKey, apiSecret)`)
|
|
238
|
+
* before invoking this method; otherwise `getServiceToken()` throws because
|
|
239
|
+
* no credentials are available. (A plain user-session request fails here:
|
|
240
|
+
* server-to-server there is no cookie jar, so the auto-attached
|
|
241
|
+
* `X-CSRF-Token` has no matching cookie and oxy-api rejects the POST with
|
|
242
|
+
* 403 "CSRF token missing".)
|
|
243
|
+
*
|
|
233
244
|
* Resilience: chunks are independent. A failed chunk is logged and skipped
|
|
234
245
|
* — the method returns every user that resolved successfully rather than
|
|
235
246
|
* discarding the whole call on one chunk's failure. An empty/whitespace-only
|
|
@@ -250,7 +261,7 @@ export function OxyServicesUserMixin(Base) {
|
|
|
250
261
|
// Run chunks concurrently; a single chunk failure must not sink the rest.
|
|
251
262
|
const settled = await Promise.all(chunks.map(async (chunk) => {
|
|
252
263
|
try {
|
|
253
|
-
const users = await this.
|
|
264
|
+
const users = await this.makeServiceRequest('POST', '/users/by-ids', { ids: chunk });
|
|
254
265
|
return Array.isArray(users) ? users.map((user) => normalizeUserIdentity(user)) : [];
|
|
255
266
|
}
|
|
256
267
|
catch (error) {
|