@oxy.so/core 1.12.0 → 1.12.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.
@@ -278,8 +278,10 @@ export function OxyServicesUserMixin(Base) {
278
278
  * caller, and returns the SAME public `{ data: PublicUserProfile[] }`
279
279
  * payload (canonical `name.displayName` + `_count`) in every case — no
280
280
  * viewer-specific fields. This method picks the path automatically:
281
- * - **Service-configured host (backend):** when `configureServiceAuth(apiKey,
282
- * apiSecret)` has been called, the chunk is fetched via `makeServiceRequest`
281
+ * - **Service host (backend):** when `configureServiceAuth(apiKey,
282
+ * apiSecret)` has been called, OR the process can attest its workload
283
+ * identity (ADR 0026 — an ECS task with no key pair), the chunk is fetched
284
+ * via `makeServiceRequest`
283
285
  * (attaches `Authorization: Bearer <serviceToken>`). This is the
284
286
  * server-to-server feed/notification hydration path (e.g. Mention's
285
287
  * `PostHydrationService`) and is unchanged.
@@ -310,10 +312,17 @@ export function OxyServicesUserMixin(Base) {
310
312
  for (let i = 0; i < uniqueIds.length; i += USERS_BY_IDS_CHUNK_SIZE) {
311
313
  chunks.push(uniqueIds.slice(i, i + USERS_BY_IDS_CHUNK_SIZE));
312
314
  }
313
- // A backend that called configureServiceAuth() uses the bearer-service
314
- // path; any other caller (browser / RN with a user session) uses the
315
- // user-bearer path.
316
- const useServiceAuth = Boolean(this._serviceApiKey && this._serviceApiSecret);
315
+ // A backend uses the bearer-service path; any other caller (browser / RN
316
+ // with a user session) uses the user-bearer path. "A backend" means one
317
+ // that can get a service token at all — a key pair, OR a task role it can
318
+ // attest. Asking only about the key pair sent every attested backend down
319
+ // the user path with no bearer: an anonymous request, charged to the
320
+ // shared NAT address's per-IP budget and slowed by its 500ms penalty.
321
+ // Measured from Mention's task (2026-09-25): 520ms per anonymous chunk
322
+ // against 20ms with the service token, enough to put its 1.5s hydration
323
+ // deadline out of reach on every cache miss.
324
+ const useServiceAuth = Boolean(this._serviceApiKey && this._serviceApiSecret)
325
+ || await this._canUseWorkloadIdentity();
317
326
  // Run chunks concurrently; a single chunk failure must not sink the rest.
318
327
  const settled = await Promise.all(chunks.map(async (chunk) => {
319
328
  try {