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